Skip to content

Make ILCompiler more flexible. #2272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 10, 2021

Conversation

mrvoorhe
Copy link
Contributor

@mrvoorhe mrvoorhe commented Sep 9, 2021

The ILCompiler class is giving me some grief. These changes make it a little easier to deal with.

The first issue is that every test fails if ilasm cannot be located. I think it would be better if only the tests that need ilasm fail when it cannot be found. So instead of locating at construction time, locate ilasm when it is needed.

The next issue is that the #if NETCOREAPP logic for finding ilasm doesn't work when Mono.Linker.Tests is in our source tree, using our build process. Currently, when we run the Mono.Linker.Tests in our source tree we are actually being routed down the #else path because our fork is fairly far behind and our version has #if ILLINK instead. That causes us to call LocateIlasmOnWindows which doesn't find ilasm when targeting net5. I think it's fairly harmless to check the current directory for ilasm. This is one way I have managed to restore the ability to locate ilasm in our source tree.

The ILCompiler class is giving me some grief.

The first issue is that every test fails if ilasm cannot be located.  I think it would be better if only the tests that need ilasm fail when it cannot be found.  So instead of locating at construction time, locate ilasm when it is needed.

The next issue is that the `#if NETCOREAPP` logic for finding ilasm doesn't work when Mono.Linker.Tests is in our source tree, using our build process.  Currently, when we run the Mono.Linker.Tests in our source tree we are actually being routed down the `#else` path because our fork is fairly far behind and our version has `#if ILLINK` instead.  That causes us to call `LocateIlasmOnWindows` which doesn't find ilasm when targeting net5.  I think it's fairly harmless to check the current directory for ilasm.  This is one way I have managed to restore the ability to locate ilasm in our source tree.
@marek-safar marek-safar merged commit 0c359ea into dotnet:main Sep 10, 2021
mrvoorhe added a commit to Unity-Technologies/linker that referenced this pull request Sep 13, 2021
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants