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

Don't require VCPKG_FORCE_SYSTEM_BINARIES on arm64 Linux #1277

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

russelltg
Copy link
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
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
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
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
Contributor

quyykk commented Nov 16, 2023

See also #868

@swelborn
Copy link

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
Contributor Author

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

@swelborn
Copy link

thanks. But +1 for not requiring VCPKG_FORCE_SYSTEM_BINARIES.

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