Skip to content

stdenv/cygwin: add cross bootstrap tools#475998

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
corngood:cygwin-make-bootstrap
Feb 27, 2026
Merged

stdenv/cygwin: add cross bootstrap tools#475998
Ericson2314 merged 1 commit intoNixOS:masterfrom
corngood:cygwin-make-bootstrap

Conversation

@corngood
Copy link
Copy Markdown
Contributor

@corngood corngood commented Jan 1, 2026

I've built a working stdenv based on this, but I think this is a good starting point to get it merged.

Once this is in we should be able to get a tarball from hydra.

I'm marking this draft until I enumerate the package changes required for it to build.

Build with:

nix build -f pkgs/top-level/release-cross.nix bootstrapTools.x86_64-pc-cygwin.unpack

Dependencies:

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 6.topic: stdenv Standard environment labels Jan 1, 2026
@corngood corngood force-pushed the cygwin-make-bootstrap branch from 0cf2aa3 to b8d334b Compare January 1, 2026 19:37
@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Jan 1, 2026
@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jan 1, 2026
@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Jan 2, 2026
@pyrox0

This comment was marked as outdated.

@corngood
Copy link
Copy Markdown
Contributor Author

Ideally, this would use something similar to the linux minimal-bootstrap path to bootstrap fully from source without using the bootstrap-files mechanism, for reproducibility and auditability reasons. Is there any way to do that with Cygwin?

I'm sure it's possible, but I think it's premature when the only stdenv currently doing it is x86 linux. I suspect we'd want to refactor and share a lot of linux/minimal-bootstrap. I don't think cygwin is the platform we want to use to build that abstraction. Darwin or freebsd would probably be better.

@pyrox0
Copy link
Copy Markdown
Member

pyrox0 commented Feb 24, 2026

Ideally, this would use something similar to the linux minimal-bootstrap path to bootstrap fully from source without using the bootstrap-files mechanism, for reproducibility and auditability reasons. Is there any way to do that with Cygwin?

I'm sure it's possible, but I think it's premature when the only stdenv currently doing it is x86 linux. I suspect we'd want to refactor and share a lot of linux/minimal-bootstrap. I don't think cygwin is the platform we want to use to build that abstraction. Darwin or freebsd would probably be better.

Very fair, then feel free to discard my comments. The work here looks good!

@corngood corngood marked this pull request as ready for review February 24, 2026 02:08
@corngood
Copy link
Copy Markdown
Contributor Author

I've marked this ready because all the original dependencies are merged, and I think the change is still good.

Unfortunately it doesn't build at the moment due to regressions, which I'll fix and link in the top comment.

@nixpkgs-ci nixpkgs-ci bot requested review from a team and philiptaron February 24, 2026 02:27
@Ericson2314
Copy link
Copy Markdown
Member

Can we just cross compile from a pure bootstrap platform and say, well, you need multiple types of builders if it isn't cached?

I don't see why not.

@corngood
Copy link
Copy Markdown
Contributor Author

Can we just cross compile from a pure bootstrap platform and say, well, you need multiple types of builders if it isn't cached?

I did have a stdenv based on stdenv/cross before this one. It would be very frustrating for an end user IMO.

This is quite similar to what freebsd and darwin do. This change doesn't even have the stdenv yet. I really just want all the things required by stdenv to be in hydra, so we can keep them building while we do the rest of the work.

I think long-term, minimal-bootstrap would be a great way to go, but it's very linux-centric at the moment.

@Ericson2314
Copy link
Copy Markdown
Member

#123095 (comment) to be clear, something like this is what I am thinking.

We can make a "make bootstrap tools" of sorts, but rather than using it to produce something we fetch in a separate eval, we would just directly use it in the native bootstrap. We'd rely on regular substitution rather than fetching a fixed output.

@corngood
Copy link
Copy Markdown
Contributor Author

#123095 (comment) to be clear, something like this is what I am thinking.

Like with minimal-bootstrap, I'm not against this idea, but I'd rather start off with a conventional stdenv (like darwin/freebsd) until the concept has been proven.

@Ericson2314 Ericson2314 added this pull request to the merge queue Feb 27, 2026
@Ericson2314
Copy link
Copy Markdown
Member

I don't want to block @corngood, and he made some good points about exotic platforms have enough "innovation budget already", but I do think this should be reworked as soon as the time comes to upload bootstrap binary binaries to nixos.org -- at that point, we're better just depending on the cross-compiled bootstrap tools directly.

Merged via the queue into NixOS:master with commit 80b8379 Feb 27, 2026
48 checks passed
@github-project-automation github-project-automation bot moved this to Done in Stdenv Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: stdenv Standard environment 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants