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)
- StackOverflow in compiler when used in FSAutocomplete/Ionide on large project HOT 3
- F# script fails only on second evaluation. HOT 3
- Registering experience of fresh build of FSharp.sln on fresh machine HOT 8
- AOT test leg does not fail when the test does not pass
- AND operator stopped working in some active patterns
- [Automated] PRs inserted in VS build main-34910.28
- Visual Studio Project Properties shows C# warning levels in dropdown that don't apply to F# at all HOT 4
- AutoOpen in the empty namespace as malicious code vector HOT 1
- No compile-time error for partial implementation of interface with static abstract members HOT 4
- No compile-time error when static abstract member accessed on type parameter whose resolved type has no concrete implementation for said member HOT 2
- Cannot debug FSI with VS 2022, unless adjusting "Enable Just My Code" setting, and not wanting to use other debugger features HOT 1
- `AddOpenCodeFixProvider` does not take generics into account HOT 1
- PDB is getting generated in FSI scenarios even if it's not needed
- Script does not compile with `FSharp.Compiler.Service` while `dotnet fsi` runs it just fine HOT 4
- FS1118 on inlined function in private module from SDK 8.0.300 HOT 11
- Extra code completion items in short lambda
- Starting VisualFSharpFull does not find `devenv.exe` anymore HOT 1
- 8.0.300 LangVersion preview fails to compile with attribute on DU constructors HOT 7
- [Automated] PRs inserted in VS build main-34916.18
- The release notes on the public packages point to internal links HOT 1
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.