Comments (9)
It's not just you. I have the same issue lately and this stopped me from working on #50
from fsharp.
OK, I've found the cause of this (it is not the above callstack)
Error reading/writing metadata for the F# compiled DLL 'C:\\GitHub\\dsyme\\visualfsharp\\Debug\\net40\\bin\\FSharp.Core.dll'. Was the DLL compiled with an earlier version of the F# compiler? (error: 'u_measure_expr').
The problem is that referencing the new FSharp.Core 4.4.0.0 causes a silent hard failure when using F# 3.x tools. This is related to the metadata format extensions for the "rational units of measure" feature.
As discussed in the CodePlex thread on "nativeptr intrinsics", we would very much like if referencing FSharp.Core 4.4.0.0 doesn't cause a hard failure for previous versions of the F# tools. Our understanding was that the new metadata extensions for rrational units of measure were not used in FSharp.Core 4.4.0.0 and would only be used when a rational unit of measure was actually used somewhere in the code. However it seems this is not the case - in particular it is likely that the metadata for "sqrt" uses this new format (perhaps unnecessarily).
I'll discuss this with Andrew Kennedy to see if we can pinpoint what the issue is.
from fsharp.
(I edited my initial description removing the original callstack which was unrelated)
from fsharp.
Note that we need to make sure that the pickled metadata for FSharp.Core doesn’t use the new case #5 of the pickled metadata format
Indeed we need to make sure that this case is not emitted for any existing F# 3.x code, and only for F# 4.0 code that uses the Rational Units of Measure feature.
Note that the F# 4.x toolset must be able to compile and emit F# 3.x-toolset-compatible code that can be consumed by existing F# 3.x toolsets, e.g. when compiling a DLL that references FSharp.Core 4.3.1.0 and that DLL is used in a nuget package referenced by F# 3.x tools. It is likely we need to add more regression testing to ensure that the F# 4.x toolset is fully usable in this way,
from fsharp.
Andrew Kennedy is looking at this. When I investigated a bit more, the line
| MeasureRationalPower(x,q) -> p_byte 5 st; p_measure_expr x st; p_rational q st
is being called with
q = 2/1
q = -1/1
So it looks like we just need to encode all cases where "q = an integer" using the existing metadata F# 3.x constructs.
from fsharp.
(I hacked in a fix to this into my local copy coping with q = 2/1 and q = -1/1 and that fixed the original problem "using fsharp.sln with Visual Studio 2013", so I think we've found the problem :) )
from fsharp.
could you please create a PR for this (maybe flagged as WIP), I'd like to test it.
from fsharp.
Andrew is working on it. Before this line:
| MeasureRationalPower(x,q) -> p_byte 5 st; p_measure_expr x st; p_rational q st
I added these three lines, then recompiled "proto", "library" and "compiler"
| MeasureRationalPower(x,q) when Rational.GetNumerator q = 1 && Rational.GetDenominator q = 1 -> p_measure_expr x st
| MeasureRationalPower(x,q) when Rational.GetNumerator q = 2 && Rational.GetDenominator q = 1 -> p_measure_expr (MeasureProd(x,x)) st
| MeasureRationalPower(x,q) when Rational.GetNumerator q = -1 && Rational.GetDenominator q = 1 -> p_measure_expr (MeasureInv(x)) st
| MeasureRationalPower(x,q) -> p_byte 5 st; p_measure_expr x st; p_rational q st
Only the second, third and fourth lines are needed
from fsharp.
It is likely we need to add more regression testing to ensure that the F# 4.x toolset is fully usable in this way
Yes, multitargeting and cross-targeting (to 3.1 or 3.0, or net20 or portable) is a weak spot in the test coverage right now. Doubly bad because downlevel targeting to 3.1 or 3.0 is a critical scenario for a lot of people. There are ways to achieve this with the current test framework (it's done internally for net20 at least), it just needs some attention.
from fsharp.
Related Issues (20)
- PublicSign does not work when supplied with a full private key
- Cleanup: replace internal option conversion funcs with FSharp.Core ones once shipped
- [Automated] PRs inserted in VS build main-35130.30
- Re-enable unmanaged constraint language feature
- Make language version 9 HOT 1
- dotnet.exe crashes on some CI legs (weirdly, oftentimes the same ones) HOT 1
- AVE when reading implementation files HOT 3
- Copy more micro benchmarks to dotnet/performance
- Update dependencies on LSP branch (move to CLASP source package)
- Check new C# params interop with F# HOT 1
- [Automated] PRs inserted in VS build feature.debugger.shadowDebug-35201.55
- [Automated] PRs inserted in VS build feature.debugger.main-35201.175
- Refactor F# core into at least two assemblies.
- Enable FSharp 9.0 Language Version HOT 2
- Struct UnionCase doesn't seem to be a valid target for the DefaultAugmentationAttribute
- F# compiler is really slow when trying to compile .net8.0 project with SDK 8.0.303 HOT 5
- Compiler fails to recognise namespace in FQN with enabled GraphBasedChecking HOT 1
- Disabling LanguageFeature.UnmanagedConstraintCsharpInterop from F# 9.0 for now HOT 1
- Disabling LanguageFeature.EnforceAttributeTargets from F# 9.0 HOT 2
- Nullness issue - Option<string> is marked as NotNull using NullabilityInfoContext HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fsharp.