-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
update.nix: Run update scripts in parallel #50977
Conversation
Somewhat related, in #50983 I implement support in case of Python packages. |
If I combine this PR and my PR, and run the following:
|
def run_update_script(package): | ||
print(f" - {package['name']}: UPDATING ...", file=sys.stderr) | ||
|
||
subprocess.run(package['updateScript'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=True) |
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.
subprocess.run(package['updateScript'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=True) | |
subprocess.run(package['updateScript'], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, check=True, shell=True) |
Currently it is possible to not just pass in a script, but also arguments.
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.
Note this solved the issue I had.
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.
Would not it be better to add shebang to the update-python
script:
https://github.com/NixOS/nixpkgs/pull/50983/files#r236044493
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.
That's another way. In any case, the interface needs to be documented.
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.
Just to be clear, I am not saying we should have it with arguments. If we need to create a derivation for every update we may as well have arguments in there.
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.
Allowing lists will allow us to avoid needing derivations per package.
e48d4c0
to
8f56e35
Compare
Added the docs and extra args to |
4135a29
to
d8c572d
Compare
One thing I do not like about this is that |
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.
Please update the commit message describing the relevant changes:
- runs in parallel
Change in semantics: - update script needs to be an executable
- updateScript is a list
d8c572d
to
6749e10
Compare
To make updating large attribute sets faster, the update scripts are now run in parallel. Please note the following changes in semantics: - The string passed to updateScript needs to be a path to an executable file. - The updateScript can also be a list: the tail elements will then be passed to the head as command line arguments.
6749e10
to
59a94b5
Compare
Motivation for this change
nix-shell maintainers/scripts/update.nix --argstr path gnome3
is just too slow the old way.cc @garbas @matthewbauer @hedning
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)