-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
darwin: installBinaryPackage init and refactoring of darwin apps #293498
base: master
Are you sure you want to change the base?
Conversation
dontMakeSourcesWritable = args.dontMakeSourcesWritable or true; | ||
dontPatch = args.dontPatch or true; | ||
dontConfigure = args.dontConfigure or true; | ||
dontBuild = args.dontBuild or true; | ||
dontStrip = args.dontStrip or true; | ||
dontFixup = args.dontFixup or true; | ||
dontCheck = args.dontCheck or true; | ||
doInstallCheck = args.doInstallCheck or false; |
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.
- Is this the best way to set sensible defaults, but allow customisation for packages that need it?
- Are there any other
dont*
flags that are relevant here?
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.
Does this implementation allow for enough flexibility for uncommon use-cases (see karabiner-elements) while still making "good" assumptions about the general layout/content of DMGs and PKGs, e.g. unpack any Payload*
using bsdtar
contained in a .pkg
file?
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/proposal-for-installing-prebuilt-binaries-on-darwin/40843/1 |
I like the abstraction made by the dynamic unpack hook for DMG and PKG. Package complexity will drop (IMO) and package's lines reduced by a good margin. But I think we should make sure every possible option is covered. As for some specific behavior, this might even add more complexity inside the package and possibly inside the hook. If this solution is chosen, we should create a detailed documentation to avoid looking everywhere to find options, default behaviors, etc. Love it 👍 |
Thank you for taking the time to have a look at this and your comment, @DataHearth, very much appreciated! In your mind what is a good way to ensure that "every possible option is covered"? My first approach would be to refactor the packages in Where would be a good place for such documentation? Somewhere in |
Looking at |
38620a5
to
9dd6490
Compare
I love the idea of having a unified way to package binaries for MacOS. Regarding the treewide change,
|
Thanks for your input, @ShamrockLee, much appreciated!
Any opinion or advice you may have on the "💭 A Few Thoughts" I listed in the initial description? |
Hey! Regarding creating a fetcher, I'm not a big fan of. As the "universal" way seems to fetch then unpack for most scenarios, I would keep it as a new package helper. I think the best way to find out if you missed something, it's to check other packages which are using an unpack like I agree with @ShamrockLee , I think this would me much easier to review for a code maintainer with only 1 or 2 packages as examples. |
Thanks for the feedback, @DataHearth, that's helpful. I'll do some code level analysis and prepare some notes. In addition to that I'll split this PR into two: one for the install binary package changes and one for the treewide package changes (with a possible follow-up). |
9dd6490
to
c424494
Compare
As requested this PR now affects fewer files and the majority of the actual package rewrites to use the changes proposed in this PR will be in #293961. |
abbdb9a
to
237455d
Compare
FWIW, iTerm2 is another binary package that might be suitable for this. |
Thanks for taking the time to reply, @spease. |
Hey afh! |
I've come across that recently more often too, @pcasaretto, and yes, I think it's something that could be facilitated here too. I shall make some time to factor this in, in the coming weeks. |
I'm also the mantainer of vlc-bin, another suitable binary package. How can I contribute further? |
Happy to hear you're interested in helping moving this forward, @pcasaretto 😃 Let's coordinate next week (cw 32), if that works you? |
I'm on the last week of my vacation so I have more free time now. Starting a new job next week so I can't make any promises, but I'm sure we can work something out! |
I think the work presented in #350504 is useful and I'd like to incorporate it into this Draft once merged. |
237455d
to
6aa67d0
Compare
Are you still working on this PR? It would be handy for Darwin binary packaging. |
Apologies for the late response, @ShamrockLee. |
It's common to split a large PR into smaller ones. This strategy helps push substantial changes (e.g., #352976 (comment)) forward. |
Description of changes
darwin.installBinaryPackage
unifying and simplifying how binary darwin applications are installed.darwin.installBinaryPackage
pre
- andpost
-hooks are runNOTA BENE: This is a draft PR to get the conversation going on whether this is headed into the right direction and folks see this as beneficial and helpful.
💭 A Few Thoughts
../os-specific/darwin/
packages declared inpkgs/top-level/all-packages.nix
do folks agree that these are better declared inpkgs/top-level/darwin-packages.nix
?os-specific/darwin
packages fromall-packages.nix
todarwin-packages.nix
if the general sentiment is positive on the previous question.grep os-specific/darwin pkgs/top-level/all-packages.nix | awk -F'[=]' '/ *#/{next} {print $1}'
undmg
or_7zz
as theirnativeBuildInput
to unpack a prebuilt darwin binary, if this PR is generally viewed positively.nix run nixpkgs#silver-searcher -- -G '\.nix' -l '(undmg|_7zz)' | rev | cut -d/ -f2 | rev
darwin.installBinaryPackage
and learn about its details?pkgs/os-specific/install-binary-package/*
ℹ️ All
treewide: refactor to use darwin.installBinaryPackage*
commits will be squashed into one. For now it's easier for me to work on this with individual commits.Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.