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

treewide: replace make/build/configure/patchFlags with nix lists #72085

Merged
merged 1 commit into from
Oct 27, 2019

Conversation

merijnb
Copy link
Contributor

@merijnb merijnb commented Oct 27, 2019

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @globin Contribution from Nixcon Hackathon.

This commit wasn't even compiled, so will likely have syntax errors. It was made by running a crude sequence of sed steps, after discussing with @globin at Nixcon. These were the sed steps for example for one set of flags:

rg -l 'configureFlags = "' | xargs -n 1 sed -i 's/Flags = "\([^ ]*\) \(.*\)"/Flags = "\1" "\2"/'
rg -l 'configureFlags = "' | xargs -n 1 sed -i 's/Flags = "\([^ ]*\)" "\([^ ]*\) \(.*\)"/Flags = "\1" "\2" "\3"/' 
rg -l 'configureFlags = "' | xargs -n 1 sed -i 's/Flags = "\([^ ]*\)" "\([^ ]*\)" "\([^ ]*\) \(.*\)"/Flags = "\1" "\2" "\3" "\4"/' 
rg -l 'configureFlags = "[^ ]*"' | xargs -n 1 sed -i 's/Flags = "\(.*\)"/Flags = \[ "\1" \]/'

This gets quite a few constructs wrong, I've fixed the ones I've noticed wrong. It will get legitimate spaces inside the strings wrong, or if there is an if else on the same line.

I'll make a small python program that will work better, so other flags can be changed by @globin when he comes across more.

@jonringer
Copy link
Contributor

is that the right base branch?

@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {

preBuild = "cd source";

makeFlags = "DESTDIR= PREFIX=$(out)";
makeFlags = [ "DESTDIR=" "PREFIX=$(out)" ];
Copy link
Member

Choose a reason for hiding this comment

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

Should we use placeholder?

Copy link
Member

Choose a reason for hiding this comment

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

fine for now

@merijnb
Copy link
Contributor Author

merijnb commented Oct 27, 2019

is that the right base branch?

This is debatable. It is intentional, to help the structured-attrs branch to move forward and not be hung up on packages breaking for these small issues. Leaving this in that branch (which is not intended to hit until after 20.03) will make for a lot of churn to keep it in sync with master, so cherry picking this forward earlier seems like a good idea.

@ofborg ofborg bot added 6.topic: erlang 6.topic: golang 6.topic: haskell 6.topic: lua 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python 6.topic: ruby 6.topic: xfce The Xfce Desktop Environment 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` labels Oct 27, 2019
@FRidh
Copy link
Member

FRidh commented Oct 27, 2019

If I understand correctly it is a dependency for structured attributes. It is however a good change to get in anyway and is thus best merged as soon as possible.

@globin globin merged commit 1b4e571 into NixOS:structured-attrs Oct 27, 2019
@globin
Copy link
Member

globin commented Oct 27, 2019

yeah this is just help] for my work on #72074, thanks @merijnb!

@Janik-Haag Janik-Haag added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: erlang 6.topic: golang 6.topic: haskell 6.topic: lua 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python 6.topic: ruby 6.topic: xfce The Xfce Desktop Environment 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants