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
meta: Don't bypass unsupported platforms with allowBroken. #38639
Conversation
Note that there may be a transition period of making various platform attributes more flexible in the wake of this change. |
Maybe add |
That seems orthogonal, we already have the switch anyway. |
What is the switch to do it on ad-hoc way from command line? |
@shlevy not completely orthogonal: before the change, there is an environment variable that allows to experiment with platform support without changing any persistent configuration. |
But |
Sure. You could import it from your command line... Why do we need an easy switch here exactly? allowUnsupportedPlatforms is not even something I think we should have, I'm just not removing it because it's unnecessary for what I want to do. |
@shlevy I think your «should» is about the state where there is an actual tristate (but then we will need a variety of cheap overrides for |
As far as I know the primary use case is for Mac users to test if some package they want to use but depends on packages marked Linux-only happens to work by chance. Sounds pretty useful to me. Also I personally do stuff like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm missing something, but doesn't enableIfAvailable
still have the same problem as before if this is used?
@LnL7 If you use |
While I kind of agree, the primary use-case for allowBroken on darwin is to bypass |
@LnL7 Right, but I think the right thing to do there is fix the |
So, we need a pentastate or maybe even hexastate?
known-working expression
most likely working (judging from success on other platforms)
unknown
most likely broken
known-broken but probably fixable (tachyon on macOS: we failed to build it, but there is upstream code to support that platform)
known-broken and probably currently unfixable (libseccomp on macOS)
Then, for cross-compilation, we need the build to work on build-system, and the resulting code to run on the host-system.
The pain comes when we get a cross-compiled package that works only when build-bitness and host-bitness are the same…
|
Per what @shlevy said, |
@7c6f434c if we have |
@7c6f434c Right now, the build platform is ignored entirely. I guess I figured it would be complex to go 2 dimensional, and hey if the cross stuff gets really good the build platform shouldn't ever matter 😂. In practice, the |
Agreed. We could add |
@LnL7 err wouldn't that be the other way around? The allowing broken shouldn't add extra libseccomp deps on Darwin, right? The idea would be to make a lot more things |
@Ericson2314 allow broken isn't really used to allow broken packages AFAIK 😄 |
@LnL7 Exactly. But with this change it would be. We'd sort of get today's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LnL7 and I talked more, and this only seems better and better :)
I think the error message still refers to enabling
|
bb0b85d
to
841da9c
Compare
@dezgeg updated |
So which is the current recommendation to work with this configuration:
@shlevy Can we have a hint in the documentation please. |
Yeah, I'll update the docs before merging this, just want to make sure the outstanding objections have been addressed. |
Hmm, does this |
@dezgeg Yes. IMO that's the only reasonable behavior, if you ask for unsupported platforms you should get them. |
Now I'm utterly confused. I thought the point of the(se) change(s) to have separate options for allowing build of packages marked with However, now (not necessarily due to this commit but whatever introduced this Did I understood this correctly? If so this sounds like a massive unsuspecting footgun. |
@periklis's full quote is
The idea is that if there's a package that should work on more than linux, first change it from |
Uhh... but previously, if you were on Darwin and encountered some package that claims to be unsupported on Darwin, and if you had a theory that this was only due to the package (or its dependencies) having too strict platforms bounds (i.e. in practice, After these changes, that workflow is no longer possible without those side-effects that I mentioned. Now you need to clone nixpkgs, start making those |
@dezgeg Yes that's true. That wasn't free though, the cost was tons of manual boilerplate for optional deps. The thing that makes this less bad is the |
How is changing say,
to:
"tons of less boilerplate" than:
? In both cases you had to modify the expression anyway, since there is no a priori way of knowing whether this specific package allows
I don't understand. Who is supposed to be the one doing that change? The person who wanted to test their theory of the package's dependency closure having too strict |
I have to admit some serious fatigue with this issue. I think this change moves us in the right direction to reasonable semantics for the meta fields and lets us separate the question of what platforms make sense for a package (which belongs with that package) and which packages needn't depend on that package (which belongs downstream). But mostly I just want to be done with this back and forth. So if someone wants to take this on, great, if someone wants to revert enableIfAvailable, fine, just let me know what you decide at the end of the day. |
OK we all agree this with the null trick is bad, right? Because the null trick means there is no acknowledgement of the optionalness of the dep which is awful. Your two things are both valid. Maybe that will help:
This is for "purely optional bonus deps". You use this if you really don't care whether If B
This is for a deps that are mandatory under certain conditions. You use this if you sometimes need the dependency, not merely could use it. So yeah, I again think this PR should be fine given your concerns, along with the "should work" vs "known good/bad" multi-state. Whether optional deps are far more often of the form 2 than 1 is a separate matter.
Think of it as a TODO tracking mechanism. Maintainers for a platform (as oppose to the package) might think some packages ought to work on their platform, so they can do this change. |
Where would the documentation need to be changed @periklis? |
@Ericson2314 I think we need an extra section for |
@dezgeg indicated that this PR itself is fine, or at least more fine than continued use of |
@Ericson2314 Thanks for picking this up! |
Our platforms are open-world oriented these days, and anyway there's allowUnsupportedSystem.
841da9c
to
140e882
Compare
OK documentation is added, clarifying division of labor between |
140e882
to
c66440c
Compare
The isKexecable flag treated Linux without kexec as just a normal variant, when it really should be treated as a special case incurring complexity debt to support.
Our platforms are open-world oriented these days, and anyway there's allowUnsupportedSystem.