-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[vcpkg] RFC: Manifests #11203
[vcpkg] RFC: Manifests #11203
Conversation
It looks cool! I don't have any constructive feedback regarding the manifest itself, but the nested markdown lists are broken in the I can submit a fix if you want. I suppose I should PR your own branch for that ? |
yeah, that works! sorry I can't work on it right now, I'm doing work on macOS pre-10.15 support -.- |
Cool! so looking forward to this One question the
or something like that. I would prefer if the |
@petersteneteg I simply followed existing practice for Javascript; however, there's a good point there that, for compiled languages, it doesn't make sense to commit your Additionally, I don't think that out-of-source-tree builds are generally accepted practice with modern CMake. That seems to be a leave-over from autoconf, maybe? But vcpkg and ninja-build, as two decently modern examples, both expect a person to build in-source-tree. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for working on this! I have added a few comments inline, I hope they can be useful.
If out-of-source-tree builds means "keeping the build directory not inside the source directory", I don't think it is uncommon. Probably it is just my bubble, but out-of-source-tree builds are standard practice when using build_tools such as colcon or CMake-based superbuilds. Furthermore, it is what you get by default when consuming dependencies via CMake's FetchContent, and if i am not wrong vcpkg itself builds its own ports out-of-source-tree when using |
@traversaro sorry, I meant the other way around -- it's not that out-of-source-tree builds aren't accepted practice, but that in-source-tree builds are totally valid. Also, for multi-level super-projects, what I might expect is something like Rust's workspaces: each sub-project has their own |
Feedback:
|
Edit: okay, someone explained to me what "in-source builds" are. Sorry for being confusing! I'm not trying to argue that in-source builds are good, but that in-project builds are good. I hadn't even considered in-source builds to be a thing that one might do... the fun of being young, I guess! |
But why put the vcpkg_modules folder "in-source" then? the vcpkg_acquire_dependencies() should know about the build directory... |
@petersteneteg The |
Citing Professional CMake: A Practical Guide https://crascit.com/professional-cmake/
Hence I would strongly prefer to keep the vcpkg_modules folder completely outside of the source directory. And by source directory I mean the root of my repository and the same directory as were the manifest file would be in. |
I think they should look into Conan - not saying Conan is the best tool, but it solves a lot of problems and maintains its own cache that is configurable through |
@petersteneteg That's not what that quote is saying, I don't think: the "source directory" is not the directory which the project is in. The source directory is the directory containing the literal source files --
so it's extremely common practice to have a project tree that looks like:
On the other hand, it does make sense to have the |
CMake defines the "Source tree" as the directory with the top level CMakeLists.txt. No other parent directory would really matter for CMake. https://cmake.org/cmake/help/v3.17/manual/cmake.1.html#manual:cmake(1)
Here I interpret separate as not a subfolder. The Book does the same interpretation. Using a subfolder might be common practice. But that does not make it good practice. |
I don't really see a difference between:
and
Both are basically out-of-source builds, because the build tree doesn't intermix with source-tree. Every project will decide where the CMakeLists.txt will be, so |
Thank you for working on this! Am I correct in assuming that this could also be used even if one only uses For example, we develop in Visual Studio and use MSBuild to build our project(s)... Our use case:
I'm guessing that this works with Ideally I'd like to create a |
@meastp yep, absolutely! before this is stabilized, we will support every build system we support currently 😁 |
That's great! |
It seems that vcpkg.json will have a dual role, when used on a port and when used by a developer to list dependencies of an application. In the second case, the name and version are not required or available elsewhere (for example, in the project entry CMakeLists.txt). |
@david-antiteum it's important to note that it's not actually a dual role -- it's just expanding what a "port" looks like. |
@strega-nil We have custom ports that are not present in the official vcpkg repository. Could one point to where (github url, file share etc.) the port "definition" is? For example, we have both open source ports and binary proprietary ports... :) EDIT: This is actually part of the feature description, but I can't see it specified in this PR?
I see |
@meastp for this initial RFC, we aren't going to add that feature; however, it's planned for very soon afterwards :) We call it "federation" in the wiki. I just didn't want to try and overload this so nobody gets manifests while we get federation specified and working. |
@strega-nil Ah, ok, that's fair :) I currently use a fork of vcpkg where I have added the ports missing from official vcpkg (binary and open source) that we need. What I think you're saying is that:
this ties in nicely with vcpkg.exe being included in Visual Studio - then I can use that even though I use dependencies that are not part of the official vcpkg repo. Are my assumptions correct? :) |
Your assumptions are correct! Although, if you want to avoid maintaining a fork, you may want to look into |
Thanks for working on this! If I understand correctly, the vcpkg_modules folder will be created for each cmake project and contain the binaries of it’s versioned dependencies. Will there be a way to first check whether a version is already installed “globally” by VCPKG to avoid having the same copy of the library on each dependent project? |
Somehow, a lot of tabs where inserted betweend the `*` and start of list items, and they didn't show up in the github source view 🤷.
@daniel-piro that's not a feature I'm interested in adding personally; I think that having the installed directory be completely different will allow one to separate the two really cleanly. For what it's worth, we will support binary caching, which means if you already have it installed anywhere, you'll be able to cache binaries, so that means it's just an unzip, not a compile. |
I'm going to Final Comment Period this! This manifest will be merged on Monday, June 1 (a week) if no one else has any comments :) Please add any other comments you wish to! Thanks all! |
This is great! It looks like manifests and federation will help alleviate the biggest issue we've run into, which is challenges submitting a PR to the vcpkg repository for ports that we want other people to be able to easily use in their projects. |
@strega-nil Just curious, for the
I am viewing this manifest ting from my experience in |
@seanyen this is absolutely a valid thing to do. |
We are currently working on a new feature: manifests. They are similar to manifests from other languages: Cargo.toml, package.json, etc. This specification lays out how we've thought about designing the manifest so far; please add your comments so that we might have the best experience possible :)
A note: there are two major features that pretty much depend on manifests, but which will be defined in separate RFCs: versioning, and federation. This manifest is designed such that those features are possible to fit on top of it, but it does not attempt to define those features right now.
Currently, this feature is being developed at strega-nil/vcpkg/manifests; please come check it out for very very pre-alpha demo-friendly support of this! An example of this feature in use is at strega-nil/vcpkg-example 😄
rendered