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

build a lib with specified version #12321

Closed
alimai opened this issue Jul 8, 2020 · 8 comments
Closed

build a lib with specified version #12321

alimai opened this issue Jul 8, 2020 · 8 comments
Assignees
Labels
category:question This issue is a question

Comments

@alimai
Copy link

alimai commented Jul 8, 2020

I try to build a lib with specified version, and find a suggestion as following in #11768 :

  1. Use command .\vcpkg x-history qt5
  2. Get the commit id of the version you need.
  3. Use command git reset
  4. Rebuild qt5.

Originally posted by @timautry in #11768 (comment)

I do a test with the zlib(The latest version of zlib in vcpkg is 1.2.11-6),
Vcpkg still build the latest version of module when I following the suggestion of @timautry timautry.

  1. git reset 18b029a
  2. .\vcpkg x-history zlib
    version date vcpkg commit
    1.2.11-5 2019-06-15 18b029a
    1.2.11-3 2018-08-30 ab54bfa
    1.2.11-2 2017-09-23 67e876c
    1.2.11-1 2017-09-09 26516fe
    1.2.11 2017-01-17 0d50c67
    1.2.10 2017-01-04 6a220ed
    1.2.8 2016-11-08 1808d46
    [note: It seems the current version should be 1.2.11-5 now.]
  3. .\vcpkg install zlib
    Computing installation plan...
    The following packages will be built and installed:
    zlib[core]:x64-windows
    Downloading powershell-core...
    Extracting powershell-core...
    Starting package 1/1: zlib:x64-windows
    Building package zlib[core]:x64-windows...
    -- Downloading http://www.zlib.net/zlib-1.2.11.tar.gz...
    -- Extracting source E:/vcpkg/downloads/zlib1211.tar.gz
    -- Applying patch cmake_dont_build_more_than_needed.patch
    -- Using source at E:/vcpkg/buildtrees/zlib/src/1.2.11-deec42f53b.clean
    -- Configuring x64-windows
    -- Building x64-windows-rel
    -- Installing: E:/vcpkg/packages/zlib_x64-windows/share/zlib/copyright
    -- Performing post-build validation
    -- Performing post-build validation done
    Installing package zlib[core]:x64-windows...
    Installing package zlib[core]:x64-windows... done
  4. .\vcpkg list
    zlib:x64-windows 1.2.11-6 A compression library

The installed version is still 1.2.11-6, is there any thing wrong?

@JackBoosY JackBoosY self-assigned this Jul 8, 2020
@JackBoosY JackBoosY added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label Jul 8, 2020
@JackBoosY
Copy link
Contributor

Confirmed, but I think this is just a display issue.

@alimai
Copy link
Author

alimai commented Jul 8, 2020

Just a

Confirmed, but I think this is just a display issue.

Hi, it seem not that.
if you test the boost module, you will find that the vcpkg download the tar.gz file with latest version from github.

@alimai alimai closed this as completed Jul 8, 2020
@alimai alimai reopened this Jul 8, 2020
@alimai
Copy link
Author

alimai commented Jul 8, 2020

Misuse(close the issue)

@Neumann-A
Copy link
Contributor

git reset 18b029a probably requires --hard to reset the working tree instead of leaving it untouched ;)

@alimai
Copy link
Author

alimai commented Jul 9, 2020

git reset 18b029a probably requires --hard to reset the working tree instead of leaving it untouched ;)

Oh, do you mean the buildtree?
I test it with a new vcpkg, no lib has been installed before, so there don't have any of the following folder: buildtrees,downloads,installed,packages

And I try reset it with --hard option,
After that, the vcpkg told me to run 'bootstrap-vcpkg.bat',
Then I got many many errors.

@JackBoosY
Copy link
Contributor

@ras0219 @ras0219-msft Could you take a look?

Thanks.

@strega-nil
Copy link
Contributor

@alimai the correct command to run is probably:

$ git checkout <copied commit> -- ports/<port-name>

This will check out only the specified port from the tree. You can also do something like:

$ mkdir pinned-ports
$ git checkout <copied commit> -- ports/<port-name>
$ mv ports/<port-name> pinned-ports
$ git checkout HEAD -- ports

and then proceed to use vcpkg with the additional flag --overlay-ports=./pinned-ports :)

@strega-nil strega-nil added category:question This issue is a question and removed category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) labels Jul 9, 2020
@alimai
Copy link
Author

alimai commented Jul 9, 2020

@alimai the correct command to run is probably:

$ git checkout <copied commit> -- ports/<port-name>

This will check out only the specified port from the tree. You can also do something like:

$ mkdir pinned-ports
$ git checkout <copied commit> -- ports/<port-name>
$ mv ports/<port-name> pinned-ports
$ git checkout HEAD -- ports

and then proceed to use vcpkg with the additional flag --overlay-ports=./pinned-ports :)

Thanks. It works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

6 participants
@strega-nil @ras0219-msft @alimai @Neumann-A @JackBoosY and others