-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Wrong VcpkgInstalledDir with MSBuild, vcpkg manifest mode and custom triplet #21513
Comments
No, this is an intended change of #19767 to allow different triplets in one solution/project |
This is intented, really? |
Yes |
Does |
Each triplet has its own installed dir under the triplet name. So the installed dir for a triplet is |
The two methods presented differ in behaviour. Is this also intended? It does mean that I can not use |
You do pre-fill the artifact cache. But only if |
@dg0yt This is what I tried - look at the invocation from my the issue description. The (binary) files are placed in different directories... So, they are not used when invoking MSBuild, because MSBuild now expects the binary files in |
By "artifact cache" I don't meant the installed tree, but the local cache containing zipped archives. vcpkg tries to restore from cache before building packages. So you do save at least the build time (but not the disk space). I can't really comment on VS particularities, but the situation in CMake is similar: a |
This might be a big problem - today I use
That's a problem. :( Are there parameters I can use when invoking |
The disabling of multi-processor builds is due to the parameter I would have no problem using manifest install in MSBuild if multi-processor builds worked, but as it is now, the build runs sequentially and is a lot slower. This is the reason i prefer pre-seeding using powershell |
You can, but you have to set the installed dir properly (
This was also improved
No this is not the case. Only at the start they are all blocked until vcpkg has installed the dependencies. So the total time should be roughly the same |
Do you build in visual Studio or for a ci? With the updated integration vcpkg is not invoked at all when the dependencies are already installed. |
@autoantwort I build both in Visual Studio (on my developer machine) and in CI (using Azure's Microsoft-Hosted Pipeline Agent(s)). I'd love to just use manifest install in both cases, but only if the build is not sequental. Will investigate, thanks :) |
Hi, I'm trying to update from vcpkg pinned at around 2021 July 1st to latest and I'm running into the same issue, where, in manifest mode, the triplets folder is added twice to the install location. Since commit 97e7ac8, the $(VcpkgTriplet) is added twice, at lines 54 and 65 below: vcpkg/scripts/buildsystems/msbuild/vcpkg.targets Lines 51 to 72 in f1dfd65
Btw, I'm not using a custom triplet. Many comments above state that this is intended, but I don't see how adding twice the same information, by doubling $(VcpkgTriplet), would help something. Maybe I'm missing some details. |
It fixes #16083 (or makes the workaround the default) |
Ok, thanks. I guess having manifest behave the same as non-manifest, where triplets accumulate in the 'installed' folder involves deeper change to vcpkg_tool and this thread is then about that. Not wanting to hijack the thread, but this change (to fix #16083) seems to have changed the behavior regarding $(VcpkgInstalledDir) which was populated before and left empty by default now. @autoantwort maybe you can pinpoint me to other details that could help me understand. I would happily try to help around those issues, but I'm starting way further than you at having the big picture. Thanks. |
Yeah What is your problem or what are you trying to solve? |
I'm trying to solve that updating vcpkg (from ~July 1st, 2021 to latest) breaks our scripts because of two reasons:
For the first, having $(VcpkgInstalledDir) populated can be patched on our side, but I think being able to have it built-in is good. For the second, even if we don't currently build for both x86 and x64, I can appreciate the fix for #16083 (as when I noticed that behavior, I though this was by design that install folder would get cleared when switching between triplets in manifest mode). In non manifest mode, both x86 and x64 can lie in the same 'installed' folder, so it would be perfect if manifest mode would behave the same, but I guess this is complicated. If you tell me that both those are dead ends, I'll just live with it, else I can look at proposing patches/MRs. We can currently postpone our upgrade too. Edit: got your message about issues explaining the how and why. I'll have a look. |
With a simple change in vcpkg-tool, I was able to make it work in manifest mode similarly to non-manifest mode by not considering package from other triplets: It must be combined to a change in vcpkg itself: With those, I'm able to switch between configurations (x64, win32(x86)) in Visual Studio without vcpkg to remove packages from the other triplet without having to have nested install in @meastp can you give it a try? |
I think the simplest solution is to change |
This is indeed a simpler solution, involving no change in code, but I think having vcpkg-tool behave the same in both modes, by supporting to have many triplets in the installed folder (as it already do in non-manifest mode), would be a more robust solution, working out of the box, without having to change some optional parameter. This would also fix the current issue where the outcome is different depending if install is made from within Visual Studio or outside. I think Of course, this assumes the change doesn't break anything else and is acceptable as an upstream change. |
I don't think that this will happen. The idea of manifest mode is that the installed dir only contains the dependencies specified in your vcpkg.json file for a specific triplet.
This behavior change is only a problem for some exiting users that do a upgrade, for all new users the new default is better. |
May be better as I probably don't see the full extend of it, but also uglier as having I appreciate vcpkg a lot, I'm happy to finally get some time to try to contribute. Is there a way to have this change: mdubepsi@38164c9 considered, reviewed and discussed outside this thread?
Maybe this answer should have been given to those asking to support multiple configurations without having to replace all packages when switching between x86 and x64? As I said, I noticed this behavior and told myself that this was probably by design at that time. |
This is effectively the same as for cmake. But there it is
You can create a new PR for that.
Maybe, but switching between x86 and x64 now fully works without a problem. |
@mdubepsi @autoantwort FYI: I removed the separate cmd line The original reason why I added the pre-populate step was because of a slowdown/lock with VS manifest install which now appear to be fixed. |
Describe the bug
Building with MSBuild has stopped working. I recently updated vcpkg from an older version , and with a project in
C:\myproj
and aC:\myproj\vcpkg.json
file (using manifest mode), I have found:Using (in C:\myproj)
C:\vcpkg.exe install --overlay-triplets=C:\myproj\triplets --triplet=x64-windows-v142 --host-triplet=x64-windows-v142
works as expected, withC:\myproc\vcpkg_installed\vcpkg
andC:\myproj\vcpkg_installed\x64-windows-v142
are created.However, when building within Visual Studio (with
<VcpkgManifestInstall>true</VcpkgManifestInstall>
), the folders invcpkg_installed
are different:C:\myproc\vcpkg_installed\x64-windows-v142\vcpkg
andC:\myproj\vcpkg_installed\x64-windows-v142\x64-windows-v142
are created instead, which must be an error.Environment
If the culprit isn't immediately obvious to you who know the code, I can try to make a complete repro.
The text was updated successfully, but these errors were encountered: