-
Notifications
You must be signed in to change notification settings - Fork 7.1k
[feature] add vcpkg export --x-chocolatey
support
#6891
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
Conversation
@nuclearsandwich @ooeygui, any feedback is welcome! |
👍 |
This is really cool! I have a few questions/observations:
|
std::string maintainer = binary_paragraph.maintainer; | ||
if (maintainer.empty()) | ||
{ | ||
maintainer = binary_paragraph.spec.name(); |
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.
I think it would be better to always set this maintainer field from a value specified by the exporter; some sort of vcpkg export --chocolatey --maintainer=abc
.
This is because users who have chosen to be listed in the maintainer fields of the vcpkg ports probably don't want to be contacted if there are issues in a produced chocolatey package -- it should be the job of the chocolatey package producer to first determine whether the issue is an upstream problem and then forward to the listed maintainer.
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.
That makes sense. I added it as CLI options in the latest iteration.
Good question! I added a option
Any pointers (docs) about the |
We don't have explicit docs other than the source code[2], which is a 100 line powershell script. Essentially, it recursively traverses the DLL dependency tree of an exe/dll and copies any DLLs needed out of vcpkg and into the build directory.
Our documented and supported way to use packages is via our toolchain file[1], not via One way to fix this would be to export monolithic SDKs instead, that follow our existing Otherwise, given the above (that we don't have a supported use story for the packages after building), I think we can still include this as an "experimental+unsupported" feature. In this case, we need to add [1] https://github.com/microsoft/vcpkg/blob/master/docs/users/integration.md#cmake-toolchain-file-recommended-for-open-source-cmake-projects |
vcpkg export --chocolatey
supportvcpkg export --x-chocolatey
support
I added |
nuspec_file_content = | ||
Strings::replace_all(std::move(nuspec_file_content), "@PACKAGE_MAINTAINER@", chocolatey_options.maybe_maintainer.value_or("")); | ||
nuspec_file_content = | ||
Strings::replace_all(std::move(nuspec_file_content), "@PACKAGE_DESCRIPTION@", binary_paragraph.description); |
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.
It seems that the ports/boost-modular-build-helper/CONTROL
file doesn't contain Description
contents, and if we want export packages dependence on boost-modular-build-helper
, the program will complain Description is required
and exit, but not point out which package lacks the required information.
Thanks for making this PR @seanyen and sorry for the long delay! If you would like to make changes to this in the future, please do feel free to open new PRs. |
This PR is to add a new export type
Chocolatey
for vcpkg.With this PR, developers can do
vcpkg export <packages> --x-chocolatey --x-maintainer=abc
and it outputs Chocolatey packages in per-package manner. For example, iftinyexif
is exported, thentinyexif.1.0.2.nupkg
andtinyxml2.7.0.1.nupkg
will be generated, becausetinyexif
depends ontinyxml2
.And on the import side, developers can copy over those packages and do
choco install tinyexif -s <path of nupkg(s)>
. In this example,tinyxml2
andtinyexif
will be both installed to the current working directory, and theinstalled
contents will be merged. Likewise, to remove packages, developers can dochoco uninstall tinyexif tinyxml2
to remove both or dochoco uninstall tinyexif
to only removetinyexif
.And why do I break a set of vcpkg
installed
snapshot into packages? I think that this modularization gives developers flexibility to pull down only the needed packages (and its dependencies) at the beginning, and they can pull down more as needed later.