-
Notifications
You must be signed in to change notification settings - Fork 123
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
FCS is trying to load a reference assembly on mono. #763
Comments
@matthid Yes, we should never be looking in This case has come up before dotnet/fsharp#2823 If you look at that code carefully, on Mono we currently look in the runtime root first. But then we look in the I think the simplest fix is to do much as we do on non-Mono, i.e. this:
|
@matthid Here's the proposed fix: dotnet/fsharp#2949 Feel free to cherry-pick it here and try it out? |
First: Thanks for the quick help! To be honest now I'm really curious why FAKE 4 (where we updated to fcs 12.0.5 as well) works. And I couldn't reproduce this with the fsi in the fsharp.compiler.tools package. I used the test.fsx in this commit: fsprojects/FAKE@e9eea07) Testing this soon ;) |
Ok I think I figured it out:
I actually was hit by this before. What I'm suggesting is that it works as documented (see #313). Even more interesting: fsprojects/FAKE@18ee098 This commit seems to workaround the problem. I assumed loading the Mono.Cecil reference before would make it work. However when you compare that with the original reported problem from @haf (causiq/RingBuffer@a3282d7#diff-879359970577bc1dba6b3bc3fc59e6d2) He referenced @haf I'd assume adding some code which uses |
I'd assume there are some additional problems to the one just fixed. But we will see when I reference these issues next time :) For now I have a workaround and I'll wait if @cloudRoutine can make a build of https://github.com/matthid/FSharp.Compiler.Service/commits/fix_fcs_763 for testing (I cannot get it to build I really think the fix works, but I'm not planning to do a real FAKE 4 release (which has the same problem) with a custom FCS build anyway so my netcore branch can wait for a FCS release as well :) |
dotnet/fsharp#2887 looks relevant here. That fix has now been integrated into this repo |
BTW the fix to avoid the API directory is being integrated here: #767 |
I didn't know that. It makes things really hard when there are rules like this lurking around. |
@dsyme Yeah so much time wasted because of all of this ;). I can understand that it might make things different. I don't know the codebase but it might be different to replace "better" matching assemblies once we know them, but we could at least trigger a warning when we see that a Later I don't really know why it depends on the code as well (and not only on the reference order). This smells like another bug :) Hope this makes at least some kind of sense :) |
Note also that I didn't suggested to make an exception for |
Yes dotnet/fsharp#2863 is most likely related. I'd assume its just another symptom of how our current way of doing this is wrong :). |
@matthid When you get the chance could you validate that the repro steps now pass for latest published FCS? |
I really have no idea where that comes from.
I'm just trying to build a new FAKE version, but apparently FCS tries to load a reference assembly which is never a good idea (they should be used for compiling only).
Repro steps
On a travis like system (Mono JIT compiler version 4.8.1 (Stable 4.8.1.0/22a39d7 Wed Apr 12 12:00:40 UTC 2017))
git clone https://github.com/matthid/FAKE.git
git checkout -b fix_bug 7b5a00b67a364a3d3efb0ca0bfe9b266f2209b77
./build.sh
This builds FAKE and tries to run it with the build script (a bootstrapping sanity check if the compiled binary works)
Expected behavior
The build succeeds.
Actual behavior
Known workarounds
I have no idea.
Related information
Interestingly we updated FCS in the main branch as well and there we don't have this problem.
In the main branch we use an other version of
Mono.Cecil
and not the latest prerelease one which supports netstandard (which we need for the netcore version obviously).To be honest I'm lost there. I cannot reproduce the error with FSI either. The debugging information was retrieved by a debug build from @cloudRoutine which is from the master branch. This initially happened on
12.0.5
which wouldn't really print anything butinternal error
, see #762Is this maybe related to #759 (which I'm seeing in my log as well) or #731 (which has the reference assembly path as well in its error messages)
Note: The
Error: System.NotSupportedException
is probably a follow-up error when trying to save the broken assemblyAny help is appreciated... (The debugging version is here and available via the https://ci.appveyor.com/nuget/customnuspecs nuget feed)
The text was updated successfully, but these errors were encountered: