Skip to content

Build without GHC environment files, instead using wrappers #78

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 2 commits into from
May 13, 2019

Conversation

rvl
Copy link
Contributor

@rvl rvl commented Mar 3, 2019

This lets ghci work in development shells.

Fixes #44.

@rvl rvl added the wip Work In Progress label Mar 3, 2019
@rvl rvl self-assigned this Mar 3, 2019
@rvl rvl requested a review from jbgi March 14, 2019 01:36
@rvl rvl force-pushed the rvl/without-ghc-environment branch from 3454081 to 73c44be Compare April 2, 2019 23:12
@jbgi
Copy link
Contributor

jbgi commented Apr 3, 2019

I tested this today. There was an error when building: https://github.com/input-output-hk/iohk-monitoring-framework/tree/v0.1.5.0/contra-tracer:

unpacking sources
unpacking source archive /nix/store/0kj1bprbs1wwl1kj0db516pa2kj90b93-iohk-monitoring-framework-8fb87e8
source root is iohk-monitoring-framework-8fb87e8
source root reset to iohk-monitoring-framework-8fb87e8/contra-tracer
patching sources
configuring
Configure flags:
--prefix=/nix/store/i77mhb788x09rpbrpsfbb52vnc6dxnf8-contra-tracer-0.1.0.0-lib-contra-tracer lib:contra-tracer --package-db=clear --package-db=/nix/store/8721g20fmn4h73whfwk6b5snbf9kz9zj-contra-tracer-0.1.0.0-lib-contra-tracer-config/package.conf.d --with-ghc=ghc --with-ghc-pkg=ghc-pkg --with-hsc2hs=hsc2hs --with-gcc=cc --with-ld=ld --with-ar=ar --with-strip=strip --enable-executable-stripping --enable-library-stripping --docdir=/nix/store/6wc36f1k8q5aws2fmka07vkll37934wv-contra-tracer-0.1.0.0-lib-contra-tracer-doc/share/doc/contra-tracer --enable-split-sections
Configuring library for contra-tracer-0.1.0.0..
building
Preprocessing library for contra-tracer-0.1.0.0..
Building library for contra-tracer-0.1.0.0..
ghc: could not execute: /nix/store/zz7z85inpnkywa0h7a0029vgd4w24ibv-ghc-8.6.3-with-contra-tracer/lib/ghc-8.6.3/bin/unlit
builder for '/nix/store/cblazwgj6ij65zx3fw4vjlnnk5x1nrqg-contra-tracer-0.1.0.0-lib-contra-tracer.drv' failed with exit code 1

unlit support is missing I guess?

@angerman
Copy link
Collaborator

angerman commented Apr 3, 2019

Why does it look for unlit in ghc: could not execute: /nix/store/zz7z85inpnkywa0h7a0029vgd4w24ibv-ghc-8.6.3-with-contra-tracer/lib/ghc-8.6.3/bin/unlit?
That seems wrong.

@jbgi
Copy link
Contributor

jbgi commented Apr 3, 2019

unlit is supposed to be used to remove the markdown part from literate Haskell files. in this case this file: https://github.com/input-output-hk/iohk-monitoring-framework/blob/v0.1.5.0/contra-tracer/src/Control/Tracer.lhs
But apparently that utility is not packaged (the path does not exist).

@rvl
Copy link
Contributor Author

rvl commented Apr 3, 2019

Thanks for trying it @jbgi -- I also got the error with unlit when trying on a project a with Literate Haskell dependency. :-/ I don't have time to dig further at the moment.

@angerman
Copy link
Collaborator

angerman commented Apr 4, 2019

@jbgi right. It's usually part of the ghc distribution. The path /nix/store/zz7z85inpnkywa0h7a0029vgd4w24ibv-ghc-8.6.3-with-contra-tracer/lib/ghc-8.6.3/bin/unlit looks like we somehow concatinate /nix/store/zz7z85inpnkywa0h7a0029vgd4w24ibv-ghc-8.6.3-with-contra-tracer/ with lib/ghc-8.6.3/bin/unlit. The last part should be looked up in some ghc path instead of contra-tracer.

@rvl rvl force-pushed the rvl/without-ghc-environment branch 4 times, most recently from cd1b607 to 3900ec9 Compare May 8, 2019 17:29
@rvl rvl removed the wip Work In Progress label May 8, 2019
@rvl rvl marked this pull request as ready for review May 8, 2019 17:31
@angerman
Copy link
Collaborator

@jbgi, @rvl: unlit and friends should be fixed since 2a2d2dd

@rvl rvl force-pushed the rvl/without-ghc-environment branch 2 times, most recently from 2b29320 to 1e5f356 Compare May 11, 2019 23:00
@rvl
Copy link
Contributor Author

rvl commented May 12, 2019

I merged in the unlit fix and cleaned it up a little.
With this PR, nix-shell development environments work for cabal projects.

Copy link
Collaborator

@angerman angerman left a comment

Choose a reason for hiding this comment

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

LGTM. Maybe fix the alignment?

@@ -221,7 +222,6 @@ stdenv.mkDerivation ({
};

CABAL_CONFIG = configFiles + /cabal.config;
GHC_ENVIRONMENT = configFiles + /ghc-environment;
Copy link
Collaborator

Choose a reason for hiding this comment

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

🙌

@rvl rvl force-pushed the rvl/without-ghc-environment branch from 5388894 to 72174cb Compare May 13, 2019 00:30
# ... remove all of the package directories
rm -rf ${libDir}/*/
# ... but retain the lib/ghc/bin directory. This contains `unlit' and friends.
ln -s ${ghc}/lib/${ghcCommand}-${ghc.version}/bin ${libDir}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's hard to see because I've renamed the file but @angerman please note that I have changed the unlit&friends fix to link the bin directory rather than using lndir.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@rvl should be identical. So I'm ok wither way :-)

@angerman angerman merged commit b94ea34 into master May 13, 2019
andreabedini pushed a commit to andreabedini/haskell.nix that referenced this pull request Sep 14, 2022
* Add support for the new LTS formats.

* Cleanup

* drop pkg_versions.txt
andreabedini pushed a commit to andreabedini/haskell.nix that referenced this pull request Sep 14, 2022
* Add support for the new LTS formats.

* Cleanup

* drop pkg_versions.txt
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.

Use the GHC wrapper in the builder
3 participants