Skip to content

stdenv: arithmetic fixes#130597

Merged
happysalada merged 1 commit intoNixOS:stagingfrom
happysalada:stdenv_arithmetic_fixes
Aug 30, 2021
Merged

stdenv: arithmetic fixes#130597
happysalada merged 1 commit intoNixOS:stagingfrom
happysalada:stdenv_arithmetic_fixes

Conversation

@happysalada
Copy link
Copy Markdown
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.

@github-actions github-actions bot added the 6.topic: stdenv Standard environment label Jul 19, 2021
@happysalada happysalada mentioned this pull request Jul 19, 2021
11 tasks
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Jul 19, 2021
@lovesegfault
Copy link
Copy Markdown
Member

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

@happysalada
Copy link
Copy Markdown
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
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 happysalada force-pushed the stdenv_arithmetic_fixes branch from bf40c30 to 9746d10 Compare August 17, 2021 14:02
@happysalada
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Labels

6.topic: stdenv Standard environment 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux-stdenv This PR causes stdenv to rebuild on Linux and must target a staging branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants