Comments (5)
Oh, nevermind, I thought this would solve the problems I'm seeing on Windows, but Rust is already using a response file for the arguments, and the linker is still failing:
,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "C:\\Users\\David\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-unknown-linux-gnu\\lib" "-o" "C:\\Users\\David\\src\\test\\target\\x86_64-unknown-linux-gnu\\debug\\deps\\test-6ca95f64dc56860f" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-nodefaultlibs"
= note: warning: unsupported linker arg: -znoexecstack
warning: unsupported linker arg: -zrelro
warning: unsupported linker arg: -znow
error(link): unable to spawn C:\Users\David\scoop\apps\zig\current\zig.exe: Unexpected
error: UnableToSpawnSelf
C:\Users\David\src\test>C:\Users\David\.cargo\bin\cargo-lambda.exe zig cc -- -target x86_64-linux-gnu -g -Wl,--version-script=C:\Users\David\AppData\Local\cargo-zigbuild\0.10.3\fcntl.map -include C:\Users\David\AppData\Local\cargo-zigbuild\0.10.3\fcntl.h @C:\Users\David\AppData\Local\Temp\rustcU4efEe\linker-arguments
😔
from cargo-zigbuild.
Unfortunately we will need to wait for a fix for ziglang/zig#10881
from cargo-zigbuild.
yeah, I thought there could be a way to work around that issue but it's tricky. I just wrote a workaround for cargo-lambda because in that case, it only happens in debug mode, and debug symbols are already useless on lambda, so I'm forcing windows builds to release mode until that gets sorted out.
from cargo-zigbuild.
I'm closing this since the issue is in upstream and there is no much we can do here.
from cargo-zigbuild.
Updating this with context/keywords (NameTooLong) for people hitting this in 2023. The issue now looks like:
Compiling reqwest v0.11.18
Compiling axoasset v0.5.0
Compiling cargo-dist v0.1.0 (C:\Users\ninte\dev\cargo-dist\cargo-dist)
error: linking with `C:\Users\ninte\AppData\Local\cargo-zigbuild\0.17.0\zigcc-aarch64-unknown-linux-gnu.bat` failed: exit code: 1
|
= note: "cmd" "/c" "C:\\Users\\ninte\\AppData\\Local\\cargo-zigbuild\\0.17.0\\zigcc-aarch64-unknown-linux-gnu.bat" "C:\\Users\\ninte\\AppData\\Local\\Temp\\rustcFXcXzF\
****** A MILLION ARGUMENTS OMITTED FOR BREVITY ******
= note: error(link): unable to spawn C:\ProgramData\chocolatey\lib\zig\tools\zig-windows-x86_64-0.10.1\zig.exe: NameTooLong
error: UnableToSpawnSelf
C:\Users\ninte\dev\cargo-dist>C:\Users\ninte\.cargo\bin\cargo-zigbuild.exe zig cc -- -target aarch64-linux-gnu -g -Wl,--version-script=C:\Users\ninte\AppData\Local\cargo-zigbuild\0.17.0\fcntl.map -include C:\Users\ninte\AppData\Local\cargo-zigbuild\0.17.0\fcntl.h @C:\Users\ninte\AppData\Local\Temp\rustcFXcXzF\linker-arguments
error: could not compile `cargo-dist` (bin "cargo-dist") due to previous error
I think you can potentially partially mitigate this by setting codegen-units=1
in your build profile, as it can reduce the number of things that need to be linked (at the cost of slower builds).
Unfortunately this workaround doesn't help the hefty 356-package cargo-dist, as it still fails to build (without cgu=1 the invocation is over 180k chars and exceeds my terminal's backscroll, with cgu=1 it's "merely" 47k chars).
On the same machine, the slimmer example application of axolotlsay builds fine.
For context I'm running:
Microsoft Windows 11 Home 10.0.22621 Build 22621
powershell 5.1.22621.1778 (BuildVersion 10.0.22621.1778)
cargo 1.71.1 (7f1d04c00 2023-07-29)
cargo-zigbuild 0.17.0
zig 0.10.1
from cargo-zigbuild.
Related Issues (20)
- CC 1.0.84 fails with `UnknownOperatingSystem` HOT 2
- Is cross-compilation on Linux for Windows possible? HOT 2
- zig fstack-protector bug
- No backtrace symbols on MacOS w/ Apple Silicon HOT 4
- note: error: unable to find Dynamic system library 'z' using strategy 'no_fallback'. searched paths: HOT 1
- Unknown type and functions when cross compiling zlib-ng v2.1.5 to aarch64 linux HOT 1
- cargo-zigbuild fails to compile crates that depend on linkme
- Fails to build some crates that depend on CC variable - ring etc HOT 9
- i use x86 macos with zigbuild buid aarch64-apple-darwin , but strip will cause exe error
- How to pass -fno-sanitize=undefined to `zig cc`?
- Version bump from Rust 1.73 to Rust 1.75 for `Dockerfile`
- cargo-zigbuild doesn't seem to utilize cargo config HOT 1
- `universal2-apple-darwin` panics under workspace HOT 2
- `cargo zigbuild` doesn't support static glibc builds with an explicit `--target` HOT 12
- Running `cargo doc` with `cargo-zigbuild` HOT 2
- CMake error on FLTK HOT 2
- ccache is always invalidated HOT 3
- cargo-zigbuild test doesn't pass arguments through properly HOT 2
- Allow customizing CPU features HOT 3
- Improve cargo-zigbuild zig performance HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargo-zigbuild.