Make ILCompiler more flexible. #2272
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 callLocateIlasmOnWindows
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.