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

bindir-method/install-method, installdir, new-install flags in SavedConfig -- 3.0 version #5870

Merged
merged 6 commits into from Mar 12, 2019

Conversation

fgaz
Copy link
Member

@fgaz fgaz commented Feb 3, 2019

TODOs:

  • changelog
  • docs
  • a good commit message
  • bindir-method vs install-method
  • NewFlags vs ClientFlags

Closes #5644
Closes #5837
Closes #5843

/cc @hvr

@hvr
Copy link
Member

hvr commented Feb 3, 2019

I briefly tested this one empirically and it looks good so far; I haven't done a proper code-review yet though

@Mistuke
Copy link
Collaborator

Mistuke commented Feb 4, 2019

Hmm this doesn't seem to build on Windows :(

Distribution\Client\InstallSymlink.hs:36:10: error:
    Not in scope: type constructor or class `Binary'
   |
36 | instance Binary OverwritePolicy
   |          ^^^^^^

AppVeyor is showing the error too.

hvr added a commit to fgaz/cabal that referenced this pull request Feb 4, 2019
@Mistuke
Copy link
Collaborator

Mistuke commented Feb 4, 2019

Thanks @fgaz, @hvr , it compiles now. A couple of observations:

  1. Doing a cabal new-install pony seems to build a binary and then end with
Installing executable can-i-have-a-pony in R:\CabalStore\ghc-8.4.3\incoming\new-20796\CabalStore\ghc-8.4.3\pony-1.0-2eda844295defe2b7defaac8f0f9a0f26ee16330\bin
Warning: The directory
R:\CabalStore\ghc-8.4.3\incoming\new-20796\CabalStore\ghc-8.4.3\pony-1.0-2eda844295defe2b7defaac8f0f9a0f26ee16330\bin
is not in the system search path.
cabal.exe: installdir is not defined. Set it in your cabal config file or use
--installdir=<path>

Which led me to believe the binary was in R:\CabalStore\ghc-8.4.3\incoming\new-20796\CabalStore\ghc-8.4.3\pony-1.0-2eda844295defe2b7defaac8f0f9a0f26ee16330\bin, but it turns out the folder no longer exists after install. Sooo... where is it? :)

  1. I then tried using --installdir as suggested
$ ./cabal.exe new-install --installdir=/r/bin pony
Resolving dependencies...
Up to date
Symlinking 'can-i-have-a-pony'
cabal.exe: Symlinking feature not available on Windows

So we'll need to pick a working default, maybe recommend people try a different --bindir-method=.

  1. I then tried using --bindir-method=copy which failed with
$ ./cabal.exe new-install --installdir=/r/bin --bindir-method=copy pony
Resolving dependencies...
Up to date
Copying 'can-i-have-a-pony'
R:\CabalStore\ghc-8.4.3\pony-1.0-2eda844295defe2b7defaac8f0f9a0f26ee16330\bin\can-i-have-a-pony: copyFile:atomicCopyFileContents:withReplacementFile:copyFileToHandle:openBinaryFile: does not exist (No such file or directory)

Which failed because can-i-have-a-pony doesn't have an extension, it should be trying to copy can-i-have-a-pony.exe.

@fgaz
Copy link
Member Author

fgaz commented Feb 26, 2019

@Mistuke could you try now?

edit: nevermind, I can use appveyor

@fgaz fgaz force-pushed the new-install/bindir-method branch 2 times, most recently from 0feb8ac to 5100987 Compare March 4, 2019 11:59
@fgaz fgaz force-pushed the new-install/bindir-method branch from 5100987 to a8a5f15 Compare March 9, 2019 17:24
@fgaz
Copy link
Member Author

fgaz commented Mar 9, 2019

Tested on windows, ready for review. Docs update coming shortly.

editing this comment so I don't spam everyone: travis is red because I forgot [ci skip] on the last 2 commits and stopped it manually

@fgaz fgaz requested a review from hvr March 9, 2019 17:36
fgaz added a commit to fgaz/cabal that referenced this pull request Mar 9, 2019
Copy link
Member

@23Skidoo 23Skidoo left a comment

Choose a reason for hiding this comment

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

LGTM modulo minor comments.

cabal-install/Distribution/Client/CmdInstall.hs Outdated Show resolved Hide resolved
cabal-install/Distribution/Client/CmdInstall.hs Outdated Show resolved Hide resolved
23Skidoo pushed a commit to fgaz/cabal that referenced this pull request Mar 12, 2019
@23Skidoo
Copy link
Member

Rebased against master.

@23Skidoo 23Skidoo self-requested a review March 12, 2019 05:25
@hvr
Copy link
Member

hvr commented Mar 12, 2019

@23Skidoo I assume we can consider the 2.4-backport #5869 accepted as well?

@23Skidoo
Copy link
Member

Yeah I guess, assuming it's the same patches but just backported -- I haven't looked at it.

Add an --install-method=symlink|copy flag which specifies how to perform
the installation.

* --symlink-bindir is now gone, replaced by --installdir
* --install-method=copy is useful in Windows where symlinking is not
supported

All new-install flags can now be configured in ~/.cabal/config

* NewInstallFlags changed to ClientInstallFlags (more descriptive than
InstallExFlags (like ConfigExFlags))
* ClientInstallFlags is now part of SavedConfig
some platforms need an extension for executables

Fixed how we get the bindir too.
Since we are working with units, not packages
@fgaz fgaz force-pushed the new-install/bindir-method branch from 1122d50 to a0480d4 Compare March 12, 2019 10:31
@fgaz
Copy link
Member Author

fgaz commented Mar 12, 2019

The error is a timeout. Merging.

@fgaz fgaz merged commit 59c223f into haskell:master Mar 12, 2019
fgaz works on cabal automation moved this from In progress ⏳ to Done ✅ Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants