Giter Club home page Giter Club logo

Comments (11)

messense avatar messense commented on May 25, 2024

I don't personally use Windows, so help appreciated.

from cargo-zigbuild.

MarcoBrieden avatar MarcoBrieden commented on May 25, 2024

The zigcc-x86_64-unknown-linux-gnu.bat that is failing contains this:

C:\Users\Marco Brieden\.cargo\bin\cargo-zigbuild.exe zig cc -- -target x86_64-linux-gnu  -g -Wl,--version-script=C:\Users\Marco Brieden\AppData\Local\cargo-zigbuild\0.16.3\fcntl.map -include C:\Users\Marco Brieden\AppData\Local\cargo-zigbuild\0.16.3\fcntl.h %*

Surrounding all paths with spaces might fix it:

"C:\Users\Marco Brieden\.cargo\bin\cargo-zigbuild.exe" zig cc -- -target x86_64-linux-gnu  -g -Wl,--version-script="C:\Users\Marco Brieden\AppData\Local\cargo-zigbuild\0.16.3\fcntl.map" -include "C:\Users\Marco Brieden\AppData\Local\cargo-zigbuild\0.16.3\fcntl.h" %*

I tried editing it, but it gets newly generated every run. Write protecting it causes zigbuild to complain and error out.

The same folder has two more files that have the same issue: "zigcxx-x86_64-unknown-linux-gnu.bat" and "zigranlib.bat".

from cargo-zigbuild.

messense avatar messense commented on May 25, 2024

You can change it here

cargo-zigbuild/src/zig.rs

Lines 868 to 874 in fb64c65

writeln!(
&mut custom_linker_file,
"{} zig {} -- {} %*",
adjust_canonicalization(current_exe),
command,
args
)?;

And run cargo run zigbuild instead of cargo zigbuild to test it.

from cargo-zigbuild.

MarcoBrieden avatar MarcoBrieden commented on May 25, 2024

I think it fails to execute the .bat file in the first place, because of the path.
Any idea where that happens?

from cargo-zigbuild.

messense avatar messense commented on May 25, 2024

I think it's rust-lang/rust#29494, unfortunate it's out of our control because we didn't use cmd /c, something else did.

from cargo-zigbuild.

MarcoBrieden avatar MarcoBrieden commented on May 25, 2024

That bug has been fixed a year ago though, right?

Are you saying the batch file isn't executed from within cargo-zigbuild?
Where is it executed from then?

from cargo-zigbuild.

messense avatar messense commented on May 25, 2024

That bug has been fixed a year ago though, right?

They just added a new API which needs to be adopted.

Are you saying the batch file isn't executed from within cargo-zigbuild?
Where is it executed from then?

Probably cargo or cc-rs.

from cargo-zigbuild.

messense avatar messense commented on May 25, 2024

Actually, it's rust: https://github.com/rust-lang/rust/blob/6dc3999c2699461aa930b8c1e00f99e73dcc0174/compiler/rustc_codegen_ssa/src/back/linker.rs#L49-L58

from cargo-zigbuild.

MarcoBrieden avatar MarcoBrieden commented on May 25, 2024

Thanks for finding this!

from cargo-zigbuild.

messense avatar messense commented on May 25, 2024

I think you can workaround it by setting the CARGO_ZIGBUILD_CACHE_DIR env var to a directory that doesn't contain whitespace.

from cargo-zigbuild.

MarcoBrieden avatar MarcoBrieden commented on May 25, 2024

That worked, thank you very much messense!

from cargo-zigbuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.