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

[libpq] Version missmatch between CONTROL and portfile #9235

Closed
CJCombrink opened this issue Dec 6, 2019 · 6 comments
Closed

[libpq] Version missmatch between CONTROL and portfile #9235

CJCombrink opened this issue Dec 6, 2019 · 6 comments
Assignees
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist

Comments

@CJCombrink
Copy link

Is your feature request related to a problem? Please describe.
It is not techincally a problem, but can probably be.
There is a missmatch between the "Version" set in the CONTROL file and the portfile.cmake for libpq.

vcpkg$ cat ports/libpq/CONTROL | grep Version 
Version: 9.6.1-8
vcpkg$ cat ports/libpq/portfile.cmake  | grep URLS
    URLS "https://ftp.postgresql.org/pub/source/v9.6.3/postgresql-9.6.3.tar.bz2"

The CONTROL file states 9.6.1 but 9.6.3 is downloaded

Proposed solution
There should be a way to set the version once in the CONTROL file and then use that from the portfile. Something like ${VCPKG_VERSION_FROM_CONTROL}

Describe alternatives you've considered
No other alternatives are considered. The solution should have minimal maintenance and the proposed solution should be good enough.

@CJCombrink CJCombrink added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Dec 6, 2019
@Neumann-A
Copy link
Contributor

Proposed solution
There should be a way to set the version once in the CONTROL file and then use that from the portfile. Something like ${VCPKG_VERSION_FROM_CONTROL}

I would also like to have something like that. But it would require and extra tag like vcpkg_version or similar in the CONTROL file to remove the extra -8

@CJCombrink
Copy link
Author

But it would require and extra tag like vcpkg_version or similar in the CONTROL file to remove the extra -8

Maybe an alternative is something to add the -8 for the version?

Something like the following in the CONTROL file:

Source: libpq
LibVersion: 9.6.1
Version: ${LibVersion}-8

And then in the portfile use the ${LibVersion}

@CJCombrink
Copy link
Author

Perhaps another option can be a vcpkg function that formats a version as required
Something like:

format_version( ${Version}, "M.m.b")

And it should understand some normal notations with some flexibility.
This function can then be used in the portfile.

PS: I don't know cmake thus can't give a cmake equivalent function signature

PS2: I see also a missmatch in libpqxx between CONTROL and the CMakeList.txt

vcpkg$ head ports/libpqxx/CMakeLists.txt 
cmake_minimum_required(VERSION 3.5)
project(libpqxx VERSION 6.4.3 LANGUAGES CXX)

set(CMAKE_DEBUG_POSTFIX "d")
set(CMAKE_CXX_STANDARD 14)

find_library(LIBPQD NAMES libpqd pqd)
find_library(LIBPQ NAMES libpq pq)
find_path(LIBPQ_FE_H libpq-fe.h)
find_path(POSTGRES_EXT_H postgres_ext.h)
vcpkg$ cat ports/libpqxx/CONTROL 
Source: libpqxx
Version: 6.4.5
Homepage: https://github.com/jtv/libpqxx
Description: The official C++ client API for PostgreSQL
Build-Depends: libpq

@CJCombrink
Copy link
Author

Maybe at the very least a way to unit test in a pipeline. Not sure how vcpkg pipelines are set up or how configurable they are, but before a PR gets build by the CI to just check the versions.
This will add manual overhead for each package but at least will prevent it from happening again
A one-size-fits-all solution will probably never work with this approach:

Perhaps something in the ports folder or a pre-commit hook that checks it, at commit or CI build time.

Anything that relies on discipline to keep in sync will fail unless checked/enforced by an automated process.

@cenit
Copy link
Contributor

cenit commented Dec 8, 2019

Anything that relies on discipline to keep in sync will fail unless checked/enforced by an automated process.

This is valid for many things beyond the versioning.
I’d also like something to clean up this problem (which exists in many other ports)

@AlvinZhangH
Copy link
Contributor

Hi @CJCombrink thanks for posting this issue.
This issue has been fixed now. Please try to update vcpkg and rebuild it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist
Projects
None yet
Development

No branches or pull requests

4 participants