-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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-tool-gn] Build gn from source on 16 KiB page arm64-Linux #39474
base: master
Are you sure you want to change the base?
[vcpkg-tool-gn] Build gn from source on 16 KiB page arm64-Linux #39474
Conversation
This allows users with Asahi Linux machines to build vcpkg ports that require the gn build tool.
@microsoft-github-policy-service agree |
(community feedback)
|
I'm not sure how this approach would fix the linked issue, #39468 The problem there is that while there is a linux-arm64 binary available, it is unusable if the system page size is set to 16 KiB (a kernel config value). So we need a way to detect that the existing linux-arm64 binary will not be usable on this platform, and to build from source instead. Is there another way to detect this property of the host system at script time that would be better? I do know that the information is available in the /proc/ filesystem on linux. So if we only want it to be checked for Linux arm64, we could look at /proc in a way like this:
or via
|
Sorry, I didn't pay enought attention. IMO there are three alternatives:
The second option only needs
in the portfile, and
in the custom triplet. It could be easily transformed to the first option. Community feedback. Looking forward to hear from the MS team. |
This just runs into the tool ports blocker. |
@AugP discussed this today.
In particular we need to have high confidence that it isn't going to break binary caching. Ideally we also know the end to end story works before we make incremental steps.
It seems like this needs to be an entirely different 'cpu' because this will affect |
My understanding of the reason that gn has issues on 16 KiB Linux kernels and other tools do not is a combination of factors:
The other tools such as CMake, ninja, meson, etc that have aarch64 binaries downloaded from a third party do not statically link jemalloc, or another allocator that hard codes the system page size at compile time. |
Another alternative could be to create infrastructure for vcpkg to build from source and cache tool binaries on GitHub or another CDN that the upstream doesn't ship. |
} | ||
") | ||
|
||
# FIXME: Is there a vcpkg approved :tm: try_run replacement? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need it.
- Make a
project
subdir with regularCMakeLists.txt
. - Use
vcpkg_cmake_configure(SOURCE_PATH "${CURRENT_PORT_DIR}/project" ...)
- it will pass the actual toolchain settings.
Make the configuration always succeed, and make it write a result file (aligned viaOPTIONS "-DRESULT_FILE=${CURRENT_BUILDTREES_DIR}/result-${TARGET_TRIPLET}.cmake"
) with the desired information. - Load the result file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping @ADKaster for response. Can you address the review suggestions? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @LilyWangLL , sorry for the late reply. I don't think I'll have the capacity to address the comments on this issue.
This allows users with Asahi Linux machines to build vcpkg ports that require the gn build tool.
Fixes ##39468
./vcpkg x-add-version --all
and committing the result.This approach... works, but might not be the desired direction? This appears to be the first "host tool" that actually wants to build native code. The way to get a compiler for gn to use is a bit sketchy.