Comments (8)
@lionkor you may try the run-vcpkg@dev/arm-triplet-fix
which contains the proposed fix. Let me know if this is working for you as well!
from run-vcpkg.
@lionkor to make this request actionable I think I need your help:
- what the problem is?
- what the observed behavior is?
- what is the expected behavior and why?
Link (or attached log to this issue) to existing failing workflows would help.
from run-vcpkg.
Sure!
To reproduce:
- Make a GitHub Actions workflow with
run-vcpkg
in a repo withvcpkg.json
(manifest mode, so withrunVcpkgInstall: true
) with some dependency likeboost-system
. - Set
VCPKG_FORCE_SYSTEM_BINARIES: 1
in the workflow's ENV (this ensures vcpkg will build for ARM64, on ARM64). - Run the GitHub Actions workflow in an ARM64 runner.
- Observe build failure due to
run-vcpkg
building for somex64
triplet instead of just the arm64 triplet.
The problem:
VCPKG_FORCE_SYSTEM_BINARIES means that vcpkg should ONLY build for the target triplet, not some cross-compilation triplet, in this case. Instead, it builds for another triplet, with the current system's compiler, which fails if the specific package uses any kind of special flags on another triplet (like x64's -m64
flag).
The observed behavior:
Build failure on arm64.
Logs:
The paste includes ONLY the run-vcpkg
invokation, for your convenience, because the rest of the log is huge. You can see the VCPKG_FORCE_SYSTEM_BINARIES in the env for that run.
Please observe line 345 in this log for the incorrect detection of x64
as described above.
Observe also line 786 where the arm64 gcc compiler obviously fails to build with x64 flags (because it does not support those flags, because they're specific to x64 afaik).
Expected behavior:
When running vcpkg in a bare-metal arm64 machine, with ONLY the VCPKG_FORCE_SYSTEM_BINARIES=1
set, vcpkg in manifest mode will correctly only build the arm64 builds as you can see in this log: https://pastebin.com/mT5V8ZNP.
So, to clarify: The expected behavior in this case is that the x64 triplet is not built when vcpkg install is invoked by run-vcpkg
on arm64 with VCPKG_FORCE_SYSTEM_BINARIES
set. vcpkg handles this properly, so it must be a run-vcpkg
issue, as far as I could debug it.
from run-vcpkg.
Here's a link to the actual workflow file, before hotfixing it by setting the triplet (which should NOT be needed since the run-vcpkg
action runs on arm64 itself and vcpkg knows it's arm64: https://github.com/BeamMP/BeamMP-Server/actions/runs/7366964699/workflow (specifically only the arm64 workflows even call run-vcpkg
, so you'll have to look at the debian-11-arm64-build
job)
from run-vcpkg.
@lionkor thank you for a throughout explanation of the problem!
It is indeed a run-vcpkg
issue, the getDefaultTriplet needs to be augmented to be able to tell whether the default vcpkg triplet is for Intel or ARM based CPUs.
The RUNNER_ARCH environment variable could be used to detect ARM vs Intel platforms, and if it is not set, the fallback would be os.arch(), which is not perfect as it reports the target platform of the nodejs executable, but it is good most of the times.
from run-vcpkg.
Wonderful, thank you!
Let me know if you need anything else, I have runners and arm64 machines to test with.
from run-vcpkg.
Thank you very much, looks sane to me. Will test when I get a chance & get back to you
from run-vcpkg.
@lionkor I proceeded forward and released a new version of [email protected]
with the fix merged in. Let me know if it works for you, thank you.
from run-vcpkg.
Related Issues (20)
- v11 has been published onto the v10 branch HOT 2
- run-vcpkg@v11 requires manually setting environment variables for caching to work HOT 6
- run-vcpkg@v11 does not support prepended/appendedCacheKey HOT 2
- run-vcpkg failing with "dyld: Symbol not found: __ZNKSt3_V214error_category10_M_messageB5cxx11Ei" HOT 4
- One package not cached HOT 6
- About Static Linking HOT 4
- some errors when install package HOT 1
- Running the action in a container fails. HOT 3
- Use same cache for all builds? HOT 2
- default vcpkg install directory HOT 4
- Error: EACCES: permission denied, mkdir when running with act on full HOT 4
- 'Could not find toolchain file' even though path seems OK HOT 5
- Unnecessary double compilation when using VCPKG_DEFAULT_TRIPLET HOT 4
- vcpkg.json link dead HOT 1
- Update v7 to Node.js 20 HOT 4
- Error when restoring cache HOT 1
- Meet an error when try to use this action. HOT 2
- [macOS 14] functional tests failing since 25th April 2024
- Commit id fetching doesn't work if checked out to a subdirectory HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from run-vcpkg.