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

vcpkg ignoring default-features: false in custom overlay #38686

Closed
patrikhuber opened this issue May 10, 2024 · 2 comments
Closed

vcpkg ignoring default-features: false in custom overlay #38686

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

Comments

@patrikhuber
Copy link
Contributor

Describe the bug
.\vcpkg.exe install my-test-package --overlay-ports=C:\Users\MyUser\vcpkg-custom-overlay --dry-run where my-test-package has a vcpkg.json with:

  "dependencies": [
    {
      "name" : "vcpkg-cmake",
      "host" : true
    },
    {
      "name" : "vcpkg-cmake-config",
      "host" : true
    },
    {
      "name": "opencv4",
      "default-features": false
    }
  }

ignores the default-features: false flag and wants to install: * opencv4[core,default-features,dnn,jpeg,png,quirc,tiff,webp]:[email protected]#19

Environment

  • OS: Windows 11
  • Latest vcpkg (cloned today)

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/Microsoft/vcpkg.git vcpkg-clean
  2. cd .\vcpkg-clean\
  3. .\bootstrap-vcpkg.bat
  4. .\vcpkg.exe install my-test-package --overlay-ports=C:\Users\MyUser\vcpkg-custom-overlay --dry-run

produces the following output:

Computing installation plan...
The following packages will be built and installed:
    my-test-package:[email protected] -- C:\Users\PatrikHuber\Projects\vcpkg-custom-overlay\my-test-package
  * flatbuffers:[email protected]
  * libjpeg-turbo:[email protected]
  * liblzma:[email protected]
  * libpng:[email protected]#1
  * libwebp[core,libwebpmux,nearlossless,simd,unicode]:[email protected]#1
  * opencv4[core,default-features,dnn,jpeg,png,quirc,tiff,webp]:[email protected]#19
  * protobuf:[email protected]#2
  * quirc:[email protected]
  * tiff[core,jpeg,lzma,zip]:[email protected]#4
  * vcpkg-cmake:x64-windows@2024-04-18
  * vcpkg-cmake-config:x64-windows@2022-02-06#1
  * vcpkg-get-python-packages:x64-windows@2024-01-24
  * zlib:[email protected]
Additional packages (*) will be modified to complete this operation.

Expected behavior
It should only install opencv4[core], without default-features (dnn etc.).

Failure logs
See above.

Additional context

  • vcpkg-custom-overlay/my-test-package/vcpkg.json:
{
  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
  "name": "my-test-project",
  "version": "1.0.0",
  "homepage": "https://gitlab.com/private/private",
  "dependencies": [
    {
      "name" : "vcpkg-cmake",
      "host" : true
    },
    {
      "name" : "vcpkg-cmake-config",
      "host" : true
    },
    {
      "name": "opencv4",
      "default-features": false
    }
  ]
}

  • vcpkg-custom-overlay/my-test-package/portfile.cmake:
vcpkg_from_gitlab(
    GITLAB_URL https://gitlab.com
    OUT_SOURCE_PATH SOURCE_PATH
    REPO private/private
    REF "${VERSION}"
    SHA512 0
    HEAD_REF main
)

vcpkg_cmake_configure(
    SOURCE_PATH "${SOURCE_PATH}"
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(PACKAGE_NAME "my-test-package")

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

# file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)

@JonLiu1993 JonLiu1993 self-assigned this May 11, 2024
@JonLiu1993 JonLiu1993 marked this as a duplicate of #35555 May 11, 2024
@JonLiu1993 JonLiu1993 closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2024
@JonLiu1993 JonLiu1993 added category:question This issue is a question 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 11, 2024
@JonLiu1993 JonLiu1993 reopened this May 11, 2024
@JonLiu1993 JonLiu1993 marked this as not a duplicate of #35555 May 11, 2024
@JonLiu1993
Copy link
Member

Duplicate of #35694

@JonLiu1993 JonLiu1993 marked this as a duplicate of #35694 May 11, 2024
@JonLiu1993 JonLiu1993 closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2024
@patrikhuber
Copy link
Contributor Author

Thank you @JonLiu1993, I posted a comment in that other issue.

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

2 participants