Remove target #31
No reviewers
Labels
No labels
Compat
Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: auxolotl/labs#31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "RossSmyth/labs:removeTarget"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WIP. Posting just to make sure people know this is something I'd like to do.
Context: https://matrix.to/#/!PvnunzXUk4Vm1CmKS4:auxolotl.org/$bOm6iaBpWbo-KRJgo7FUZdeFIv9StzRHxklbx7OQ23g?via=auxolotl.org&via=matrix.org&via=catgirl.cloud
Reasons:
Plan:
What does this mean:
This basically moves target to be a GCC-specific artifact rather than an official parameter every package must endure the cognitive load of. This is because it is. Nixpkgs plans on dumping target in the future as well because of this. Or at least making it an alias.
If you want to create a compiler with a different target, then override GCC to do so. No need to pervade all of tidepool just for GCC.
WIP: Remove targetto Remove targetRemove targetto WIP: Remove targetI'm not sure I agree with this change. We will be tracking
targetas an option in all system compilers. Wouldn't it make more sense to have that as a standardized piece of information? Having to manually set the target for cross compiling is something I wanted to avoid in Tidepool. I think it could be awesome if we just support cross compilation transparently. If I drop gcc indeps.build.hostthen it should compile my program for thehostplatform. With these changes I would have to manually specify that or cross compilation wouldn't be supported at all.I do see some benefit in simplifying the built package structure since we remove a whole layer by getting rid of
target, but I am not sure it is worth it.This still does though? It's just that target will usually just be host. The only reason an individual target platform is needed is when canadian cross is done, which is not supported very well in GCC regardless.
Target is ONLY relevant when compiling GCC. When cross-compiling a normal package, for example Make, target doesn't mean anything at all. Make has no target, just a host. GCC has a target because it is built for a single target. This does not effect cross-compilation.
This would only effect if you wanted to do something like build a GCC that targets riscv to run on aarch64 on an x86_64 machine. Which if that even works that seems to be luck of the draw.
Nixpkgs does not support canadian cross and no one has ever complained, even though the API inplies it does. GCC's configure scripts generally don't based upon sniffing around.
@RossSmyth wrote in #31 (comment):
It is common that GCC is built such that it outputs code for the parent package's host environment, not GCC's host environment. I am not talking about cases where all of build, host, and target are different. I am talking about cases where GCC's build and host are the same, but target is different as necessitated for cross compilation. You would have to pass this information manually everywhere you use GCC in order to support cross compiling packages. I think that is an anti pattern.
@RossSmyth wrote in #31 (comment):
Target is relevant for the builds of single target compilers, but it is also relevant for hooks and potentially context. As much as I dislike having to juggle three platform identifiers I think this information is useful to propagate in a standard, implicit, supported way. Removing the ability to automatically handle cases where host != target adds a lot of extra work in every package definition.
I think it would be better to keep target as-is so we have as many options as possible to easily support all of these integrations. Being able to just drop GCC in as a dependency and have it work regardless of what platform information I am using is a large benefit.
@jakehamilton wrote in #31 (comment):
I'm actually split on this now, if we build a capability for gcc we won't have to worry about this, and for other compilers we'll need to pass another flag in anyways. So the only packages valid as a
build.hostdependency isgcc(andbinutilsunless you have--enable-targets=allflag).Also if we do remove target, then we only need to have
deps.buildanddeps.host, which should be easier for packagers to understand what goes where.@vlinkz wrote in #31 (comment):
I am going to continue to think on this. Raito was also suggesting removing target entirely and also mentioned building a composite gcc package which had support for all systems.
Tried testing this out a bit, and reshuffled some stuff to get part of gcc working. https://git.auxolotl.org/vlinkz/labs/src/branch/notarget
@jakehamilton wrote in #31 (comment):
I personally would not want to go with composite gcc package soley for the purpose that it would take forever to compile
005e477a1ctod6e8691e34d6e8691e34toc4eb0ec3c8WIP: Remove targetto Remove targetWe had a conversation on matrix about this topic that enlightened me a bit more about the tradeoffs.
I'm not 100% sold on the idea, but I have a clearer vision and I think there are clearly strong arguments in favor of this PR. I'm just worried that having to specify a target might be (too) contagious in practice, but I don't think we can really assess that before we get to package something like mesa.
And even then, it's still a question of compromising an API that touches all packages vs not all of them.
At the very least, I think it's worth exploring how a package set that's a bit bigger than what tidepool currently is looks with and without
target, so while I'm currently cautiously in favor, I'd still want to wait. However I realize I don't know exactly how to judge when is the right time, for now.This broke
nix --log-format multiline-with-logs build -f . packages.foundation.gcc.latest.packages.x86_64-linux.x86_64-linux.packagefor me, and people on matrix seem to have the same issue.I looked into it for a bit, but I couldn't figure out how to fix it yet.
The error seems to occur during configure of nested libs in gcc, these are the last 500 lines in the build log: https://paste.sr.ht/~r-vdp/0d14ae5539c1ab4829f734557ed022ac1f38d82a