Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix of the adaption to Windows #163

Open
Thomas008 opened this issue Jun 14, 2024 · 7 comments
Open

Fix of the adaption to Windows #163

Thomas008 opened this issue Jun 14, 2024 · 7 comments

Comments

@Thomas008
Copy link
Contributor

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 ?!)

@brenhinkeller
Copy link
Collaborator

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.

@brenhinkeller
Copy link
Collaborator

Windows support remains unofficial, but happy to continue to merge PRs

@Thomas008
Copy link
Contributor Author

Thomas008 commented Jun 16, 2024

@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

@Thomas008
Copy link
Contributor Author

Thomas008 commented Jun 16, 2024

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.
JuliaPackaging/Yggdrasil#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.

@brenhinkeller
Copy link
Collaborator

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

@Thomas008
Copy link
Contributor Author

Thomas008 commented Jun 18, 2024

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)

@brenhinkeller
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants