You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the sparse build instructions available, rust should be built by running x.py.
After a bunch of secondary downloads, removing obstacles with curl, it fails at:
error: manifest path /cygdrive/c/tmp/rust/src/bootstrap/Cargo.toml does not ex
ist
failed to run: /cygdrive/c/tmp/rust/build/i686-pc-windows-gnu/stage0/bin/cargo build --manifest-path /cygdrive/c/tmp/rust/src/bootstrap/Cargo.toml
I found #5526 (comment) but actually any package that builds on Linux should generally also be buildable in the cygwin Posix environment.
Reacted by Hashim Aziz, Ray Yano | あねてあ, Kreijstal, Maksim Bondarenkov, Till Riedel and Bryan Hoang
What's the status now? Seems the cygwin support was asked many years ago in other threads. I'm installing a python package in cygwin, that thing depends on cryptography, which depends on a rust compier.
First attempt (python x.py):
...
Building rustbuild
error: manifest path /cygdrive/c/tmp/rust/src/bootstrap/Cargo.toml does not exist
failed to run: /cygdrive/c/tmp/rust/build/i686-pc-windows-gnu/stage0/bin/cargo build --manifest-path /cygdrive/c/tmp/rust/src/bootstrap/Cargo.toml
but the file does exist
Second attempt (./x.py):
...
Compiling cc v1.0.73
error: linker i686-w64-mingw32-gcc not found
Installed package mingw64-i686-gcc-core
Third attempt (./x.py):
...
error: linking with i686-w64-mingw32-gcc failed: exit code: 1
...
error: could not compile syn due to previous error
error: could not compile serde_derive due to previous error
error: could not compile proc-macro2 due to previous error
error: could not compile winapi due to previous error
error: could not compile typenum due to previous error
failed to run: C:\tmp\rust\build\i686-pc-windows-gnu\stage0\bin\cargo.exe build--manifest-path C:\tmp\rust\src/bootstrap/Cargo.toml
It builds fine in MSYS2 so there should be no problem with Cygwin.
error: manifest path /cygdrive/c/tmp/rust/src/bootstrap/Cargo.toml does not exist
This is unexpected, seems Cygwin path was passed instead of Windows path.
Maybe because of Python? In that case using native Windows Python would solve the problem.
error: linking with i686-w64-mingw32-gcc failed: exit code: 1
...
error: could not compile syn due to previous error
This output doesn't contain the root cause of the failure. You should look higher up in the terminal (or even paste whole output somewhere) and if there is nothing interesting re-run with -vv for more verbose output.
Ah, I think I know what it is. I think all Cygwin packages do use UNIX style paths but native Windows applications use only Windows style paths. So there are two problems here:
Cygwin tools pass UNIX style paths to Rust but it cannot understand them
Rust then passes Windows paths to Cygwin tools (like the linker) which they cannot understand AFAIK
So to do it that way you'd need to convert paths using cygpath on the boundaries between Cygwin and Win32 apps.
Side question: do you want Cygwin host+target or Cygwin host but targeting only MinGW?
For the first option you cannot use MinGW targets. You would need to create Cygwin target triple called probably x86_64-pc-windows-cygnus or something like that.
This statement is not true when it comes to the compilers though.
Compilers translate source code to machine code. It doesn't involve low level OS specific things like the device drivers. I don't see why this particular compiler is special. No official support of cygwin rust compiler package is understandable, but not even be able to build from source code is hard to understand.
Compilers translate source code to machine code. It doesn't involve low level OS specific things like the device drivers.
No matter if its C++ or Rust, std library is all about using OS specific code to give users cross-platform and easy to use abstractions though.
not even be able to build from source code is hard to understand.
All the errors in this issue are about the paths, you can take any Win32 native application and it won't be able to take or output UNIX paths used by Cygwin because Win32 API itself doesn't support these paths.
I guess something in the Rust build scripts is confused by the cygwin environment, misinterpreting it as a Windows environment and thus using wrong path syntax. It should be easy to find that place for those familiar with the build scripts.
I should note we'd probably love to have more maintainer support for the *-pc-windows-gnullvm targets that use the UCRT instead. That way we could promote them from tier 3.
I should note we'd probably love to have more maintainer support for the *-pc-windows-gnullvm targets that use the UCRT instead. That way we could promote them from tier 3.
They were accepted as tier 2: #121712 but they are blocked on compiler_builtins being currently broken for i686-pc-windows-gnu (the one without llvm suffix): #121712
Activity
jyn514 commentedon Dec 9, 2020
@mintty something strange is going on in your environment:
bootstrap/Cargo.tomlis part of the repository: https://github.com/rust-lang/rust/blob/master/src/bootstrap/Cargo.toml. Did you modify or rename it?mintty commentedon Dec 9, 2020
No, the file is there.
-rw-rw-r--+ 1 towo Kein 1020 Dec 8 21:23 /cygdrive/c/tmp/rust/src/bootstrap/Cargo.toml
qiqjiao commentedon Jul 9, 2022
What's the status now? Seems the cygwin support was asked many years ago in other threads. I'm installing a python package in cygwin, that thing depends on cryptography, which depends on a rust compier.
mintty commentedon Jul 10, 2022
First attempt (python x.py):
...
Building rustbuild
error: manifest path
/cygdrive/c/tmp/rust/src/bootstrap/Cargo.tomldoes not existfailed to run: /cygdrive/c/tmp/rust/build/i686-pc-windows-gnu/stage0/bin/cargo build --manifest-path /cygdrive/c/tmp/rust/src/bootstrap/Cargo.toml
but the file does exist
Second attempt (./x.py):
...
Compiling cc v1.0.73
error: linker
i686-w64-mingw32-gccnot foundInstalled package mingw64-i686-gcc-core
Third attempt (./x.py):
...
error: linking with
i686-w64-mingw32-gccfailed: exit code: 1...
error: could not compile
syndue to previous errorerror: could not compile
serde_derivedue to previous errorerror: could not compile
proc-macro2due to previous errorerror: could not compile
winapidue to previous errorerror: could not compile
typenumdue to previous errorfailed to run: C:\tmp\rust\build\i686-pc-windows-gnu\stage0\bin\cargo.exe build--manifest-path C:\tmp\rust\src/bootstrap/Cargo.toml
mati865 commentedon Jul 10, 2022
It builds fine in MSYS2 so there should be no problem with Cygwin.
This is unexpected, seems Cygwin path was passed instead of Windows path.
Maybe because of Python? In that case using native Windows Python would solve the problem.
This output doesn't contain the root cause of the failure. You should look higher up in the terminal (or even paste whole output somewhere) and if there is nothing interesting re-run with
-vvfor more verbose output.mintty commentedon Jul 10, 2022
Maybe, but for building a cygwin package a cygwin toolchain is essential.
mati865 commentedon Jul 10, 2022
Ah, I think I know what it is. I think all Cygwin packages do use UNIX style paths but native Windows applications use only Windows style paths. So there are two problems here:
So to do it that way you'd need to convert paths using
cygpathon the boundaries between Cygwin and Win32 apps.Side question: do you want Cygwin host+target or Cygwin host but targeting only MinGW?
For the first option you cannot use MinGW targets. You would need to create Cygwin target triple called probably
x86_64-pc-windows-cygnusor something like that.mintty commentedon Jul 10, 2022
I'm only interested in cygwin target. I have no capacity to work on your build, anyway. I was just reporting as I think (quoting from above)
mati865 commentedon Jul 10, 2022
This statement is not true when it comes to the compilers though.
qiqjiao commentedon Jul 11, 2022
Compilers translate source code to machine code. It doesn't involve low level OS specific things like the device drivers. I don't see why this particular compiler is special. No official support of cygwin rust compiler package is understandable, but not even be able to build from source code is hard to understand.
mati865 commentedon Jul 11, 2022
No matter if its C++ or Rust, std library is all about using OS specific code to give users cross-platform and easy to use abstractions though.
All the errors in this issue are about the paths, you can take any Win32 native application and it won't be able to take or output UNIX paths used by Cygwin because Win32 API itself doesn't support these paths.
mintty commentedon Jul 11, 2022
I guess something in the Rust build scripts is confused by the cygwin environment, misinterpreting it as a Windows environment and thus using wrong path syntax. It should be easy to find that place for those familiar with the build scripts.
36 remaining items
workingjubilee commentedon Apr 6, 2024
I should note we'd probably love to have more maintainer support for the
*-pc-windows-gnullvmtargets that use the UCRT instead. That way we could promote them from tier 3.mati865 commentedon Apr 6, 2024
They were accepted as tier 2: #121712 but they are blocked on
compiler_builtinsbeing currently broken fori686-pc-windows-gnu(the one withoutllvmsuffix): #121712riedel commentedon Jan 25, 2025
@ghost : the gist gives me a 404 , can you reshare it again?
Kreijstal commentedon Jan 25, 2025
ghost means the user deactivated the account
jeremyd2019 commentedon Jan 25, 2025
It looks like the repositories moved to @ookiineko-cygport at least.
Kreijstal commentedon Jan 25, 2025
yep, we enjoy this https://github.com/ookiineko-cygport/rust
Kreijstal commentedon Jan 25, 2025
now the only thing left is try to bootrstrap it from mrustc
mati865 commentedon Jan 26, 2025
It'd be a lot easier to cross compile from another existing target than to bootstrap from mrustc once the necessary changes are merged.
Mrustc doesn't even properly support mingw-w64: https://github.com/thepowersgang/mrustc/blob/95023de01fecee5ba94c4dc50e48ed1579998699/tools/minicargo/os.cpp#L18.
Kreijstal commentedon Jan 26, 2025
We write pull requests for mrustc or patch it
faho commentedon Feb 28, 2025
Since I've seen people be confused by being linked to this issue: a cygwin target has been merged with #134999
workingjubilee commentedon Feb 28, 2025
yes. was closed as wontfix (or I suppose "PRs welcome"?). closing as completed.
workingjubilee commentedon Feb 28, 2025
Opened a new issue for "the target works enough to be built as a host", since there's been so many requests for it: #137819