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

pythonPackages.pyvcd: init at 0.1.4 #53947

Merged
merged 2 commits into from
Jan 14, 2019
Merged

Conversation

sbourdeauducq
Copy link
Contributor

Motivation for this change

Add the pyvcd Python package required by some electronic design automation tools.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS) - Can't figure it out. Works fine with nix-shell --pure.
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • N/A Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • N/A Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • N/A Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size: < 1MB
  • N/A Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

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

Adding yourself to maintainer-list.nix should be a separate commit. Also, prepend pythonPackages. to the existing commit's message.

pkgs/development/python-modules/pyvcd/default.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/pyvcd/default.nix Outdated Show resolved Hide resolved
@dotlambda
Copy link
Member

@GrahamcOfBorg build python3.pkgs.pyvcd

@dotlambda
Copy link
Member

Ran 0 tests in 0.000s

Please add an appropriate checkPhase or - if there are no tests - set doCheck = false and add a comment with the reason.

@dotlambda dotlambda changed the title pyvcd: init at 0.1.4 pythonPackages.pyvcd: init at 0.1.4 Jan 14, 2019
@sbourdeauducq
Copy link
Contributor Author

Please add an appropriate checkPhase

Done and tests passing. Thanks for the quick review!

@dotlambda
Copy link
Member

@GrahamcOfBorg build python2.pkgs.pyvcd python3.pkgs.pyvcd

@worldofpeace
Copy link
Contributor

worldofpeace commented Jan 14, 2019

Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS) -
Can't figure it out. Works fine with nix-shell --pure.

By this we mean https://nixos.wiki/wiki/Nix_Package_Manager#Sandbox_builds.
And it's default enabled for NixOS since 18.09 I think.

@dotlambda dotlambda merged commit 80290b9 into NixOS:master Jan 14, 2019
@sbourdeauducq
Copy link
Contributor Author

@dotlambda Thanks for the merge!

@worldofpeace I understood this, but when I try to use nix-build I get a confusing error message. Likely I'm doing something dumb...

$ nix-build -I nixpkgs=. -p "python3.withPackages(ps: with ps; [ pyvcd ])"
these derivations will be built:
  /nix/store/57x6z6360valwawys7dw387w2wac1sqw-python3-3.7.2-env.drv
  /nix/store/l3qv1nlaavy6llv0k4b2863fz3mdqbgz-shell.drv
building '/nix/store/57x6z6360valwawys7dw387w2wac1sqw-python3-3.7.2-env.drv'...
created 245 symlinks in user environment
building '/nix/store/l3qv1nlaavy6llv0k4b2863fz3mdqbgz-shell.drv'...
builder for '/nix/store/l3qv1nlaavy6llv0k4b2863fz3mdqbgz-shell.drv' failed to produce output path '/nix/store/vx5y03618gf3hwn94fa2lyry3nmd40fa-shell'
error: build of '/nix/store/l3qv1nlaavy6llv0k4b2863fz3mdqbgz-shell.drv' failed

@worldofpeace
Copy link
Contributor

@worldofpeace I understood this, but when I try to use nix-build I get a confusing error message. Likely I'm doing something dumb...

$ nix-build -I nixpkgs=. -p "python3.withPackages(ps: with ps; [ pyvcd ])"
these derivations will be built:
  /nix/store/57x6z6360valwawys7dw387w2wac1sqw-python3-3.7.2-env.drv
  /nix/store/l3qv1nlaavy6llv0k4b2863fz3mdqbgz-shell.drv
building '/nix/store/57x6z6360valwawys7dw387w2wac1sqw-python3-3.7.2-env.drv'...
created 245 symlinks in user environment
building '/nix/store/l3qv1nlaavy6llv0k4b2863fz3mdqbgz-shell.drv'...
builder for '/nix/store/l3qv1nlaavy6llv0k4b2863fz3mdqbgz-shell.drv' failed to produce output path '/nix/store/vx5y03618gf3hwn94fa2lyry3nmd40fa-shell'
error: build of '/nix/store/l3qv1nlaavy6llv0k4b2863fz3mdqbgz-shell.drv' failed

I'd usually test by checking if the package builds for both python versions

nix-build -A python3.pkgs.pyvcd -A python.pkgs.pyvcd

Also noticed in your nix-build invocation that you specified the path to nixpkgs manually, and that isn't needed if you're current working directory is the checkout of nixpkgs.

And then using nix-shell to actually test if it works by using the result symlinks

nix-shell -p --pure ./result
nix-shell -p --pure ./result-2

You can also just do

nix-shell -I nixpkgs=. -p python.pkgs.pyvcd

@sbourdeauducq
Copy link
Contributor Author

sbourdeauducq commented Jan 15, 2019

@worldofpeace Thank you. Yes, those nix-build commands work.

nix-shell -I nixpkgs=. -p python.pkgs.pyvcd is what I was using for testing, but this does not use sandboxing.

@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants