Open thomasbehr opened 6 years ago
/cc @marek-safar
@marek-safar Is the compiler responsible for setting such permissions or the build targets?
I am not sure what you mean build targets in this context but considering you can invoke csc directly it should produce runnable output
I second this.
Recent Mono versions (perhaps beginning with v6) completely delete and rewrite compiled files on incremental compilation now, so my manual chmod +x
I used to do gets cleared each time I recompile, so the issue is more jarring.
Making the compiler mark executable files (-target:exe
and -target:winexe
) as executable improves integration so users can run ./executable
from the command-line or double-click to open the program, and link/copy said executable to their PATH and have it seamlessly work without requiring a shell script wrapper or prefixing with the runtime command (dotnet executable
/ mono executable
) (thanks to https://en.wikipedia.org/wiki/Binfmt_misc).
Version Used: Microsoft (R) Visual C# Compiler version 2.7.0.62620 (e873e693)
Steps to Reproduce:
Alternatively, change into the
src
directory and runcsc HelloWorld.cs
.Expected Behavior: Executables produced by the C# compiler should have the executable permission set. This is still the behavior when compiling with
mcs
, but the change to usecsc
broke this behavior. Since Mono 5 usescsc
instead ofmcs
from xbuild/MSBuild this is hard to work around when using build tools.Actual Behavior: The executable
HelloWorld.exe
has the executable permission not set.