Skip to content

Cross comp. & callCabalProjectToNix/callStackToNix #202

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

Merged
merged 4 commits into from
Jul 13, 2019

Conversation

hamishmack
Copy link
Collaborator

This fixes an issue where the these IFD functions fail because they try
to build and run a cross compiled nix-tools on the build system.

It may also help if there are cross compilation issues with
setup-depends (they also access the buildPackages).

This fixes an issue where the these IFD functions fail because they try
to build and run a cross compiled nix-tools on the build system.

It may also help if there are cross compilation issues with
setup-depends (they also access the buildPackages).
@hamishmack hamishmack requested review from angerman and rvl July 12, 2019 14:09
@hamishmack
Copy link
Collaborator Author

This is based on #134

@angerman
Copy link
Collaborator


building '/nix/store/wijjmaa1398a62rg9a62r4pbcvg3rdk8-dot-cabal-at-2019-04-30T000000Z.drv'...
--
  | Downloading the latest package list from cached
  | building '/nix/store/sbkxx3sx744phvhkbmvg7ma3izd0qk0f-plan.drv'...
  | Warning: The package list for 'cached' is 18089 days old.
  | Run 'cabal update' to get the latest list of available packages.
  | Resolving dependencies...
  | Build profile: -w ghc-8.6.4 -O1
  | In order, the following would be built (use -v for more details):
  | - base-compat-0.10.5 (lib) (requires download & build)
  | - clock-0.7.2 (lib) (requires download & build)
  | - colour-2.3.4 (lib) (requires download & build)
  | - dlist-0.8.0.6 (lib) (requires download & build)
  | - hashable-1.2.7.0 (lib) (requires download & build)
  | - integer-logarithms-1.0.3 (lib) (requires download & build)
  | - primitive-0.6.4.0 (lib) (requires download & build)
  | - random-1.1 (lib) (requires download & build)
  | - safe-0.3.17 (lib) (requires download & build)
  | - semigroups-0.18.5 (lib) (requires download & build)
  | - tagged-0.8.6 (lib) (requires download & build)
  | - th-abstraction-0.3.1.0 (lib) (requires download & build)
  | - time-locale-compat-0.1.1.5 (lib) (requires download & build)
  | - transformers-compat-0.6.4 (lib) (requires download & build)
  | - ansi-terminal-0.9 (lib) (requires download & build)
  | - unordered-containers-0.2.10.0 (lib) (requires download & build)
  | - vector-0.12.0.2 (lib) (requires download & build)
  | - scientific-0.3.6.2 (lib) (requires download & build)
  | - uuid-types-1.0.3 (lib) (requires download & build)
  | - extra-1.6.15 (lib) (requires download & build)
  | - ansi-wl-pprint-0.6.8.2 (lib) (requires download & build)
  | - attoparsec-0.13.2.2 (lib) (requires download & build)
  | - optparse-applicative-0.14.3.0 (lib) (requires download & build)
  | - aeson-1.4.3.0 (lib) (requires download & build)
  | - cabal-simple-0.1.0.0 (lib) (first run)
  | - cabal-simple-0.1.0.0 (exe:cabal-simple) (first run)
  | building '/nix/store/k28ipb6xgqrdkkwzvn14qy6j2j8splnj-plan-and-src.drv'...
  | copying path '/nix/store/xf82nnr3v80bnh8s8w630h5wv52kgm3l-stdenv-linux' from 'https://cache.nixos.org'...
  | building '/nix/store/a6bsafzwnfkvddwkcs4j8y4vsnr7vcg4-pkgs-nix.drv'...
  | unpacking sources
  | unpacking source archive /nix/store/xp9idc8igpn2b2a4nnl3rh96xy2mi0h8-callStackToNix
  | source root is callStackToNix
  | patching sources
  | configuring
  | no configure script, doing nothing
  | building
  | no Makefile, doing nothing
  | installing
  | post-installation fixup
  | shrinking RPATHs of ELF executables and libraries in /nix/store/42yn3m066nsy37bspdpmv2g0dwfv58dh-pkgs-nix
  | strip is /nix/store/0y7jmqnj48ikjh37n3dl9kqw9hnn68nq-binutils-2.31.1/bin/strip
  | patching script interpreter paths in /nix/store/42yn3m066nsy37bspdpmv2g0dwfv58dh-pkgs-nix
  | checking for references to /build/ in /nix/store/42yn3m066nsy37bspdpmv2g0dwfv58dh-pkgs-nix...
  | error: access to path '/nix/store/xp9idc8igpn2b2a4nnl3rh96xy2mi0h8-callStackToNix' is forbidden in restricted mode

so we somehow use callStackToNix, but it's missing from our inputs?

@angerman
Copy link
Collaborator

So you can replicate this, and I'll leave this here, because (of course I didn't know this...)

$ nix-build  -I . \
   release.nix \
   -A native.tests.callStackToNix.x86_64-darwin \ 
   --option restrict-eval true \
   --option allowed-uris "https://github.com/NixOS https://github.com/input-output-hk" \
   --show-trace

specifically note the two --option values, and the -I .. The option values are required to put this into restricted mode, and allow the necessary urls for tarballs we are fetching. The -I . is required to actually be able to load the release.nix.

angerman added 3 commits July 13, 2019 21:59
This also fixes the restricted/pure eval issues with callStackToNix.

I've also made the tests run in restricted mode to catch these kinds of
issues.
@angerman
Copy link
Collaborator

And we are green!

@angerman angerman merged commit 6be8866 into master Jul 13, 2019
@angerman angerman deleted the hkm/ifd-cross-compile branch July 13, 2019 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants