Skip to content

Fix the way ExeDependency is handled #1036

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 14 commits into from
Feb 11, 2021
Merged

Fix the way ExeDependency is handled #1036

merged 14 commits into from
Feb 11, 2021

Conversation

hamishmack
Copy link
Collaborator

See input-output-hk/nix-tools#101

We should look up hsPkgs.${pkg-name}.components.exe.${component-name}
instead of including the package as a dependency.

Adding hsPkgs.${pkg-name} a tool it is not clear which executable in the package haskell.nix should choose.

Haskell.nix did not deal with this well and in fact it could lead to nix-shell crashing. For instance using shellFor to make a shell for building haskell-language-server with cabal build crashed as a dependency on ghcide the executable (by the ghcide-bench executable) caused infinite recursion. Allowing ghcide-bench to correctly depend just on components.exes.ghcide fixes this.

See input-output-hk/nix-tools#101

We should look up hsPkgs.${pkg-name}.components.exe.${component-name}
instead of including the package as a dependency.

Adding `hsPkgs.${pkg-name}` a tool it is not clear which executable in the package `haskell.nix` should choose.

Haskell.nix did not deal with this well and in fact it could lead to `nix-shell` crashing.  For instance using `shellFor` to make a shell for building `haskell-language-server` with `cabal build` crashed as a dependency on `ghcide` the executable (by the `ghcide-bench` executable) caused infinite recursion.  Allowing `ghcide-bench` to correctly depend just on `components.exes.ghcide` fixes this.
@hamishmack
Copy link
Collaborator Author

bors try

iohk-bors bot added a commit that referenced this pull request Feb 11, 2021
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 11, 2021

try

Timed out.

@hamishmack
Copy link
Collaborator Author

bors try

iohk-bors bot added a commit that referenced this pull request Feb 11, 2021
@hamishmack
Copy link
Collaborator Author

bors try-

@hamishmack
Copy link
Collaborator Author

bors try

iohk-bors bot added a commit that referenced this pull request Feb 11, 2021
@hamishmack hamishmack requested a review from angerman February 11, 2021 07:05
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.

Hmm... so we need a new nix-tools for this, and if people cross streams, this will fail, right?

@hamishmack
Copy link
Collaborator Author

Hmm... so we need a new nix-tools for this, and if people cross streams, this will fail, right?

I don't think it will be any more broken than it is now though.

@angerman
Copy link
Collaborator

Hmm... so we need a new nix-tools for this, and if people cross streams, this will fail, right?

I don't think it will be any more broken than it is now though.

fair point

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 11, 2021

try

Timed out.

@hamishmack
Copy link
Collaborator Author

bors try

iohk-bors bot added a commit that referenced this pull request Feb 11, 2021
@hamishmack
Copy link
Collaborator Author

bors try-

@hamishmack
Copy link
Collaborator Author

bors try

iohk-bors bot added a commit that referenced this pull request Feb 11, 2021
@hamishmack
Copy link
Collaborator Author

bors try-

@hamishmack
Copy link
Collaborator Author

bors try

iohk-bors bot added a commit that referenced this pull request Feb 11, 2021
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 11, 2021

try

Build failed:

@hamishmack
Copy link
Collaborator Author

bors try

iohk-bors bot added a commit that referenced this pull request Feb 11, 2021
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 11, 2021

@hamishmack hamishmack merged commit f056dd3 into master Feb 11, 2021
@iohk-bors iohk-bors bot deleted the hkm/exe-deps branch February 11, 2021 21:45
booniepepper pushed a commit to booniepepper/haskell.nix that referenced this pull request Feb 4, 2022
See input-output-hk/nix-tools#101

We should look up hsPkgs.${pkg-name}.components.exe.${component-name}
instead of including the package as a dependency.

Adding `hsPkgs.${pkg-name}` a tool it is not clear which executable in the package `haskell.nix` should choose.

Haskell.nix did not deal with this well and in fact it could lead to `nix-shell` crashing.  For instance using `shellFor` to make a shell for building `haskell-language-server` with `cabal build` crashed as a dependency on `ghcide` the executable (by the `ghcide-bench` executable) caused infinite recursion.  Allowing `ghcide-bench` to correctly depend just on `components.exes.ghcide` fixes this.

This PR also includes:

* Updated materialized files built with the new nix-tools and latest index-state
* Small update to GHCJS (pins happy) to fix issue that showed up when the materialization was updated
* A fix for the infinite recursion issue when updating materialized files (by adding ghc-boot-packages-unchecked).
* Performance fix for shellFor (checks just the names of component derivations when filtering).
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