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

Build of a "not tested" triplet: x86_64-windows-musl on WSL-ubuntu, fails #161

Open
BlueSolei opened this issue Nov 20, 2023 · 2 comments
Open

Comments

@BlueSolei
Copy link

BlueSolei commented Nov 20, 2023

Build of x86_64-windows-musl on WSL ubuntu

I tried to build x86_64-windows-musl with mcpu = native on WSL-ubuntu on Windows 11 Pro.
I cloned the repo on branch master at commit 1dc1fa6a1.
The command line for the build was: ./build x86_64-windows-musl native

The zig exec at the WSL ubuntu host was created, but it failed to compile a test .c file given it by CMake.
Here is the error printed:

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/shaul/me/expr/expr-zig/zig-bootstrap/out/build-zig-host
[19/20] Install the project...
-- Install configuration: "Release"
-- The C compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /home/shaul/me/expr/expr-zig/zig-bootstrap/out/host/bin/zig
-- Check for working C compiler: /home/shaul/me/expr/expr-zig/zig-bootstrap/out/host/bin/zig - broken
CMake Error at /usr/share/cmake-3.25/Modules/CMakeTestCCompiler.cmake:70 (message):
  The C compiler

    "/home/shaul/me/expr/expr-zig/zig-bootstrap/out/host/bin/zig"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/shaul/me/expr/expr-zig/zig-bootstrap/out/build-zlib-x86_64-windows-musl-native/CMakeFiles/CMakeScratch/TryCompile-H2B8qZ

    Run Build Command(s):/usr/bin/ninja cmTC_ad026 && [1/2] Building C object CMakeFiles/cmTC_ad026.dir/testCCompiler.c.obj
    FAILED: CMakeFiles/cmTC_ad026.dir/testCCompiler.c.obj
    /home/shaul/me/expr/expr-zig/zig-bootstrap/out/host/bin/zig cc -fno-sanitize=all -s -target x86_64-windows-musl -mcpu=native    -o CMakeFiles/cmTC_ad026.dir/testCCompiler.c.obj -c /home/shaul/me/expr/expr-zig/zig-bootstrap/out/build-zlib-x86_64-windows-musl-native/CMakeFiles/CMakeScratch/TryCompile-H2B8qZ/testCCompiler.c
    zig: error: clang frontend command failed with exit code 133 (use -v to see invocation)
    clang version 17.0.3 (https://github.com/ziglang/zig-bootstrap 1dc1fa6a122996fcd030cc956385e055289e09d9)
    Target: x86_64-unknown-windows-musl
    Thread model: posix
    InstalledDir: /home/shaul/me/expr/expr-zig/zig-bootstrap/out/build-zlib-x86_64-windows-musl-native/CMakeFiles/CMakeScratch/TryCompile-H2B8qZ
    zig: note: diagnostic msg:
    ********************

    PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
    Preprocessed source(s) and associated run script(s) are located at:
    zig: note: diagnostic msg: /tmp/testCCompiler-42815b.c
    zig: note: diagnostic msg: /tmp/testCCompiler-42815b.sh
    zig: note: diagnostic msg:

    ********************
    ninja: build stopped: subcommand failed.

  CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
  CMakeLists.txt:4 (project)

-- Configuring incomplete, errors occurred!
See also "/home/shaul/me/expr/expr-zig/zig-bootstrap/out/build-zlib-x86_64-windows-musl-native/CMakeFiles/CMakeOutput.log".
See also "/home/shaul/me/expr/expr-zig/zig-bootstrap/out/build-zlib-x86_64-windows-musl-native/CMakeFiles/CMakeError.log".

Attached the files:
CMakeError.log
CMakeOutput.log
testCCompiler-42815b.zip

@BlueSolei BlueSolei changed the title build of a "not tested" triplet: x86_64-windows-musl fails Build of a "not tested" triplet: x86_64-windows-musl on WSL-ubuntu, fails Nov 20, 2023
@nektro
Copy link

nektro commented Nov 21, 2023

this should compile error afaik. musl is not a valid abi for windows

edit: this this the whole log? not sure from this if it's zig's or clang's fault the error wasn't more clear

@matu3ba
Copy link

matu3ba commented Dec 1, 2023

Unfortunately you dont show the generated relevant cmake error logs. Might be related to ziglang/zig#17824.

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

3 participants