Skip to content

Don't require VCPKG_FORCE_SYSTEM_BINARIES on arm64 Linux#1277

Closed
russelltg wants to merge 6 commits intomicrosoft:mainfrom
russelltg:arm64_linux_noforcesystem
Closed

Don't require VCPKG_FORCE_SYSTEM_BINARIES on arm64 Linux#1277
russelltg wants to merge 6 commits intomicrosoft:mainfrom
russelltg:arm64_linux_noforcesystem

Conversation

@russelltg
Copy link
Copy Markdown
Contributor

@russelltg russelltg commented Nov 16, 2023

This is the basic set of changes to the tool to allow having entries in vcpkgTools.xml per-architecture.

Obviously this requires some changes to vcpkgTools.xml. This has been tested on arm64 Linux with

-    <tool name="cmake" os="linux">
+    <tool name="cmake" os="linux" arch="x64">
         <version>3.27.1</version>
         <exeRelativePath>cmake-3.27.1-linux-x86_64/bin/cmake</exeRelativePath>
         <url>https://github.com/Kitware/CMake/releases/download/v3.27.1/cmake-3.27.1-linux-x86_64.tar.gz</url>
         <sha512>192374a68e2971f04974a194645726196d9b8ee7abd650d1e6f65f7aa2ccc9b186c3edb473bb4958c764532edcdd42f4182ee1fcb86b17d78b0bcd6305ce3df1</sha512>
         <archiveName>cmake-3.27.1-linux-x86_64.tar.gz</archiveName>
     </tool>
+    <tool name="cmake" os="linux" arch="arm64">
+        <version>3.27.1</version>
+        <exeRelativePath>cmake-3.27.1-linux-x86_64/bin/cmake</exeRelativePath>
+        <url>https://github.com/Kitware/CMake/releases/download/v3.27.1/cmake-3.27.1-linux-aarch64.tar.gz</url>
+        <sha512>de458163eb066efe76ab3ece2e0781d1e3d3091b1eda00d9f49b323ada1f65ab9138c52e1af5e6fe74dbd4a4327d4185336c71a9c7430bb5817962ece5696fc1</sha512>
+        <archiveName>cmake-3.27.1-linux-aarch64.tar.gz</archiveName>
+    </tool>

applied to vcpkgTools.xml.

Is there potentially interest in this? My usecase is I'd really like to use this arm64 Linux machine for development (a Mac Studio), and have it be able to download binarycache'd artifacts from our server. The problem with FORCE_SYSTEM_BINARIES is that it sets verison 0 in for cmake in the ABI, so it has to recompile everything. This combined with --host-triplet lets me download the binary cache.

Opening as draft because it requires parallel changes to vcpkgTools.xml, so the PR cannot be merged without a plan on how to do that.

@BillyONeal
Copy link
Copy Markdown
Member

I would like to see lifting the lid on this area to completely eliminate vcpkgTools.xml; needing to better handle host cpu, in particular host arm-windows and arm-linux, is something we indeed need to do better at.

See also:

@russelltg
Copy link
Copy Markdown
Contributor Author

russelltg commented Nov 16, 2023

Yeah makes sense. Parsing that XML file with regex does not seem ideal to me, ha. Gave me a laugh as I was reminded of https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454

(of course in practice it's fine considering the xml file is entirely controlled by yall)

@BillyONeal
Copy link
Copy Markdown
Member

Yeah makes sense. Parsing that XML file with regex does not seem ideal to me, ha. Gave me a laugh as I was reminded of https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454

(of course in practice it's fine considering the xml file is entirely controlled by yall)

The XML file exists due to long Long ago before we had vcpkg binaries at all, where bootstrap-vcpkg.sh was also parsing the XML file with regex and this was done to be consistent with that. Now that all the platforms where vcpkgTools.xml had any meaning have binaries available, it doesn't really need to exist anymore.

@quyykk
Copy link
Copy Markdown
Contributor

quyykk commented Nov 16, 2023

See also #868

@swelborn
Copy link
Copy Markdown

I am experiencing something that may be related, but I am unsure (I am not too familiar with vcpkg):
@russelltg Are you using docker? If so, are you able to build with docker on apple silicon with platform emulation? If so, what is your typical route to doing this? For ex. I can docker build fine on a metal amd64 server, but when I run with docker build --platform=linux/amd64 on my M1 I get build errors for all attempted builds. If this is a different issue, I could open one, please let me know.

@russelltg
Copy link
Copy Markdown
Contributor Author

Seems different. I'm building from native arm64 Linux.

@swelborn
Copy link
Copy Markdown

thanks. But +1 for not requiring VCPKG_FORCE_SYSTEM_BINARIES.

@BillyONeal
Copy link
Copy Markdown
Member

The work contained herein appears to have landed in #1553 and #1599

Thanks for your contribution!

@BillyONeal BillyONeal closed this Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants