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

python.pkgs.graphviz: hardcode path to graphviz's bin/ #52523

Merged
merged 4 commits into from Jan 9, 2019

Conversation

Projects
None yet
6 participants
@dotlambda
Copy link
Member

dotlambda commented Dec 19, 2018

Motivation for this change

It's not very nice to have pkgs.graphviz in propagatedBuildInputs.

closes #53224

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 nox --run "nox-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@dotlambda dotlambda requested a review from FRidh as a code owner Dec 19, 2018


postPatch = ''
substituteInPlace pydot.py \
--replace "program_with_args = [program" "program_with_args = ['${graphviz}/bin/' + program" \

This comment has been minimized.

Copy link
@dotlambda

dotlambda Dec 19, 2018

Author Member

Should I better use os.path.join here and in other places?

This comment has been minimized.

Copy link
@FRidh

FRidh Dec 20, 2018

Member

From this line it's hard to see what's happening or how it should look like. Considering we don't support Windows, I don't think it matters much.

@dotlambda

This comment has been minimized.

Copy link
Member Author

dotlambda commented Dec 19, 2018

I think the fact that pythonPackages.pydot needed fixing after removing graphviz from pythonPackages.graphviz's propagatedBuildInputs is quite exemplary for why having it in there was harmful: People add pythonPackages.graphviz to some packages' propagatedBuildInputs even though they only depend on having graphviz in the path.

@dotlambda

This comment has been minimized.

Copy link
Member Author

dotlambda commented Dec 20, 2018

ping @FRidh

@dotlambda

This comment has been minimized.

Copy link
Member Author

dotlambda commented Dec 23, 2018

I'm currently struggling to convert this into a patch:

applying patch /nix/store/9yg7gz84qpml0yial4797arc79xxgks1-hardcode-graphviz-path.patch
patching file graphviz/backend.py
Hunk #1 FAILED at 114 (different line endings).
Hunk #2 FAILED at 217 (different line endings).
2 out of 2 hunks FAILED -- saving rejects to file graphviz/backend.py.rej
patching file tests/test_backend.py
Hunk #1 FAILED at 47 (different line endings).
Hunk #2 FAILED at 85 (different line endings).
Hunk #3 FAILED at 94 (different line endings).
Hunk #4 FAILED at 143 (different line endings).
Hunk #5 FAILED at 166 (different line endings).
Hunk #6 FAILED at 176 (different line endings).
Hunk #7 FAILED at 196 (different line endings).
Hunk #8 FAILED at 211 (different line endings).
8 out of 8 hunks FAILED -- saving rejects to file tests/test_backend.py.rej

Does someone have an idea how to solve this? Apllying unix2dos to the patch file does not help. I also tried fiddling around with git's core.autocrlf but to no avail. This is the patch I used: https://gist.github.com/dotlambda/2f7882f80f6fcc3b55fc633b879e81ee

@worldofpeace

This comment has been minimized.

Copy link
Member

worldofpeace commented Jan 6, 2019

@dotlambda I was able to get this patch to apply by using the github repo.

@dotlambda dotlambda force-pushed the dotlambda:graphviz-hardcode branch from a8c7aca to 354b0d4 Jan 8, 2019

@dotlambda

This comment has been minimized.

Copy link
Member Author

dotlambda commented Jan 8, 2019

@GrahamcOfBorg build python2.pkgs.graphviz python3.pkgs.graphviz python2.pkgs.objgraph python3.pkgs.objgraph python2.pkgs.pydot python3.pkgs.pydot

@dotlambda

This comment has been minimized.

Copy link
Member Author

dotlambda commented Jan 9, 2019

According to nix-review, this does not introduce any additional build failure. So I'm merging this.

@dotlambda dotlambda merged commit 9f3d991 into NixOS:master Jan 9, 2019

10 checks passed

grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A manual
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./nixos/release.nix -A options
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A manual
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A tarball
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="ofborg"; } ./pkgs/top-level/release.nix -A unstable
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details

@dotlambda dotlambda referenced this pull request Feb 9, 2019

Merged

Staging next #54306

0 of 10 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.