Skip to content
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

x-update-baseline does not respect reference (git branch) #38701

Open
tobylane opened this issue May 12, 2024 · 3 comments
Open

x-update-baseline does not respect reference (git branch) #38701

tobylane opened this issue May 12, 2024 · 3 comments
Assignees
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)

Comments

@tobylane
Copy link

tobylane commented May 12, 2024

Describe the bug
Updating the baseline in vcpkg-configuration.json ignores the reference. If another commit in the repository is newer. even in another branch (or only main?) it is used.

Environment
Not OS specific

To Reproduce
Steps to reproduce the behavior:

  1. Download https://github.com/tobylane/CorsixTH/blob/06316899e5daf04ff0fd344443d0b64d50723fbc/vcpkg-configuration.json
  2. vcpkg x-update-baseline --dry-run
  3. See the line "updated registry 'https://github.com/TheCycoONE/vcpkg-registry': baseline '15529ddf98c6ae963861c7fdc145c969d666aadf' -> '7e2920647c0c00b21d684c887d2c9b375a1b5b32'"

Expected behavior
It should respect the reference. The commit starting 15529dd is the head of that branch and does not need changing.

Additional context
The alternative I have is below, but I think x-updatebaseline` should do this by default, as it's the least surprising option. Switching to another reference (ie changing branch to main) should be behind an option.

          newsha="$(curl -s https://api.github.com/repos/microsoft/vcpkg/git/refs/heads/master | jq '.object.sha')"
          jq '."default-registry".baseline = '$newsha vcpkg-configuration.json > tmp
          mv tmp vcpkg-configuration.json

edit: I don't know this program or cpp, but should HEAD be here? https://github.com/microsoft/vcpkg-tool/blob/main/src/vcpkg/configuration.cpp#L695

@LilyWangLL LilyWangLL added the category:question This issue is a question label May 13, 2024
@LilyWangLL
Copy link
Contributor

Thanks for posting this issue. I use command git rev-parse HEAD to get the latest commit ID of the repo https://github.com/TheCycoONE/vcpkg-registry/tree/lua_cmake, the latest commit ID is 7e2920647c0c00b21d684c887d2c9b375a1b5b32.
image

@tobylane
Copy link
Author

From docs for reference

The Git reference used to list available versions of a Git Registry. A string. Optional. If not specified, defaults to HEAD. This field can be a topic branch to access versions that are not yet fully published.

It sounds like reference is used here to identify an alternative version, in another branch. The git rev-parse command needs the reference if it exists, or HEAD.

@LilyWangLL
Copy link
Contributor

I switched to branch lua_cmake, then used command git rev-parse HEAD to get the latest commit of that branch, the value is 15529ddf98c6ae963861c7fdc145c969d666aadf. I checked the code on the vcpkg-tool, and it seems that the case where the keyword reference is a branch is not handled. I have temporarily marked this issue as Vcpkg bug.

cc on call manger @data-queue and @BillyONeal, could you please take a look this issue?

@LilyWangLL LilyWangLL added category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) and removed category:question This issue is a question labels May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)
Projects
None yet
Development

No branches or pull requests

3 participants