-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Always cross compile #21471
Copy link
Copy link
Open
Labels
0.kind: enhancementAdd something new or improve an existing system.Add something new or improve an existing system.0.kind: questionRequests for a specific question to be answeredRequests for a specific question to be answered2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: cross-compilationBuilding packages on a different platform than they will be used onBuilding packages on a different platform than they will be used on
Metadata
Metadata
Assignees
Labels
0.kind: enhancementAdd something new or improve an existing system.Add something new or improve an existing system.0.kind: questionRequests for a specific question to be answeredRequests for a specific question to be answered2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.mdhttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: cross-compilationBuilding packages on a different platform than they will be used onBuilding packages on a different platform than they will be used on
Fields
Give feedbackNo fields configured for issues without a type.
Exherbo, another linux distribution that has done good work with cross-compiling, always builds cross compilers---i.e.
--host--buildand--targetare always passed to gcc's build system even if some of those platforms are the same: http://git.exherbo.org/arbor.git/tree/packages/sys-devel/gcc/gcc.exlib#n187. The big advantage here is by using the cross-compiling code path in all cases, there's less to maintain, and actual cross compilation is less likely to rot assuming native compilation will always be better tested.In #21268 (specifically 633feb4 but I'll probably rebase at some point breaking that link), I introduce always-definedthat PR will probably be closed as a bunch else happened separately, including always definingbuildPlatformhostPlatformandtargetPlatformfor the same reasons (I keep around nullablecrossSystemand not-always presentstdenv.crossfor compatibility). So if/when that PR is merged would be a good time to tackle this.buildPlatformhostPlatformandtargetPlatformand removingcrossSystemandstdenv.crossaltogether.Naturally this would be a gcc-caused mass rebuild on Linux. Darwin shouldn't be as affected as LLVM, by default, includes all the targets we care about.