Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

### Fixed
- Reachability scans of .NET projects now read your projects without running any of their build targets, so builds with compiler-less projects such as `Microsoft.Build.Traversal` aggregators no longer fail.

## [1.13.0](https://github.com/SocketDev/socket-cli/releases/tag/v1.13.0) - 2026-11-03

### Added
Expand Down
2 changes: 0 additions & 2 deletions src/commands/manifest/scripts/assemble.mts
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,6 @@ function buildFrameworks(
})),
// In compiler order, which F# depends on.
sources: [...new Set(build?.sources)].filter(exists),
references: [...new Set(build?.references)].filter(exists),
analyzers: [...new Set(build?.analyzers)].filter(exists),
targets: sortedUnique(build?.targets ?? []).filter(exists),
dependencies: [],
classpath: [],
Expand Down
20 changes: 4 additions & 16 deletions src/commands/manifest/scripts/assemble.test.mts
Original file line number Diff line number Diff line change
Expand Up @@ -654,17 +654,13 @@ describe('dotnet records → per-framework sidecar', () => {
'meta\tdotnet\t8.0.414\t',
'project\tLib.csproj\t\tLib\t1.0.0\t.',
'projectSrc\tLib.csproj\t/abs/L.cs\tnet8.0',
'projectSrc\tLib.csproj\t/abs/obj/Lib.AssemblyInfo.cs\tnet8.0',
'projectSrc\tLib.csproj\t/abs/A.cs\tnet8.0',
'projectSrc\tLib.csproj\t/abs/Legacy.cs\tnetstandard2.0',
'projectInfo\tLib.csproj\tnetstandard2.0\tBuildError\tMSB3644: reference assemblies not found',
'projectTgt\tLib.csproj\t/abs/bin/net8.0/Lib.dll\tnet8.0',
'projectInfo\tLib.csproj\tnet8.0\tTargetFrameworkMoniker\t.NETCoreApp,Version=v8.0',
'projectInfo\tLib.csproj\tnet8.0\tDefineConstant\tNET8_0_OR_GREATER',
'projectInfo\tLib.csproj\tnet8.0\tDefineConstant\tDEBUG',
'projectInfo\tLib.csproj\tnet8.0\tFrameworkReference\tMicrosoft.NETCore.App',
'projectInfo\tLib.csproj\tnet8.0\tNullable\tenable',
'projectInfo\tLib.csproj\tnet8.0\tReference\t/packs/ref/net8.0/System.Runtime.dll',
'projectInfo\tLib.csproj\tnet8.0\tReference\t/pkgs/x/ref/net8.0/X.dll',
'projectInfo\tLib.csproj\tnet8.0\tAnalyzer\t/packs/analyzers/Gen.dll',
'projectUsing\tLib.csproj\tnet8.0\tSystem.Linq\t\t0',
'projectUsing\tLib.csproj\tnet8.0\tSystem.Math\t\t1',
'root\ta\tLib.csproj\tnet8.0\t0\tnet8.0\t\tnet8.0',
Expand Down Expand Up @@ -699,29 +695,21 @@ describe('dotnet records → per-framework sidecar', () => {
langVersion: undefined,
nullable: 'enable',
assemblyName: undefined,
buildError: undefined,
frameworkReferences: ['Microsoft.NETCore.App'],
defineConstants: ['NET8_0_OR_GREATER'],
defineConstants: ['DEBUG'],
usings: [
{ namespace: 'System.Linq' },
{ namespace: 'System.Math', static: true },
],
// Compiler order, not sorted.
sources: ['/abs/L.cs', '/abs/obj/Lib.AssemblyInfo.cs'],
references: [
'/packs/ref/net8.0/System.Runtime.dll',
'/pkgs/x/ref/net8.0/X.dll',
],
analyzers: ['/packs/analyzers/Gen.dll'],
sources: ['/abs/L.cs', '/abs/A.cs'],
targets: ['/abs/bin/net8.0/Lib.dll'],
dependencies: ['gone:1.0.0', 'x:1.0.0'],
classpath: ['gone:1.0.0', 'x:1.0.0'],
},
expect.objectContaining({
alias: 'netstandard2.0',
buildError: 'MSB3644: reference assemblies not found',
sources: ['/abs/Legacy.cs'],
references: [],
targets: [],
classpath: ['x:1.0.0'],
}),
Expand Down
19 changes: 9 additions & 10 deletions src/commands/manifest/scripts/dotnet-tool/FactsRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ public void Execute() {
}
foreach (var loaded in postRestore.GetLoadedProjects(path).ToList()) postRestore.UnloadProject(loaded);
}
EndDesignTimeBuilds();
ReportRestoreErrors();
}

Expand Down Expand Up @@ -156,7 +155,7 @@ private bool IsExcludedProject(string path) {
_solution = new SolutionContext(entry, _opts.GlobalProperties);
return _solution.Members.Keys.OrderBy(p => p, StringComparer.Ordinal).ToList();
} catch (Exception e) when (e is InvalidProjectFileException or IOException or JsonException) {
_records.Failure(Rel(entry), $"could not read the solution: {Text.FirstLine(e.Message)}", "");
_records.Failure(Rel(entry), $"could not read the solution: {ErrorText(e)}", "");
return null;
}
}
Expand Down Expand Up @@ -212,13 +211,7 @@ private IEnumerable<string> ProjectReferences(Project project, bool innerBuilds)
}
}
}
return builds
.SelectMany(b => b.GetItems("ProjectReference"))
.Select(item => item.GetMetadataValue("FullPath"))
.Where(full => !string.IsNullOrEmpty(full) && File.Exists(full))
.Select(full => Path.GetFullPath(full))
.Distinct(StringComparer.Ordinal)
.ToList();
return FullPaths(builds.SelectMany(b => b.GetItems("ProjectReference"))).Where(File.Exists).ToList();
}

private void RunRestore() {
Expand Down Expand Up @@ -282,12 +275,18 @@ private Project LoadInnerBuild(Project project, string targetFramework) {
return Load(collection, info.FullPath, info.GlobalProperties);
} catch (InvalidProjectFileException e) {
if (!info.Excluded) {
_records.Unscannable("", $"could not evaluate the project: {Text.FirstLine(e.Message)}", info.Key);
_records.Unscannable("", $"could not evaluate the project: {ErrorText(e)}", info.Key);
}
return null;
}
}

// MSBuild keeps an error's code out of its message.
private static string ErrorText(Exception e) {
var line = Text.FirstLine(e.Message);
return e is InvalidProjectFileException { ErrorCode: { Length: > 0 } code } ? $"{code}: {line}" : line;
}

// Restore errors not already reported from an assets file, then the projects
// left without current assets and without errors of their own.
private void ReportRestoreErrors() {
Expand Down
2 changes: 2 additions & 0 deletions src/commands/manifest/scripts/dotnet-tool/Patterns.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public bool Matches(IReadOnlyCollection<string> names) {
return _includes.Count == 0 || _includes.Any(p => names.Any(p.IsMatch));
}

public bool Matches(string name) => Matches(new[] { name });

private static List<Regex> Parse(string csv) {
return csv
.Split(',')
Expand Down
Loading
Loading