-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[GRPC] Strange triplet behaviour #19476
Comments
|
I'm not quite I sure understand how a package can have a dependency on its own feature but I will take your word for that! If I explicitly install grpc[codegen] with my custom triplet, will it still want to build x64-windows as a host triplet? And are host triplets excluded from binary caching? It builds grpc[codegen]:x64-windows (release and debug) as it cannot find a cached version, then when it gets to build with my triplet it rebuilds that from source too, even though all my other packages are cached. I see mention of sources being cleaned and wonder if that's why. GRPC is seemingly a large library that is slow to build, and it's partly negating the point of using binary caching. Is there anything I can do or is it a special case? |
IIRC these changes to grpc were done only recently, and before that there was a lot stuff broken in one way or another. It should be easy to find the issues, pull requests, or check vcpkg tries to separate stuff which runs on the target from stuff which runs on the build machine (host). In the case of grpc, it is only the codegen feature which must run on the host. If you know that target binaries run on the host, you can set the host triplet to match the target triplet. (This is what I do for mingw, in absence of a MSVC installation.) Once the binaries are in the cache, they should be reused in following installations. This works flawlessly in vcpkg's CI. However, changes can be triggered with each git pull, in particular from changes to central cmake scripts. The user community couldn't yet convince the maintainers that there is a need for release-only triplets, but at least fixes are accepted. Perhaps the case of host tools should be stressed an extra argument. |
Thanks @dg0yt that's interesting. I have previously tried to avoid doing anything with host triplets for fear of messing things up. However, it doesn't sounds like this should stop binary-cache working? Once I got things set up it did work very smoothly, except grpc. It didn't find a cache for either the host triplet or my custom triplet and I wondered if one was a knock-on effect of the other even though in theory each triplet has a distinct build-tree. I checked and the triplet_abi was identical for grpc:x64-windows on both machines, but it still didn't get picked up from the binary cache... the other ~375 packages all did! |
The "triplet_abi" is just one item in the abi info. |
I looked at the full abi file and I could see one change only, in the has for "abseil" (presumably a dependency). I think this was the very first thing built when I was trying to get caching working so it may be I somehow have a 'stale' copy before I fixed issues. Oh for a rebuild option or the ability for vckg to notice when things change. It does all these hashes for cache use but if you change anything that would modify those caches it doesn't detect this and you can easily end up with a mish-mash. I suppose the mindset is to treat /vcpkg as disposable so anytime you change something you start over but it would be nice if it caught these things and warned you. Anyway I'll clean my dev box and try again. BTW is |
One other question, is there any benefit to building host triplets as both debug and release? I was amazed to find my vcpkg directory was >50Gb, is anyone realistically going to debug vcpkg while using it? |
Don't ask me. I think it is a Visual Studio convenience thing. With a Linux background, it is just strange. In particular, statically linked tools eat tons of space, easily outweighting the benefit of shared |
@jdx-john You can delete the buildtrees folder and packages folder safety. |
I use a custom triplet based on x86/x64-windows-static-md triplet:
I have binary caching finally working but noticed GRPC was not using cached binaries, but rebuilding from source:
Apart from rebuilding, my custom triplet also chooses to only build release which is now being ignored and causing the build to take a lot longer as it builds debug too. I am not really sure why it is trying to build grpc:x64-windows rather than my custom triplet.
Actually I see later on, it does build grpc[core]:x64-my-triplet whereas for x64-windows it builds grpc[codegen,core]:x64-windows - codegen is added (I don't specify that in my scripts).
Does that mean something I build has a dependency on grpc[codegen] but is choosing to build it as x64-windows for some reason? Wouldn't dependencies be built using same triplet normally?
Can I easily find out who has this dependency to figure out if it's a bug? This has caused installing on a dev-box to take 30+ minutes instead of about 2, because every other package is restored from cache but grpc is being built multiple times!
The text was updated successfully, but these errors were encountered: