Open Thomas008 opened 2 weeks ago
I'm not sure what you mean about code differing, but I do note that the line cmd \c clang
is not in the merged PR, instead it was changed to just clang
prior to merging. If you want to change that, feel free to PR though.
Windows support remains unofficial, but happy to continue to merge PRs
@brenhinkeller:
I'm not sure what you mean about code differing,
I wanted to do a pull request. I forked the current repository of StaticCompiler. I compared the file StaticCompiler.jl in the forked repository and the file StaticCompiler.jl from the current package. They should be the same, I thought. The bug fix I have planned with the /c instead \c is meanful in the file StaticCompiler.jl of the current package. But in the forked repository there is no line mentioning cmd
. Here is one difference:
In the file StaticCompiler.jl of the current package:
cclang = if Sys.iswindows()
`cmd \c clang` # Not clear if the `cmd \c` is necessary
elseif Sys.isapple()
`clang`
else
clang()
end
In the forked repository:
cclang = if Sys.iswindows()
exec_path *= ".exe"
`clang`
elseif Sys.isapple()
`clang`
else
clang()
end
The only problem why StaticCompiler does still not work in Windows is, that the clang - provided in the artifact of the package Clang_jll (used by StaticCompiler)) - does not work in Windows. https://github.com/JuliaPackaging/Yggdrasil/issues/8015
There are versions of clang.exe that do work in Windows. One has to integrate or suggest such a clang-version into Clang_jll.
The cmd /c is only a workaround such that one can use a clang that is locally installed.
Ah, it looks like what you're referring to as the code in the "current package" is prior to pr #160 from @daizutabi that got CI running on Windows.
We can just make a new release then, and see if that solves the problem
As an aside, it's not clear to me that the cmd
is necessary, regardless of whether it is followed by /c
or \c
-- since run
should already start a new command prompt
Yes, the cmd
seems to be necessary: On my machine with an Windows os I got:
julia> compile_executable(f, (), "C:\\jul\\staticcompiler")
ERROR: IOError: could not spawn `/c clang -Wno-override-module 'C:\jul\staticcompiler\wrapper.c' 'C:\jul\staticcompiler\f.ll' -o 'C:\jul\staticcompiler\f'`: no such file or directory (ENOENT)
Interesting. The windows CI that @daizutabi addes seems to be passing without it, but you're welcome to PR it back in as long as that doesn't break CI.
Thank you for incorporating the pull request. There is still one line that causes that StaticCompiler does not work in Windows:
in
generate_executable():
The line
`cmd \c clang
` is wrong.It must be:
`cmd /c clang
`(I tried to do a pull request with the fix But when forking the code in StaticCompiler.jl differed from the one in the curent package ?!)