-
Notifications
You must be signed in to change notification settings - Fork 128
Closed
Description
While investigating #369, I found that the reason the linker was complaining that it couldn't find certain assemblies was because it was looking for malformed paths. Certain characters were missing from apparently random places in the middle of path strings.
The reason for this appears to be:
- Blazor's build config generates a command for the linker that includes
-a path1\Assembly1.dll -a path2\Assembly2.dll -a path3\Assembly3.dll ..., where the list of assemblies is all those transitively reachable from the app's entrypoint assembly - All those assemblies can be in totally different directories because of how NuGet works. Therefore if the linker is to find them, we have to specify their locations explictly with an
-a path\AssemblyName.dllentry for each one, or alteratively specify-d pathfor each one, which is equally problematic. - The
Microsoft.CodeAnalysis.CSharp.Featuresassembly pulls in a long list of transitive dependencies, as do various other NuGet packages in real-world use. - The total length of the generated command, then, can easily be many thousands of characters, given that each dependency's path could be 100-200 chars.
- MSBuild has a longstanding bug whereby extremely long commands get corrupted, removing characters from arbitrary points in the middle: Exec and (very) long commands on Windows msbuild#2530
- Thus the linker receives corrupted paths and fails
Proposed workaround:
- Is there any existing way to specify the paths to a large number of transitive dependencies without including them all in the command-line command? For example, do any of the linker config file formats allow us to give path hints for transitive dependencies? Blazor already generates a linker config file as part of its build process, so we could extend this to making it list all the dependencies and their paths.
- Or if not, would you be open to adding a further option to the linker, which is to let the user pass a file that gives the paths to all the dependencies, or perhaps just a list of directory paths in which to search for referenced assemblies?
Metadata
Metadata
Assignees
Labels
No labels