Bug 2267072 - Could not detect vcpkg-root using vcpkg install
Summary: Could not detect vcpkg-root using vcpkg install
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: vcpkg
Version: 39
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Vitaly
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-02-29 14:38 UTC by James Paul Turner
Modified: 2024-04-26 01:38 UTC (History)
2 users (show)

Fixed In Version: vcpkg-2024.03.14-1.fc39
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-04-26 01:38:11 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description James Paul Turner 2024-02-29 14:38:09 UTC
After running e.g. `vcpkg install` or `vcpkg list`, the command fails with:

```
error: Could not detect vcpkg-root. If you are trying to use a copy of vcpkg that you've built, you must define the VCPKG_ROOT environment variable to point to a cloned copy of https://github.com/Microsoft/vcpkg.
```

`VCPKG_ROOT` is not set in the default environment, and it is unclear where to set it to given the vcpkg package's installed file structure. Not sure how the package can be used otherwise. 

Thanks. Happy to send more information.


Reproducible: Always

Steps to Reproduce:
1.Install vcpkg
2.Run e.g. `vcpkg list` or `vcpkg install ...`

Actual Results:  
error: Could not detect vcpkg-root. If you are trying to use a copy of vcpkg that you've built, you must define the VCPKG_ROOT environment variable to point to a cloned copy of https://github.com/Microsoft/vcpkg.



For extra context, I have C++ projects using CMake/vcpkg which rely on VCPKG_ROOT being set.

Comment 1 Trung Lê 2024-04-17 08:48:15 UTC
I think you misunderstood the usage of this package.

This package is just the vcpkg-tool (which can be found at https://github.com/microsoft/vcpkg-tool). There is NO inclusion of the vcpkg ports/related stuffs.

So users have to manually set it up. Here is roughly how:

```
mkdir -p ~/Work
cd ~/Work

# fetch the latest ports
git clone https://github.com/microsoft/vcpkg.git

# once done, you can set VCPKG_ROOT
export VCPKG_ROOT=~/Work/vcpkg
# it is recommended to add ^ to your bashrc or whatever rc file of your preferred shell

# test the app
vcpkg list
```

Comment 2 Fedora Update System 2024-04-25 10:44:10 UTC
FEDORA-2024-a1d5c4fac3 (vcpkg-2024.03.14-1.fc39) has been submitted as an update to Fedora 39.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-a1d5c4fac3

Comment 3 Vitaly 2024-04-25 10:51:48 UTC
The vcpkg-2024.03.14-1.fc39 update will set $VCPKG_ROOT as $HOME/.local/share/vcpkg (can be changed in config).

For more information please read README.fedora.

Comment 4 Fedora Update System 2024-04-26 01:38:11 UTC
FEDORA-2024-a1d5c4fac3 (vcpkg-2024.03.14-1.fc39) has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.