Skip to content

Experimental cygwin host support #137819

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

Open
3 tasks done
workingjubilee opened this issue Feb 28, 2025 · 9 comments
Open
3 tasks done

Experimental cygwin host support #137819

workingjubilee opened this issue Feb 28, 2025 · 9 comments
Labels
A-targets Area: Concerning the implications of different compiler targets C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC O-cygwin Target: *-pc-cygwin O-windows Operating system: Windows T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@workingjubilee
Copy link
Member

workingjubilee commented Feb 28, 2025

While we do not yet formally support the cygwin target by distributing binaries, that is not because we do not wish for people to be able to build a rustc that uses cygwin as its host if they so please. I am opening this issue so that interested parties can track the progress on enabling a rustc to be built for cygwin. There's a few needed patches:

cc @Berrysoft

@workingjubilee workingjubilee added the C-bug Category: This is a bug. label Feb 28, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 28, 2025
@workingjubilee workingjubilee added O-windows Operating system: Windows T-libs Relevant to the library team, which will review and decide on the PR/issue. A-targets Area: Concerning the implications of different compiler targets C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC and removed C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 28, 2025
@Berrysoft
Copy link
Contributor

The tracking issue for cargo: rust-lang/cargo#15442

@Berrysoft
Copy link
Contributor

Berrysoft commented Apr 21, 2025

@jeremyd2019
Copy link
Contributor

In addition to cargo, there seems to be at least one other Cargo.toml that needs a version bump:

libloading = "0.8.6"

@Berrysoft
Copy link
Contributor

Cargo.lock has been updated this week:

name = "libloading"
version = "0.8.7"

@jeremyd2019
Copy link
Contributor

Cool, I was wondering why I wasn't seeing this issue again with the new nightly I got earlier.

@jeremyd2019
Copy link
Contributor

jeremyd2019 commented May 24, 2025

Trying on actual Cygwin instead of MSYS2, I ran into an issue with it trying to use an MSYS2-style path /D/path for D:\path, I changed

Some(format!("/{}/{}", drive, &s[drive.len_utf8() + 2..]))
to

        Some(format!("/proc/cygdrive/{}/{}", drive, &s[drive.len_utf8() + 2..]))

which should work on both Cygwin and MSYS2. I don't know what any other Windows ports of sh would expect (WSL would be /mnt/drive/path, but maybe gnuwin32 or busybox or something also expects /drive/path?)

@Berrysoft
Copy link
Contributor

Now cargo is able to build on cygwin, and I think the patch will be synchronized here next week.
Remain problems:

  • miri lacks support for cygwin. It just compiles, but lacks some methods.
  • The compiled std lacks debug symbol. The debug symbol is OK if it's cross-compiled, but is missing if it's compiled from cygwin rustc.

@jeremyd2019
Copy link
Contributor

it looks like cargo was updated so 2025-06-01 nightly shouldn't need to be patched for that anymore, but as of yesterday's nightly I get a new error trying to bootstrap from x86_64-pc-windows-gnu:
#141719 (comment)

@jeremyd2019
Copy link
Contributor

rust now requires no patching to build on Cygwin. Curl 8.14.1 is fixed for the crashing on thread exit issue, just need Cygwin to package it (shouldn't take too long).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-targets Area: Concerning the implications of different compiler targets C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC O-cygwin Target: *-pc-cygwin O-windows Operating system: Windows T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants