-
Notifications
You must be signed in to change notification settings - Fork 430
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
No way to distinguish between macOS and other Unix with attributes #1682
Comments
What is the use case that should work on all UNIX variants except Linux and macOS in a recipe? |
I don't have such a use case. I don't care about excluding Linux; I care about excluding macOS. Currently, there's no way to write a recipe for "all Unixes except macOS". I can write a macOS recipe, and a Linux recipe; but there's no way to write one for Free/Net/OpenBSD (or, I presume, Solaris or any other platforms — I have no idea how many are theoretically supported). So if I have platform-specific tasks, where things are done one way on macOS and a different way on other Unixes, I can't use the attribute system to implement that. What I think should work is something like: default: platform
[macos]
platform:
# macOS specific here
[not-macos]
platform:
# other-platform-specific here Or:
|
I'm not the developer but I believe it would very likely help to have a use case to justify the dev time and ensure there is an overall benefit to the community. I like the idea of having the more granular options (dragonfly, freebsd, netbsd, solaris, etc.) but I can't think of a reason where it would be specifically beneficial. I just happen to like the idea of it. All Unixes follow the POSIX standard pretty close so a programatic reason to treat any of them differently would be enlightening. |
I'm not suggesting treating them differently. I'm suggesting making it possible to indicate them in a way that makes use of the existing feature. The issue is that there's an asymmetry in the current OS attributes. There's I'd happily try writing a pull request for this myself, but I'd like to make sure that the developer is interested in such a change before doing so. |
Sorry for letting this sit! This seems like a totally reasonable feature. I'm not sure if we should implement this in a more general way, e.g., allowing inverting attributes. Or, if we should implement it in a narrow way, e.g., an attribute which is true on non-macos unixes. |
I prefer the narrow way but I don't see how you can do that with any rationality. If I remember correctly, Darwin is a fork of FreeBSD UNIX. It seems to have over 80% of the BSD UNIX spec if not the entire POSIX spec. A The one rational in my mind for separating macOS from the other UNI is that it doesn't come with X Window installed by default. As do "server" versions of many distributions. So, have an x-window tag that checks if X Window is installed on the current OS makes way more sense to me than arbitrarily trying to exclude |
Yes, as I mentioned in my initial post. It's difficult to find a meaningful name for the grouping of I could see an argument for simply having an attribute tag for every supported platform, but this could easily become impractical since I think the And actually, I think that in order to implement this,
The rationale is that its behaviour and configuration is significantly different from other Unixes. Although it is, strictly speaking, a descendent of BSD Unix, the others are all far more similar to each other in a lot of ways than macOS is.
I don't think this could make sense. Many Unix machines do not include X11, because X11 is not usually installed on servers either. (And Wayland might mean that an increasing number of desktops/laptops do not have X11 installed either.) It certainly wouldn't have solved my original specific usecase, though it might be something that other people would find useful. |
Currently it seems like it's not possible to define a recipe for everything but macOS. For example, I can write a recipe that runs only on macOS:
[macos] blah: echo blah
But it appears that there's no way to write the inverse, a recipe that does not run on macOS, because
linux
is false on BSDs (correctly so), butunix
is true on macOS (also correctly).(A
bsd
attribute wouldn't really help, since arguably that should also be true on Darwin anyway.)Perhaps being able to negate an attribute:
Alternatively, or additionally, maybe there should be attributes for every possible value of
os()
? But I don't know if that function even has a complete list.Edit:
It's possible to work around this by invoking a new instance of just:
But this way can't take advantage of the attribute system, and I suspect there are other downsides as well to a child process (e.g., dependencies may behave differently).
The text was updated successfully, but these errors were encountered: