Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Update build to use nix-tools. #83

Merged
merged 24 commits into from
May 21, 2019
Merged

Update build to use nix-tools. #83

merged 24 commits into from
May 21, 2019

Conversation

jbgi
Copy link
Contributor

@jbgi jbgi commented Apr 3, 2019

nix-shell is not functional yet.

@jbgi jbgi added the wip Work In Progress label Apr 3, 2019
@jbgi jbgi requested review from erikd and ksaric as code owners April 3, 2019 15:04
@jbgi jbgi requested a review from CodiePP April 3, 2019 15:04
@jbgi
Copy link
Contributor Author

jbgi commented Apr 3, 2019

Apparently there is some dependencies on unix that need to be guarded by an OS conditional in the cabal config, for cross-compilation to work.

@CodiePP
Copy link
Contributor

CodiePP commented Apr 3, 2019

Copy link
Contributor

@CodiePP CodiePP left a comment

Choose a reason for hiding this comment

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

everything green!
the build commands work, except the cross-compilation

@CodiePP
Copy link
Contributor

CodiePP commented Apr 5, 2019

bors try

@ksaric
Copy link
Contributor

ksaric commented Apr 5, 2019

bors try harder

@CodiePP
Copy link
Contributor

CodiePP commented Apr 5, 2019

please, bors try

@jbgi jbgi removed the wip Work In Progress label Apr 5, 2019
@CodiePP
Copy link
Contributor

CodiePP commented Apr 5, 2019

buildkite now failing..

@CodiePP CodiePP self-requested a review April 5, 2019 19:44
@jbgi jbgi force-pushed the nix-tools-update branch from b4595f5 to 69ce358 Compare April 8, 2019 09:20
@CodiePP CodiePP force-pushed the nix-tools-update branch from a0d0f37 to 8fc511f Compare May 10, 2019 06:03
@CodiePP
Copy link
Contributor

CodiePP commented May 10, 2019

rebased, regenerated nix files, update iohk-nix, and force pushed!
the cross-compilation is segfaulting (@angerman help!)
the command I used:
nix build -f release.nix nix-tools.libs.x86_64-pc-mingw32-cardano-shell.x86_64-linux

@CodiePP CodiePP added the wip Work In Progress label May 10, 2019
@angerman
Copy link

are you sure it's just cross that doesn't work @CodiePP?

Hydra paints a pretty bleak picture: https://hydra.iohk.io/jobset/Cardano/cardano-shell-pr-83#tabs-jobs

@angerman
Copy link

Ahh ... lovely:

ghc: could not execute: /nix/store/47awn0vmnkffgzrhabhp8ylbxm3c1b59-ghc-8.6.3-with-contra-tracer/lib/ghc-8.6.3/bin/unlit

🤔

@angerman
Copy link

I knew this sounded vaguely familiar: input-output-hk/haskell.nix#78

Guess I'll have to look into this now.

@CodiePP CodiePP removed the wip Work In Progress label May 13, 2019
Copy link
Contributor

@CodiePP CodiePP left a comment

Choose a reason for hiding this comment

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

cross-compilation now successful
nix build -f release.nix nix-tools.libs.x86_64-pc-mingw32-cardano-shell.x86_64-linux

@CodiePP CodiePP force-pushed the nix-tools-update branch from 7e29e02 to 0767d79 Compare May 13, 2019 12:21
@ksaric
Copy link
Contributor

ksaric commented May 13, 2019

The build doesn't work for me:

> stack build --nix -j12

trace: 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
************************************ WARNING ***********************************
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

         You are using GHC 8.6.3.  This version is known to
         be busted on windows!  See GHC issue #16057.  Make
         sure you revert commit
           ghc:ed86e3b531322f74d2c2d00d7ff8662b08fabde6
         before using GHC 8.6.3 in any form on windows.

         --
         https://ghc.haskell.org/trac/ghc/ticket/16057

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
************************************ WARNING ***********************************
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

canonical-json-0.5.0.2: unregistering (local file changes: /home/ksaric/.stack/programs/x86_64-linux/ghc-8.6.3/lib/ghc-8.6.3/include/ghcversion.h /usr/inclu...)
canonical-json-0.5.0.2: build (lib)
profunctors-5.3: configure
canonical-json-0.5.0.2: copy/register
profunctors-5.3: build                                                     
semigroupoids-5.3.2: configure                                             
semigroupoids-5.3.2: build                                                 
threepenny-gui-0.8.3.0: configure                                          
threepenny-gui-0.8.3.0: build                                              
profunctors-5.3: copy/register                                             
semigroupoids-5.3.2: copy/register                 
Progress 4/21                     

--  While building package threepenny-gui-0.8.3.0 using:
      /home/ksaric/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.4.0.1 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/ksaric/projects/haskell/cardano-shell/.stack-work/logs/threepenny-gui-0.8.3.0.log

    Configuring threepenny-gui-0.8.3.0...
    Preprocessing library for threepenny-gui-0.8.3.0..
    Building library for threepenny-gui-0.8.3.0..
    [ 1 of 29] Compiling Foreign.JavaScript.Include ( src/Foreign/JavaScript/Include.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Foreign/JavaScript/Include.o )
    [ 2 of 29] Compiling Foreign.JavaScript.Resources ( src/Foreign/JavaScript/Resources.hs, .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/Foreign/JavaScript/Resources.o )
    <command line>: can't load .so/.DLL for: libz.so (libz.so: cannot open shared object file: No such file or directory)

@ruhatch
Copy link

ruhatch commented May 13, 2019

@ksaric how are you building it? You need the zlib dependency from somewhere.

@ksaric
Copy link
Contributor

ksaric commented May 13, 2019

It's on the first line of the comment above, using stack.
Heh, from somewhere... I wish I knew where that is.

@ksaric
Copy link
Contributor

ksaric commented May 13, 2019

@CodiePP The "pure" Nix build is working using nix build -f release.nix nix-tools.libs.x86_64-pc-mingw32-cardano-shell.x86_64-linux.

@ruhatch
Copy link

ruhatch commented May 13, 2019

Ah, yes, good point - you can use something like the stack-shell.nix

@ruhatch
Copy link

ruhatch commented May 13, 2019

Then in stack.yaml

nix:
  shell-file: path/to/stack-shell.nix

@ruhatch
Copy link

ruhatch commented May 13, 2019

Oh, looks like you have that already, but it's different from ours and maybe doesn't have external dependencies

@jbgi jbgi force-pushed the nix-tools-update branch from 060c1fd to bc0a344 Compare May 21, 2019 10:04
@jbgi jbgi force-pushed the nix-tools-update branch from bc0a344 to f7be633 Compare May 21, 2019 12:20
@jbgi jbgi requested a review from CodiePP May 21, 2019 12:44
@jbgi
Copy link
Contributor Author

jbgi commented May 21, 2019

@CodiePP stack build is fixed now. But it is not completely satisfactory because the nix-shell still depends on the cardano-shell lib components instead of only its dependencies (this will be fixed via input-output-hk/haskell.nix#121).

@ksaric
Copy link
Contributor

ksaric commented May 21, 2019

@jbgi When running stack (stack build --fast --nix) I get:

Cloning cbe7ab32354f3838dc8c95c64109904c8f503347 from https://github.com/input-output-hk/iohk-monitoring-framework
Executable named git not found on path

 To allow stack to pick git for user environnement.
 (waiting for input-output-hk/haskell.nix#121 for a better fix.
@jbgi
Copy link
Contributor Author

jbgi commented May 21, 2019

@ksaric thanks, I missed that due to not trying from a fresh checkout.
While waiting for input-output-hk/haskell.nix#121 I have disabled purity for the nix-shell used by stack so that stack can pick-up git for the user environment.

Copy link
Contributor

@CodiePP CodiePP left a comment

Choose a reason for hiding this comment

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

👍 nix build -f release.nix nix-tools.libs.x86_64-pc-mingw32-cardano-shell.x86_64-linux works! 🆗
👍 stack build --nix works! 🆗

💯

@jbgi
Copy link
Contributor Author

jbgi commented May 21, 2019

bors r+

Copy link
Contributor

@ksaric ksaric left a comment

Choose a reason for hiding this comment

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

Stack builds, but we are waiting for #83 (comment) to be able to enable pure stack builds, right?
Otherwise LGTM, it builds 🎉

@CodiePP CodiePP merged commit 30829cc into develop May 21, 2019
@ksaric ksaric deleted the nix-tools-update branch June 5, 2019 09:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants