Skip to content
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

stdenv: arithmetic fixes #130597

Merged
merged 1 commit into from
Aug 30, 2021
Merged

Conversation

happysalada
Copy link
Contributor

Motivation for this change

This is a PR in the series of stdenv proposed shell fixes

This PR can be controversial.

This removes the -i flag that makes the shell parser dynamic. (the -i flag does not work with oil shell, but is not needed as well, the drawback is that the intent that the variable is an integer is less clear).
This also uses the ((...)) form for arithmetic computation.

The original proposed commits are 59ec2c7
and e0b7c12

I omitted some changes in the original PR because I'm not 100% sure about those.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Relase notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@lovesegfault
Copy link
Member

This whole set of changes needs to target staging, and not master.

@happysalada
Copy link
Contributor Author

@lovesegfault thank you for your feedback.
I only mentioned in it in the original PR here #13059
Basically, I'm only targeting master to get faster hydra builds.
This PR will definitely merged (if it can) on staging.

@happysalada happysalada changed the base branch from master to staging July 23, 2021 12:50
@happysalada happysalada mentioned this pull request Aug 3, 2021
11 tasks
@@ -395,7 +395,7 @@ findInputs() {
local -i relHostOffset
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You wanted this -i removed, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, you're right, I forgot that one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked this again. I tried separating the PRs as much as possible and some of the other -i are taken care of in another PR. I'm going to remove that one as well though.
The original intention was to make it easier to test. But since the hydra tests are so long, they have had to be grouped anyways. Now I realise it wasn't the best strategy.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed this declaration because you did update the variable's use.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right on this one.

@7c6f434c
Copy link
Member

Well, for all intention-revealing, in my opinion -i is also a non-local wait-what waiting to happen (although it is true that in this case it should not happen becaue we only assign good integers, but …)

And (( )) was already used, so using it more consistently shouldn't hurt.

Have you checked any cross-compilation?

(In the ideal world we would have a full-cross test where architecture A builds a cross-compiler from B to C, the it is run in Qemu-emulated B, then the output is checked on Qemu-emulated C; but I am not aware of such a test easily available; pkgsCross could be used for some one-step tests, though)

@happysalada
Copy link
Contributor Author

I haven't checked cross compilation that is a good idea.
I am still trying to figure out how to run massive rebuilds myself with hydra. I'll update when I have made some progress on that.

@happysalada
Copy link
Contributor Author

Just talked to vladimir about running some cross tests. Hopefully I can do it in the next day or 2

@happysalada
Copy link
Contributor Author

Ok vladimir was nice enough to run cross compilation on a whole set of PRs
#132490
If you have time on your hands, feel free to have a look at the other PRs in the list
(the tests were run before that last -i removal, but I think we can agree that it won't change much).
Thanks again for taking a look at this!

@happysalada happysalada merged commit 2fa9fac into NixOS:staging Aug 30, 2021
@happysalada happysalada deleted the stdenv_arithmetic_fixes branch August 30, 2021 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants