-
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
[thrift] Cannot invoke thrift.exe when cross-compiling on x64 for arm64 #36149
Comments
@petrmanek You should select the corresponding triplet of tools. |
What would that be? If I am on |
@petrmanek The generation of tools |
I don't see how these comments would help.
This will find |
I am aware of this. My issue is that Thrift ships an IDL compiler as well as runtime libraries required by stubs and skeletons generated by said compiler. When cross-compiling, my triplet selection correctly gets me runtime libraries compatible with the right (target) architecture. But unfortunately it also selects IDL compiler compatible with the target architecture, not the host ... hence my issue. To rephrase my question: is there a way to configure vcpkg (via environment, triplet or otherwise) to get me Thrift compiler for the host architecture and Thrift runtime libraries for the target architecture? I suppose this would be a common problem with Thrift (or any similar middleware for that matter) because its IDL compiler is rarely executed by the end user, as far as I understand it does not even get installed when a program depends on the package. This is understandable as the main use case for it is to generate code at build time, and it stands to reason that the architecture of the compiler binary should be determined by the host, not the target (as it is now).
The |
You need at least two things:
Then the host tool should be available to |
I have done that.
I was not aware of this -- will try and report back! |
We hope your question was answered to your satisfaction; if it wasn't, you can ping me with more info and I will reopen. |
Hello together, I like your explination and from a point of view it makes sense. But I think it is not completely solved. In our multiplattform project we are build for win-64 (native), linux-64 (native) and linux-arm64 (on linux-64 host) using the vcpkg manifest mode (so not being able to add plattform-dependent packages on a certain build, afaik). So how should I install the thrift-compiler for arm64 build on the host? I think this is not possible with our setup for covering all these targets. From my point of view the port should recognize if target and host are different and also install the package for the host. This should be its task to enable a successful compilation. I think this is also done for other technologies, like CMake is also installed for the host on cross compile automatically. Does this sound senseful to you? Thank you & best regards |
You maybe need install the corresponding |
We install the thrift:linux-arm64, but then the thrift compiler for the host is missing, which needs to be installed to be able to compile the thrift files for arm64. So I would need to install thrift:linux64 additionally as stated here: #36149 (comment), which is not possible through manifest file, as its plattform independent in our project. |
The manifest can request dependencies with |
That works like a charm, thank you very much! Incase others are wondering how to retrieve the thrift compiler path for host afterwards, here is our working snippet defining a new variable |
Describe the bug
I have installed thrift for both triplets
x64-windows
andarm64-windows
. When I attempt to compile my program for x64, everything works as expected. However, when cross-compiling for arm64 I run into an error (see log below).This happens when thrift IDL is supposed to be translated to C++ stubs and skeletons. My understanding is that the
arm64-windows
version of the thrift package also shipsthrift.exe
that was compiled for arm64, and is hence not executable on x64 hosts.Environment
To Reproduce
Steps to reproduce the behavior:
./vcpkg install thrift --triplet x64-windows
./vcpkg install thrift --triplet arm64-windows
-A x64
that uses thrift.exe, this succeeds-A arm64
that uses thrift.exe, this fails with the error aboveRepro code when
Expected behavior
I would expect that since it generates code (not binaries),
thrift.exe
is selected based on the host architecture rather than target architecture.Failure logs
Additional context
My cmake project finds
thrift.exe
using the following code.Later IDL is compiled using the following command:
The text was updated successfully, but these errors were encountered: