-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-target-specsArea: Compile-target specificationsArea: Compile-target specificationsO-windows-gnuToolchain: GNU, Operating system: WindowsToolchain: GNU, Operating system: WindowsT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
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.
hashimaziz1, yanorei32, Kreijstal, ognevny and riedel
Metadata
Metadata
Assignees
Labels
A-target-specsArea: Compile-target specificationsArea: Compile-target specificationsO-windows-gnuToolchain: GNU, Operating system: WindowsToolchain: GNU, Operating system: WindowsT-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
jyn514 commentedon Dec 9, 2020
@mintty something strange is going on in your environment:
bootstrap/Cargo.toml
is 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.toml
does 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-gcc
not foundInstalled 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 errorerror: could not compile
serde_derive
due to previous errorerror: could not compile
proc-macro2
due to previous errorerror: could not compile
winapi
due to previous errorerror: could not compile
typenum
due 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
-vv
for 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
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.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.
44 remaining items
/cygdrive/d/HOME/.emacs.d/test/task-3.3.0/Cargo.toml
does not exist GothenburgBitFactory/taskwarrior#3756riedel 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