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

Suggestion: Install ports from other directories #4686

Closed
arthur-tacca opened this issue Nov 8, 2018 · 3 comments
Closed

Suggestion: Install ports from other directories #4686

arthur-tacca opened this issue Nov 8, 2018 · 3 comments
Labels
category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed

Comments

@arthur-tacca
Copy link

I suggest allowing vcpkg to install ports that are outside of its usual ports directory, perhaps by way of a switch for extra include directories, like this:

vcpkg install --additional-port-dir ../portsdir myport

I further suggest that relative paths are taken from vcpkg's directory (rather than the current working directory) and that ./ports is always implicitly added to the search list. Forward slashes are allowed (if not enforced) on Windows for cross-platform compatibility.

My motivation for this is that we have some custom ports, not suitable for upstreaming to the public vcpkg repo, and we keep these in a repo that we recommend our devs clone alongside vcpkg's repo. I realise the current advice for this situation (in #2926) is to fork the vcpkg repo into your own hosting and commit your additional ports into that, but I'm not keen on that idea because your files and commits can get lost in the flood of vcpkg public ports.

Currently we have a step prior to vcpkg install which copies the ports from sibling directory, which this suggestion would avoid. I must admit keeping a batch file for this is not a huge burden, but I thought it would be sensible to raise the idea.

Interaction with vcpkg install -r

If support is added for something like vcpkg install -r requirements.txt (as requested in #2663), then it should also include support for --additional-port-dir, much like pip supports --extra-index-url in requirements files (see Requirements File Format). I don't propose adding them automatically on vcpkg freeze, that seems too complex to do automatically. But the file could manually edited, and end up looking like this:

--additional-port-dir ../portsdir
zlib
myport
myotherport

Alternative syntax

An alternative idea would be to specify the path directly in the port, like this:

vcpkg install ../myportsdir/myport

This more tightly associates the port with the directory it is in, which has pros and cons.

  • You wouldn't accidentally pick up a port from a different directory than you expected.
  • You could record this information in the requirements.txt (but maybe you don't want to?)
  • Where would ports look for their dependencies? (Perhaps dependencies would also have to use this syntax e.g. Requires: ../myportsdir/otherport)
  • Could be confusing when you didn't mean to specify another directory. This will be familiar to anyone who tried pip uninstall pkgname and it failed because the current directory contains a subdirectory called pkgname! But it would be mitigated by requiring paths to be relative to vcpkg.
@traversaro
Copy link
Contributor

traversaro commented Nov 8, 2018

Thanks for the nice discussion, #114 is an old but related issue.

@PhoebeHui PhoebeHui added the category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed label Jan 21, 2019
@vicroms
Copy link
Member

vicroms commented Jun 27, 2019

@arthur-tacca

The new --overlay-ports option should address some of the discussion points in this issue (implemented in PR #6981).

Example:

./vcpkg install zlib --overlay-ports=C:\ports\3rd-party

See specification for details of how to use this feature.

@arthur-tacca
Copy link
Author

--overlay-ports satisfies this request. Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed
Projects
None yet
Development

No branches or pull requests

4 participants