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

build-idris-package: add ipkgName #43735

Merged
merged 1 commit into from Oct 9, 2018
Merged

Conversation

tg-x
Copy link
Member

@tg-x tg-x commented Jul 18, 2018

Motivation for this change

Add the following attributes to build-idris-package:

  • ipkgName: specify base name of the ipkg file explicitly, since *.ipkg fails if there are more than 1 ipkg files in the source root directory, defaults to * as before
  • extraInstallPhase: extra commands for the installPhase to be able to install executables, since idris --install only install libs
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)
  • Fits CONTRIBUTING.md.

cc @infinisil

Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

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

Nice! Maybe in the future some more logic should be implemented to handle multiple packages/ipkgs per source, I'm not 100% sure how it's all supposed to work just yet (and test ipkgs for that matter, I think there's a new tests = attribute in ipkg files which replaces test.ipkg's)

Some idris packages currently use rm something.ipkg in the postUnpack phase to not build certain ipkgs, can you adjust those to use ipkgName instead?

pkgs/development/idris-modules/build-idris-package.nix Outdated Show resolved Hide resolved
@tg-x
Copy link
Member Author

tg-x commented Jul 19, 2018

Alright, if we want to adjust existing packages, a better/cleaner way would be to set ipkgName to name by default, seems this is the case in most packages, and adjust those that deviate from this. This way there won't be issues later if further .ipkg files are added later in the repository.

@infinisil
Copy link
Member

a better/cleaner way would be to set ipkgName to name by default

Yeah that sounds better

@tg-x tg-x force-pushed the build-idris-package branch 3 times, most recently from 726bb41 to 260938c Compare September 18, 2018 00:46
@tg-x
Copy link
Member Author

tg-x commented Sep 18, 2018

@infinisil alright, added ipkgName to all packages where needed and removed the rm lines from postUnpack

@tg-x tg-x changed the title build-idris-package: add ipkgName & extraInstallPhase build-idris-package: add ipkgName Sep 18, 2018
@infinisil
Copy link
Member

@GrahamcOfBorg build idrisPackages.lightyear idrisPackages.http

@GrahamcOfBorg
Copy link

No attempt on aarch64-linux (full log)

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

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.


@infinisil
Copy link
Member

@GrahamcOfBorg idrisPackages.bi idrisPackages.electron idrisPackages.hamt

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: idrisPackages.lightyear, idrisPackages.http

Partial log (click to expand)

Installing Http/Error.ibc to /nix/store/r9l7mhzzphm2mg3pbj9qyrikpx5ark67-idris-http-2018-02-25/libs/http/Http
Installing 00http-idx.ibc to /nix/store/r9l7mhzzphm2mg3pbj9qyrikpx5ark67-idris-http-2018-02-25/libs/http
Leaving directory `./src'
Attempting to install IdrisDocs for http in: /nix/store/r9l7mhzzphm2mg3pbj9qyrikpx5ark67-idris-http-2018-02-25/doc/http
post-installation fixup
moving /nix/store/r9l7mhzzphm2mg3pbj9qyrikpx5ark67-idris-http-2018-02-25/doc to /nix/store/r9l7mhzzphm2mg3pbj9qyrikpx5ark67-idris-http-2018-02-25/share/doc
strip is /nix/store/df6k4mgdjxciy0f637lryp7c9ln7n1m3-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/r9l7mhzzphm2mg3pbj9qyrikpx5ark67-idris-http-2018-02-25
/nix/store/da1nb6m81fvic0y9j4vbwkgp1m6gfgca-idris-lightyear-2017-09-10
/nix/store/r9l7mhzzphm2mg3pbj9qyrikpx5ark67-idris-http-2018-02-25

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: idrisPackages.lightyear, idrisPackages.http

Partial log (click to expand)

Leaving directory `./src'
Attempting to install IdrisDocs for http in: /nix/store/j1n2qp6lanxwjvrxch4zlfwjm52dnpxn-idris-http-2018-02-25/doc/http
post-installation fixup
moving /nix/store/j1n2qp6lanxwjvrxch4zlfwjm52dnpxn-idris-http-2018-02-25/doc to /nix/store/j1n2qp6lanxwjvrxch4zlfwjm52dnpxn-idris-http-2018-02-25/share/doc
shrinking RPATHs of ELF executables and libraries in /nix/store/j1n2qp6lanxwjvrxch4zlfwjm52dnpxn-idris-http-2018-02-25
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/j1n2qp6lanxwjvrxch4zlfwjm52dnpxn-idris-http-2018-02-25
checking for references to /build in /nix/store/j1n2qp6lanxwjvrxch4zlfwjm52dnpxn-idris-http-2018-02-25...
/nix/store/5ni2lij6iwvl2fj37f4srvdig1gcir5d-idris-lightyear-2017-09-10
/nix/store/j1n2qp6lanxwjvrxch4zlfwjm52dnpxn-idris-http-2018-02-25

@infinisil
Copy link
Member

Not sure why it didn't build those, let's try again

@GrahamcOfBorg idrisPackages.bi idrisPackages.electron idrisPackages.hamt

@tg-x
Copy link
Member Author

tg-x commented Oct 7, 2018

@infinisil I did a test build with all the packages included, and they managed to find the respective .ipkg files

Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

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

Ah nice, thanks

@infinisil infinisil merged commit 5176389 into NixOS:master Oct 9, 2018
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

3 participants