-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
Flatbuffers not generating 32-bit "flatc" executable on Ubuntu #3551
Comments
This is because of this part of the script. The issue is that xmake recognize cross-compilation and thus the inability to run the flatc binary on the host. It would work with a 32bits runner, but I don't think GitHub provides those as 32bits Linux are pretty rare today. |
Ah yeah that makes sense. I didn't think of building 32-bit binary on 64-bit OS as cross-compilation but I guess it makes sense. I don't quite understand the intricacies of xmake so I'm not sure if the current way of doing it is working as intended or not.
Thanks for clarifying. And if this is intended behavior if there is a more general issue covering this topic feel free to close this issue. |
Are you using flatbuffers only for its binary package? If so you want use |
No I will be using the library too for my project. I.e. i won't just be using EDIT: |
One way is to write something like:
and use flatbuffers~host flatc if present or flatbuffers otherwise, something I do with my own binary shader compiler rule. |
Hi thanks for the support. Yes that seems to do what I need but I don't understand what |
It's a way to requires flatbuffers a second time without conflicting on the package name. xmake remove the ~ part when fetching a package on xmake-repo but keeps it as its reference name. ("~host" is just a suffix, it could be anything). The real magic is to configure it with |
Alright thanks a lot :) |
Xmake Version
2.8.8
Operating System Version and Architecture
Ubuntu 22.04.4 LTS x86_64
Describe Bug
When installing the flatbuffers package it will build the flatbuffer compiler
flatc
. It does so perfectly on both windows 32 and 64 bit (usingxmake f -a x86
andxmake f -a x64
respectively). It also works perfectly on Ubuntu for x86_64 and build theflatc
executable in the installdir. But for some reason it doesn't build theflatc
executable on linux with architecture set to i386. I.e. there isn't anyinstalldir/bin/flatc
. The installdir contains the same files otherwise except the missingbin
folder.There are no errors anywhere when downloading or installing the package.
Expected Behavior
I would expect it to compile the flatbuffer project and provide the flatc compiler in the
installdir/bin/
folder like it does on 64 bit mode on Ubuntu and both 32- and 64-bit mode in Windows 10.Project Configuration
You can see it fail here in this github action:
https://github.com/Jonathan-Greve/gw_dat_reader/actions/runs/8328945753/job/22790106109
Additional Information and Error Logs
Other than the missing flatc I don't have any issues. I can generate the 32-bit flatc manually by doing:
cmake -G "Unix Makefiles" -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32
make -j
The text was updated successfully, but these errors were encountered: