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

Use lib instead of stdenv.lib #477

Merged
merged 1 commit into from Jan 19, 2021
Merged

Use lib instead of stdenv.lib #477

merged 1 commit into from Jan 19, 2021

Conversation

rnhmjoj
Copy link
Contributor

@rnhmjoj rnhmjoj commented Jan 11, 2021

On Nixpkgs, the work1 for deprecating stdenv.lib has started.
This patch updates the generator, existing documentation and tests to
use the top-level lib attribute to access the standard library, instead
of stdenv.lib.

Note: to update the test cases I did the following:

$ cabal2nix . > default.nix
$ sed -i '35i doCheck = false;' default.nix
$ nix-build
$ find test/golden-test-cases/ -name '*.cabal' | \
  sed s/.cabal//g | xargs -n1 -I fname \
  sh -c 'result/bin/cabal2nix file://fname.cabal > fname.nix.golden'
$ find test/golden-test-cases/ -name '*.nix.golden' | \
  xargs sed -e 's#sha256 = "\w\\+#sha256 = "deadbeef#g' -i

@peti
Copy link
Member

peti commented Jan 14, 2021

@rnhmjoj , you can re-generate the golden files for the regression test suite by running cabal run regression-test -- --accept. It's a wee bit easier than constructing a crazy sed command-line every you wanna change cabal2nix's output. :-)

@peti peti self-assigned this Jan 14, 2021
@rnhmjoj
Copy link
Contributor Author

rnhmjoj commented Jan 14, 2021

t's a wee bit easier than constructing a crazy sed command-line every you wanna change cabal2nix's output. :-)

Thank you, I expected you had a better way to do it.

On Nixpkgs, the work[1] for deprecating stdenv.lib has started.
This patch updates the generator, existing documentation and tests to
use the top-level lib attribute to access the standard library, instead
of stdenv.lib.

[1]: NixOS/nixpkgs#108938
@rnhmjoj
Copy link
Contributor Author

rnhmjoj commented Jan 19, 2021

I fixed the problems above but there's still one issue: the rendering of the meta section is handled in Distribution.Nixpkgs, so that will have to change as well. I'll open a PR soon.

@rnhmjoj
Copy link
Contributor Author

rnhmjoj commented Jan 19, 2021

See NixOS/distribution-nixpkgs#7

@peti peti merged commit c348f6f into NixOS:master Jan 19, 2021
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

2 participants