Skip to content

Add clang64 toolchain to pkgsCross#450796

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
umbrageodotus:patch-1
Jan 15, 2026
Merged

Add clang64 toolchain to pkgsCross#450796
Ericson2314 merged 1 commit intoNixOS:masterfrom
umbrageodotus:patch-1

Conversation

@umbrageodotus
Copy link
Contributor

Added support for the clang64 toolchain which should be cached. Clang32 should also be added and ucrtAarch64 should be renamed to fit the scheme, but those are future PRs - as I need this in nixpkgs unstable URGENTLY.

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-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 12.first-time contribution This PR is the author's first one; please be gentle! 6.topic: lib The Nixpkgs function library labels Oct 10, 2025

# LLVM-based mingw-w64 for ARM
# LLVM-based urct64s
clang64 = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this needs a better name so people don't end up confusing it as being similar to pkgsLLVM.

Copy link
Contributor Author

@umbrageodotus umbrageodotus Oct 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang64 is the official name of the toolchain.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think it's too unambiguously

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clang 64 is a name that only makes since within the MSYS2 family of toolchains, where MinGW is a baseline assumption.

I would call it ucrt64-llvm.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion, or even msys2-clang64 is fine. Just something which indicates to people that it is a part of the MSYS2 family of toolchains or wouldn't confuse people who don't read documentation or comments.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like putting the toolchain between the libc and arch. I would prefer the more important things (libc and arch) go first, and the less important thing (toolchain) go second.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even the existing ucrt64 name I don't like, because it falsely assumes the 64 has an unambiguous interpretation as x86_64, when this is not the case, and the ucrtAarch64 option right below proves it!

I would like to see both names cleaned up, ideally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could that be another PR, though? Just so I don't break shit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. It can be a separate PR, For this PR, I just want to be clear that ucrt64 is not good precedent --- it's a bad name we probably should not have ever gone with.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lib/systems/examples.nix has quite a bit of bad naming, I think it's best to not create more names which can cause confusion.

@umbrageodotus
Copy link
Contributor Author

@RossComputerGuy looks good? Also, sorry for the pressure but when can I expect this on unstable? My work depends on this.

@philiptaron
Copy link
Contributor

Hey @umbrageodotus, if you need it urgently, I recommend that you maintain your own fork of Nixpkgs that holds it. We're often fast, but adding whole package sets needs a lot more discussion than a quick LGTM and ship it.

@umbrageodotus
Copy link
Contributor Author

@philiptaron Then I won't have caching - if that's what I wanted I could've just used an override afaik...

@umbrageodotus
Copy link
Contributor Author

This was done before with the introduction of ucrt64 and that was OK. This is that but with LLVM.

@K900
Copy link
Contributor

K900 commented Oct 10, 2025

What's the urgency?

@umbrageodotus
Copy link
Contributor Author

Using it to build rust code. The rust code needs -Clinker-plugin-lto which doesn't work with the gnu ld.

@K900
Copy link
Contributor

K900 commented Oct 10, 2025

OK, and why is this urgent? And why is this a nixpkgs wide urgency?

@umbrageodotus
Copy link
Contributor Author

It's not a nixpkgs wide urgency. That doesn't mean it shouldn't have been there SO much sooner.

@umbrageodotus
Copy link
Contributor Author

And it's urgent because of my job.

@K900
Copy link
Contributor

K900 commented Oct 10, 2025

It definitely does, to be honest, and you, my friend, need to lay off the gas. No one is going to add an entire new platform definition to nixpkgs overnight because one person's work requires it, and this change won't even achieve what you think it does to begin with.

@RossComputerGuy
Copy link
Member

That's not a nixpkgs urgency

@umbrageodotus
Copy link
Contributor Author

I understand that and apologize. Talked with my boss and he was comprehensive about it. Carry on, no pressure anymore.

@K900
Copy link
Contributor

K900 commented Oct 12, 2025

Before the naming discussion devolves into fisticuffs, I would like to remind everyone, and OP in particular, that adding this alias will not, in fact, make Hydra build anything.

@umbrageodotus
Copy link
Contributor Author

@rosd hmm...? Howd I get hydra to build & cache it?

@K900
Copy link
Contributor

K900 commented Oct 12, 2025

You'd do that by adding it to release-cross.nix, which is the only entry point that gets built for cross jobs, as a separate jobset.

@umbrageodotus
Copy link
Contributor Author

Okay.

Copy link
Member

@Eveeifyeve Eveeifyeve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good, but I just need an answer if the llvm platforms that don't support gcc work and also the issues need to be ci issues needs to be fixed before merging.

@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Dec 21, 2025
@Eveeifyeve
Copy link
Member

@Ericson2314 all is left to do is fix the ci errors on this pr.

@Ericson2314
Copy link
Member

@Eveeifyeve yes, but I'm waiting for Alyssa first. The important thing to do here is decide what we want, e.g. how much CI time to we want to devote to MinGW via release-cross.nix. once we decide, fixing the CI errors is trivial and very quick.

@Eveeifyeve Eveeifyeve requested a review from alyssais December 22, 2025 10:38
@philiptaron
Copy link
Contributor

I'm interested in what Alyssa thinks, too.

Copy link
Member

@alyssais alyssais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. Happy to defer to the experts on naming.

cross-mingw-msvcrt-x86_64 = mapTestOnCross systems.examples.mingw-msvcrt-x86_64 windowsCommon;
cross-mingw-ucrt-x86_64 = mapTestOnCross systems.examples.mingw-ucrt-x86_64 windowsCommon;
cross-mingw-ucrt-x86_64-llvm = mapTestOnCross systems.examples.mingw-ucrt-x86_64-llvm windowsCommon;
cross-mingw-ucrt-aarch64 = mapTestOnCross systems.examples.mingw-ucrt-aarch64 windowsCommon;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need all of these on Hydra?

Copy link
Member

@Eveeifyeve Eveeifyeve Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it would have helped us on the journey of creating this pr and catching issues earlier eg. this pr. This is also will be required for building bash needed for the stdenv for windows migrating it to powershell = hundreds of thousands of packages not working.

Copy link
Member

@Ericson2314 Ericson2314 Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are currently very small jobsets, so I am hoping that it should be fine.

If we ever cross-compile more stuff at scale, I might only do (UCRT-LLVM) * (x86_64, Aarch64). How does that sound?

(I am hoping we'll eventually do more native compilation at scale, and we fund-raise around this, and have more or fewer package sets accordingly.)

Co-authored-by: Eveeifyeve <88671402+Eveeifyeve@users.noreply.github.com>
@Ericson2314
Copy link
Member

Added the TODO. Anything else, anyone?

@nixpkgs-ci nixpkgs-ci bot removed the 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. label Jan 13, 2026
@Eveeifyeve Eveeifyeve requested a review from alyssais January 13, 2026 07:56
@Eveeifyeve
Copy link
Member

I would say I want @alyssais to re-review this again.

@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 15, 2026
@Ericson2314 Ericson2314 marked this pull request as ready for review January 15, 2026 14:48
@Ericson2314 Ericson2314 added this pull request to the merge queue Jan 15, 2026
Merged via the queue into NixOS:master with commit 3ea6894 Jan 15, 2026
26 of 28 checks passed
@nixpkgs-ci nixpkgs-ci bot removed the 12.first-time contribution This PR is the author's first one; please be gentle! label Jan 15, 2026
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Jan 15, 2026

Successfully created backport PR for release-25.11:

@github-actions github-actions bot added the 8.has: port to stable This PR already has a backport to the stable release. label Jan 15, 2026
@Eveeifyeve
Copy link
Member

So I will be able to cross compile nix?

@K900
Copy link
Contributor

K900 commented Jan 16, 2026

Not any more than you were able before this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: lib The Nixpkgs function library 8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons. backport release-25.11 Backport PR automatically

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants