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

new-install: nonlocal exes #4825

Merged
merged 8 commits into from
Oct 28, 2017
Merged

new-install: nonlocal exes #4825

merged 8 commits into from
Oct 28, 2017

Conversation

fgaz
Copy link
Member

@fgaz fgaz commented Oct 14, 2017

Add the first part of the new-install command: nonlocal exes.

See #4558 for the design concept.

This part of the command installs executables from outside of a project
(ie from hackage) in the store and then symlinks them in the cabal bin
directory.

This is done by creating a dummy project and adding the targets as extra
packages.



Some questions:

  • How do I test this? A package test would probably require hackage access. Is there a way to add a local source?
  • Is the dummy project thing the right way of doing this? And should I put that code in a more generic module? Or maybe I should substitute the dummy project with some sort of global project?
  • How do I get the default ~/.cabal/bin directory? I couldn't find it in the old install command. Is it hardcoded somewhere? Do I have to hardcode it? What about windows?

includes and closes #4734

ping @dcoutts @hvr

dcoutts and others added 7 commits October 14, 2017 17:57
Consolodate the three copies of it.
There is nothing except for syntax support, but this is a first step
towards proper support for targets refering to dependencies or to out of
project packages.

For the moment, when used, it will report:

    cabal: Cannot build the package foobar, it is not in this project
    (either directly or indirectly). If you want to add it to the
    project then edit the cabal.project file.

Also update the test output for an integration test.
It's currently in the old Targets module, but we'll need it in the
new-build code too soon, and it's not really that closely related to
targets, so it makes sense to have it live in the common Types module.
That is, any package name within the install plan. This allows
targeting a dependency of a package that is local to the project.
So you can now add `extra-packages: foo` to the cabal.projct file and
then `cabal (new-)build foo`. The extra packages are included into the
install plan and they are also resolved as build targets.

Currently this only uses the "any valid package name" target syntax
which means you can use `foo` but not `foo:tests` or any of the other
variations.
Add the first part of the new-install command: nonlocal exes.

See haskell#4558 for the design concept.

This part of the command installs executables from outside of a project
(ie from hackage) in the store and then symlinks them in the cabal bin
directory.

This is done by creating a dummy project and adding the targets as extra
packages.
Copy link
Collaborator

@BardurArantsson BardurArantsson left a comment

Choose a reason for hiding this comment

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

LGTM.

I think this is pretty low-risk to just merge and then fix any issues later? (Seeing as it's a new command.)

@fgaz
Copy link
Member Author

fgaz commented Oct 28, 2017

Oh well, I'll just merge this. Tests and docs will be in another pr

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.

3 participants