Generated executables have missing execute bit #555
Comments
@0xmohit I think you anyways need to execute the program like this:
What is the behaviour of C# compiler? |
Executables generated by |
It is worthwhile adding that this issue (with |
The code to set the executable permissions is here: https://github.com/fsharp/fsharp/blob/master/src/absil/ilwrite.fs#L3414 It might be that this code is now failing for some reason on recent Mono configurations, e.g. due to assembly number version changes or the like. If someone could check (e.g. by putting the relevant subset of the code through F# Interactive) that would be great. |
Compiling with
yields:
|
Ok, well, that's the problem certainly. But I don't understand why that reflection call is now failing. Calling the getter property succeeds, and the setter is public https://github.com/mono/mono/blob/master/mcs/class/Mono.Posix/Mono.Unix/UnixFileSystemInfo.cs#L134 It could be that the argument to the setter method is considered a boxed Int32 instead of a boxed FileAccessPermissions enumeration, and the reflection machinery is no longer applying an auto-conversion. But that would be a strange breaking change in reflection. Still, it's the only explanation I can think of. If someone would like to trial a fix that would be great. |
Fixed by dotnet/fsharp#2950 |
F# obtained as per instructions on http://fsharp.org/use/linux/.
Test file:
Now compile:
Check the result:
The executable
a.exe
doesn't have the execute bit set.In case it matters, here's the
umask
:The compiler version from
fsharpc --help
readsF# Compiler for F# 4.0 (Open Source Edition)
The text was updated successfully, but these errors were encountered: