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

Add arm64ec support to vcpkg.json platform expressions #36900

Closed
kobykahane opened this issue Feb 21, 2024 · 6 comments
Closed

Add arm64ec support to vcpkg.json platform expressions #36900

kobykahane opened this issue Feb 21, 2024 · 6 comments
Assignees
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)

Comments

@kobykahane
Copy link
Contributor

Describe the bug
vcpkg.json Platform Expressions as described in https://learn.microsoft.com/en-us/vcpkg/reference/vcpkg-json#platform-expression currently do not have an 'arm64ec' that corresponds to the arm64ec value in VCPKG_TARGET_ARCHITECTURE.

In my use case, I would like to enable the 'arm64' feature of the 'capstone' port in arm64 and arm64ec builds and the 'x86' feature in x64 and arm64ec builds but not in arm64 builds.

Environment

  • OS: Windows

To Reproduce
Steps to reproduce the behavior:

  1. Use a platform expression in a vcpkg.json file with arm64ec.
  2. Observe the error:

warning: Unrecognized identifer name arm64ec. Add to override list in triplet file.

(As a side note, "identifer" in the error message above should be "identifier").

Expected behavior
Platform expressions should support arm64ec.

Additional context
ARM64EC was added in #27814.

@FrankXie05
Copy link
Contributor

@kobykahane Could you please confirm that there is file arm64ec-windows.cmake in your directory \vcpkg\triplets\community? . Please make sure you are using the latest vcpkg

@FrankXie05 FrankXie05 added the requires:more-information This Issue requires more information to solve label Feb 22, 2024
@FrankXie05
Copy link
Contributor

And, I think we need to update the documentation. 🧐

@kobykahane
Copy link
Contributor Author

@kobykahane Could you please confirm that there is file arm64ec-windows.cmake in your directory \vcpkg\triplets\community? . Please make sure you are using the latest vcpkg

@FrankXie05 Yes, I am using the latest vcpkg. See reproduction below. Although the manifest uses 'arm64ec' in the platform expression for the 'arm64' feature of the 'capstone' port, the expression is unrecognized and the port is built without that feature.

C:\>git clone https://github.com/microsoft/vcpkg.git
Cloning into 'vcpkg'...
remote: Enumerating objects: 223295, done.
remote: Counting objects: 100% (1317/1317), done.
remote: Compressing objects: 100% (155/155), done.
remote: Total 223295 (delta 1218), reused 1194 (delta 1162), pack-reused 221978Receiving objects: 100% (223295/223295),


Resolving deltas: 100% (147243/147243), done.
Updating files: 100% (11129/11129), done.

C:\>C:\vcpkg\bootstrap-vcpkg.bat
Downloading https://github.com/microsoft/vcpkg-tool/releases/download/2024-02-07/vcpkg.exe -> C:\vcpkg\vcpkg.exe... done.
Validating signature... done.

vcpkg package management program version 2024-02-07-8a83681f921b10d86ae626fd833c253f4f8c355b

See LICENSE.txt for license information.
Telemetry
---------
vcpkg collects usage data in order to help us improve your experience.
The data collected by Microsoft is anonymous.
You can opt-out of telemetry by re-running the bootstrap-vcpkg script with -disableMetrics,
passing --disable-metrics to vcpkg on the command line,
or by setting the VCPKG_DISABLE_METRICS environment variable.

Read more about vcpkg telemetry at docs/about/privacy.md

C:\>cd repro

C:\repro>type vcpkg.json
{
  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
  "dependencies": [
    {
      "name": "capstone",
      "default-features": false,
      "features": [
        {
          "name": "arm64",
          "platform": "arm64ec"
        },
        "diet"
      ]
    }
  ]
}

C:\repro>C:\vcpkg\vcpkg install --no-print-usage --triplet=arm64ec-windows
Fetching registry information from https://github.com/microsoft/vcpkg (HEAD)...
warning: Unrecognized identifer name arm64ec. Add to override list in triplet file.
Detecting compiler hash for triplet x64-windows...
Detecting compiler hash for triplet arm64ec-windows...
The following packages will be built and installed:
    capstone[core,diet]:[email protected]#1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\d2879a914b5c261ad9fb1b48b921a4d53a486eb0
  * vcpkg-cmake:x64-windows@2023-05-04 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\88a7058fc7fa73a9c4c99cfcae9d79e2abf87a5a
  * vcpkg-cmake-config:x64-windows@2022-02-06#1 -- C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\8d54cc4f487d51b655abec5f9c9c3f86ca83311f
Additional packages (*) will be modified to complete this operation.
A suitable version of 7zip was not found (required v23.1.0) Downloading portable 7zip 23.1.0...
Downloading 7zip...
https://github.com/ip7z/7zip/releases/download/23.01/7z2301-extra.7z->C:\vcpkg\downloads\7z2301-extra.7z
Downloading https://github.com/ip7z/7zip/releases/download/23.01/7z2301-extra.7z
Extracting 7zip...
Restored 0 package(s) from C:\Users\ContainerAdministrator\AppData\Local\vcpkg\archives in 188 us. Use --debug to see more details.
Installing 1/3 vcpkg-cmake-config:x64-windows@2022-02-06#1...
Building vcpkg-cmake-config:x64-windows@2022-02-06#1...
-- Installing port from location: C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\8d54cc4f487d51b655abec5f9c9c3f86ca83311f
-- Installing: C:/vcpkg/packages/vcpkg-cmake-config_x64-windows/share/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake
-- Installing: C:/vcpkg/packages/vcpkg-cmake-config_x64-windows/share/vcpkg-cmake-config/vcpkg-port-config.cmake
-- Installing: C:/vcpkg/packages/vcpkg-cmake-config_x64-windows/share/vcpkg-cmake-config/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 34.7 ms.
Elapsed time to handle vcpkg-cmake-config:x64-windows: 95.4 ms
vcpkg-cmake-config:x64-windows package ABI: 1319c000d4aace9c0f87c485f90e985359f3ef90a7e4c35e863324dc5c60fe39
Installing 2/3 vcpkg-cmake:x64-windows@2023-05-04...
Building vcpkg-cmake:x64-windows@2023-05-04...
-- Installing port from location: C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\88a7058fc7fa73a9c4c99cfcae9d79e2abf87a5a
-- Installing: C:/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg_cmake_configure.cmake
-- Installing: C:/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake
-- Installing: C:/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake
-- Installing: C:/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg-port-config.cmake
-- Installing: C:/vcpkg/packages/vcpkg-cmake_x64-windows/share/vcpkg-cmake/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 18.2 ms.
Elapsed time to handle vcpkg-cmake:x64-windows: 76.2 ms
vcpkg-cmake:x64-windows package ABI: 419eb0667ae51deacf448a13105713c123320739bd1ec178c49748dd8d412500
Installing 3/3 capstone[core,diet]:[email protected]#1...
Building capstone[core,diet]:[email protected]#1...
warning: -- Using community triplet arm64ec-windows. This triplet configuration is not guaranteed to succeed.
-- [COMMUNITY] Loading triplet configuration from: C:\vcpkg\triplets\community\arm64ec-windows.cmake
-- Installing port from location: C:\Users\ContainerAdministrator\AppData\Local\vcpkg\registries\git-trees\d2879a914b5c261ad9fb1b48b921a4d53a486eb0
-- Downloading https://github.com/capstone-engine/capstone/archive/5.0.1.tar.gz -> capstone-engine-capstone-5.0.1.tar.gz...
-- Extracting source C:/vcpkg/downloads/capstone-engine-capstone-5.0.1.tar.gz
-- Applying patch 001-silence-windows-crt-secure-warnings.patch
-- Using source at C:/vcpkg/buildtrees/capstone/src/5.0.1-c25f2ee61c.clean
-- Configuring arm64ec-windows
-- Building arm64ec-windows-dbg
-- Building arm64ec-windows-rel
-- Fixing pkgconfig file: C:/vcpkg/packages/capstone_arm64ec-windows/lib/pkgconfig/capstone.pc
-- Downloading https://mirror.msys2.org/mingw/mingw64/mingw-w64-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst;https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/mingw/mingw64/mingw-w64-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/mingw64/mingw-w64-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/mingw/mingw64/mingw-w64-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst;https://mirror.selfnet.de/msys2/mingw/mingw64/mingw-w64-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst -> msys2-mingw-w64-x86_64-pkgconf-1~2.1.0-1-any.pkg.tar.zst...
-- Downloading https://mirror.msys2.org/msys/x86_64/msys2-runtime-3.4.10-4-x86_64.pkg.tar.zst;https://repo.msys2.org/msys/x86_64/msys2-runtime-3.4.10-4-x86_64.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/msys2-runtime-3.4.10-4-x86_64.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/msys2-runtime-3.4.10-4-x86_64.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/msys/x86_64/msys2-runtime-3.4.10-4-x86_64.pkg.tar.zst;https://mirror.selfnet.de/msys2/msys/x86_64/msys2-runtime-3.4.10-4-x86_64.pkg.tar.zst -> msys2-msys2-runtime-3.4.10-4-x86_64.pkg.tar.zst...
-- Using msys root at C:/vcpkg/downloads/tools/msys2/fdbea3694fb5c0d4
-- Fixing pkgconfig file: C:/vcpkg/packages/capstone_arm64ec-windows/debug/lib/pkgconfig/capstone.pc
-- Installing: C:/vcpkg/packages/capstone_arm64ec-windows/share/capstone/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 138 ms.
Elapsed time to handle capstone:arm64ec-windows: 10 s
capstone:arm64ec-windows package ABI: 249f200aaefd1c2592bf66c7e99b164404ecc2e12d991b0bcfe09882e7e56c9f
Total install time: 10 s

C:\repro>type C:\vcpkg\triplets\community\arm64ec-windows.cmake
set(VCPKG_TARGET_ARCHITECTURE arm64ec)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)

@FrankXie05 FrankXie05 added category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) and removed requires:more-information This Issue requires more information to solve labels Feb 23, 2024
@FrankXie05
Copy link
Contributor

Yes, currently platform does not recognize the expression arm64ec. (Same for classic mode)

image

cc @vicroms @BillyONeal

@kobykahane
Copy link
Contributor Author

Fixed by microsoft/vcpkg-tool#1352.

@dg0yt
Copy link
Contributor

dg0yt commented Feb 23, 2024

Fixed by microsoft/vcpkg-tool#1352.

But not released yet.

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