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

idris: Recurse into attrs, fix build and remove unneeded overrides #43444

Merged
merged 3 commits into from Jul 16, 2018

Conversation

infinisil
Copy link
Member

  • The gmp issue has long been fixed and closed
  • The preBuild thing was never used afaik, it works no problem without
    it, especially since checks don't run (To get checks to work we'd have
    to compile the libraries into idris, which are currently nicely
    separated)
  • The dependencies overrides aren't needed anymore
Motivation for this change

Originally just removing the hacks, but after rebasing on master I discovered that since 69cd09f it wouldn't build at all. This cleanup surprisingly (or not) just happens to fix it :).

In the second commit I also made idris packages to be included in the packages hydra builds and nix-env finds. I hope that's okay, the ~80 idris packages don't change very often and it would be very nice to have them cached because Idris can take a while to build them (and you currently don't even have any progress reporting! Will be fixed with my idris-lang/Idris-dev#4498 in the next Idris version though).

Ping @brainrape @mpickering @peti

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 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)
  • Fits CONTRIBUTING.md.

- The gmp issue has long been fixed and closed
- The preBuild thing was never used afaik, it works no problem without
it, especially since checks don't run (To get checks to work we'd have
to compile the libraries into idris, which are currently nicely
separated)
- The dependencies overrides aren't needed anymore
@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: idris

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: idris

Partial log (click to expand)

post-installation fixup
moving /nix/store/ir96n2xz98hvnniz8y3fb6vscvc8isif-base-1.3.0/doc to /nix/store/ir96n2xz98hvnniz8y3fb6vscvc8isif-base-1.3.0/share/doc
shrinking RPATHs of ELF executables and libraries in /nix/store/ir96n2xz98hvnniz8y3fb6vscvc8isif-base-1.3.0
strip is /nix/store/4qvrxzxa535y8304mk195x50b6p9607d-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/ir96n2xz98hvnniz8y3fb6vscvc8isif-base-1.3.0
checking for references to /tmp/nix-build-base-1.3.0.drv-0 in /nix/store/ir96n2xz98hvnniz8y3fb6vscvc8isif-base-1.3.0...
building path(s) ‘/nix/store/46kzhiyifqmaipg40jkgl0wsgc9zkmkj-idris-1.3.0’
/nix/store/gdskxkj82lir32qdwlrxfkb7czx1x5ba-idris-1.3.0/nix-support:
propagated-build-inputs: /nix/store/ir96n2xz98hvnniz8y3fb6vscvc8isif-base-1.3.0/nix-support/propagated-build-inputs
/nix/store/46kzhiyifqmaipg40jkgl0wsgc9zkmkj-idris-1.3.0

@matthewbauer
Copy link
Member

Is there a way to add packages to Hydra without making them show up in nix-env? I think one package set uses this but I can’t remember which one.

I think if we do recurseIntoAttrs for idris, we should make sure all of the names are prefixed properly with something like idris-. A lot of times there will be conflicts with global vs language-specific package names. This can screw up things like nix-env -u.

@infinisil
Copy link
Member Author

@matthewbauer Good point, I didn't think of that, will fix that

@infinisil
Copy link
Member Author

@matthewbauer Fixed that

@GrahamcOfBorg build idrisPackages.recursion_schemes

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: idrisPackages.recursion_schemes

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: idris

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: idrisPackages.recursion_schemes

Partial log (click to expand)

Installing 00recursion_schemes-idx.ibc to /nix/store/69pz3sy4s2qynr3wmnlmky4gj8kj1y19-idris-recursion_schemes-2018-01-19/libs/recursion_schemes
Attempting to install IdrisDocs for recursion_schemes in: /nix/store/69pz3sy4s2qynr3wmnlmky4gj8kj1y19-idris-recursion_schemes-2018-01-19/doc/recursion_schemes
Warning: Ignoring empty or non-existing namespace 'Data.Functor.Foldable'
post-installation fixup
moving /nix/store/69pz3sy4s2qynr3wmnlmky4gj8kj1y19-idris-recursion_schemes-2018-01-19/doc to /nix/store/69pz3sy4s2qynr3wmnlmky4gj8kj1y19-idris-recursion_schemes-2018-01-19/share/doc
shrinking RPATHs of ELF executables and libraries in /nix/store/69pz3sy4s2qynr3wmnlmky4gj8kj1y19-idris-recursion_schemes-2018-01-19
strip is /nix/store/4qvrxzxa535y8304mk195x50b6p9607d-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/69pz3sy4s2qynr3wmnlmky4gj8kj1y19-idris-recursion_schemes-2018-01-19
checking for references to /tmp/nix-build-idris-recursion_schemes-2018-01-19.drv-0 in /nix/store/69pz3sy4s2qynr3wmnlmky4gj8kj1y19-idris-recursion_schemes-2018-01-19...
/nix/store/69pz3sy4s2qynr3wmnlmky4gj8kj1y19-idris-recursion_schemes-2018-01-19

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: idris

Partial log (click to expand)

post-installation fixup
moving /nix/store/7maq8cmih3v4y3n1cxi7w01azixl35mz-idris-base-1.3.0/doc to /nix/store/7maq8cmih3v4y3n1cxi7w01azixl35mz-idris-base-1.3.0/share/doc
shrinking RPATHs of ELF executables and libraries in /nix/store/7maq8cmih3v4y3n1cxi7w01azixl35mz-idris-base-1.3.0
strip is /nix/store/4qvrxzxa535y8304mk195x50b6p9607d-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/7maq8cmih3v4y3n1cxi7w01azixl35mz-idris-base-1.3.0
checking for references to /build in /nix/store/7maq8cmih3v4y3n1cxi7w01azixl35mz-idris-base-1.3.0...
building '/nix/store/snxbhx1g6c3s487snvgdnkilzsn5m107-idris-1.3.0.drv'...
/nix/store/gdskxkj82lir32qdwlrxfkb7czx1x5ba-idris-1.3.0/nix-support:
propagated-build-inputs: /nix/store/7maq8cmih3v4y3n1cxi7w01azixl35mz-idris-base-1.3.0/nix-support/propagated-build-inputs
/nix/store/kl2hz7vl0zsb4g9bnap09ba1jddy117p-idris-1.3.0

@peti
Copy link
Member

peti commented Jul 14, 2018 via email

@infinisil
Copy link
Member Author

Is this good to merge?

Copy link
Member

@peti peti left a comment

Choose a reason for hiding this comment

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

The clean up is very desirable to have, obviously. I'm not sure whether Idris packages should show up with nix-env -qa. Are these packages useful to users, i.e. can you install nix-env -i idris-foo and do something useful with it? If you can, then showing them on the index seems fine. If Idris packages need to be installed using a wrapper, like Haskell packages do, then showing them on the index make little sense IMHO.

@mpickering
Copy link
Contributor

The Idris packages need to be installed using a wrapper like the Haskell packages do.

Copy link
Member

@peti peti left a comment

Choose a reason for hiding this comment

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

Please don't use recurseIntoAttrs. It seems like a bad idea to show packages to users in nix-env that they actually can't use in nix-env.

Hydra builds can be enabled by adding an appropriate entry to release.nix, similar to this one: https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/release.nix#L168

@brainrake
Copy link
Contributor

brainrake commented Jul 16, 2018

Peti, thanks for the review and the above great points.
Idris packages with binaries (directly useful for users) can be added to pkgs/top-level/all-packages.nix, like other languages.

@infinisil
Copy link
Member Author

infinisil commented Jul 16, 2018

@brainrape Are there any idris packages with binaries though? And are the binaries even built and installed into $out/bin?

@infinisil
Copy link
Member Author

@peti I removed recurseIntoAttrs and added it to the mentioned release.nix

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

The following builds were skipped because they don't evaluate on aarch64-linux: idris

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: idris

Partial log (click to expand)

post-installation fixup
moving /nix/store/6kyaw6cjsa91zlmn3pyhirmsxcflz60x-idris-base-1.3.0/doc to /nix/store/6kyaw6cjsa91zlmn3pyhirmsxcflz60x-idris-base-1.3.0/share/doc
shrinking RPATHs of ELF executables and libraries in /nix/store/6kyaw6cjsa91zlmn3pyhirmsxcflz60x-idris-base-1.3.0
strip is /nix/store/4qvrxzxa535y8304mk195x50b6p9607d-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/6kyaw6cjsa91zlmn3pyhirmsxcflz60x-idris-base-1.3.0
checking for references to /build in /nix/store/6kyaw6cjsa91zlmn3pyhirmsxcflz60x-idris-base-1.3.0...
building '/nix/store/ac7z28g05kp9n901806xwvsx9kmak5w8-idris-1.3.0.drv'...
/nix/store/l46ky638p24vmh75k8jvdv6lzxi6md07-idris-1.3.0/nix-support:
propagated-build-inputs: /nix/store/6kyaw6cjsa91zlmn3pyhirmsxcflz60x-idris-base-1.3.0/nix-support/propagated-build-inputs
/nix/store/8pzm0gd2kgzdshddrqwgi1g6scjwi10w-idris-1.3.0

@TealG
Copy link
Contributor

TealG commented Jul 16, 2018

There are use cases for idris packages with binaries, however, build-idris-package currently does not allow installing these in $out/bin (idris --install only installs libs). It'd be useful if build-idris-package would allow specifying additional commands at the end of the installPhase for this purpose.

@peti peti merged commit 9a32daf into NixOS:master Jul 16, 2018
@infinisil infinisil deleted the idris-cleanup branch July 16, 2018 20:14
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

7 participants