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

dotlambda
Copy link
Member

@dotlambda 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.


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

Choose a reason for hiding this comment

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

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

Copy link
Member

Choose a reason for hiding this comment

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

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
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
Copy link
Member Author

ping @FRidh

@dotlambda
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
Copy link
Contributor

worldofpeace commented Jan 6, 2019

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

@dotlambda
Copy link
Member Author

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

@dotlambda
Copy link
Member Author

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
@dotlambda dotlambda mentioned this pull request Feb 9, 2019
10 tasks
@dotlambda dotlambda deleted the graphviz-hardcode branch January 17, 2024 05:21
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.

None yet

6 participants