-
Notifications
You must be signed in to change notification settings - Fork 992
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
[feature] Ability to identify if binaries can be executed on a particular platform #11035
Comments
It's true you don't need to invoke Rosetta manually on M1 to execute x86_64, but still, the architecture is not the same and Mac will run Rosetta 2 dynamically, which has some loss of performance. I could use QEMU on Linux and say the same thing, but still, is not optimized. I disagree adding such feature because any possible incompatibility error when executing an app, will result result someone asking to Conan issues or Conan Center Index for a solution, which is not related to Conan. Running aligned architecture is the best option ever, and Conan already supports M1, which means, you can package ARM packages too. |
I don't dislike being able to run things that are cross-built in platforms that allow it, and it seems this feature could make sense. A different story is if we want to cross-build and/or cross-execute in ConanCenter. I see a point if that execution subsystem is not rock solid, as any potential error will result in further undesirable broken builds, support, tickets, discussions, etc in ConanCenter. |
also, as I understand, this move could be a temporary. e.g. previously, Rosetta allowed to execute x86 (32-bit) and PowerPC binaries on x86_64 machines, but eventually Apple has removed that support completely, as x86_64 Apple machines became more wide-spread than x86(32) and PowerPC. actually, it lasted only OS 3 releases (from 10.4 to 10.7) that time. |
Yes, if the OSX support for this might be changing, dropped, etc., then trying to have something robust in Conan can be a maintenance burden and source of bugs and support tickets. And if support for x86(32) lasted only 3 releases, is not looking good... |
the suggestion might be to implement an external configuration for cross-building function. maybe just a single boolean value within profile (or conf) that overrides the result of |
It cannot be a conf to alter the So the only possible reasonable alternative I see at this moment is:
This might be dummy implementation, but allows recipes to have clean logic and users to control manually the execution, without needing to implement any "smart" logic inside conan. |
yes, I support that direction |
Implemented in #11321, will be in 1.49 |
Typically there is made use of
tools.cross_building(self.settings)
to identify that for example test binaries can't be executed on a particular platform. Though this particular solution is not really sufficient to handle for example the case of running on a macOS with Apple Silicon (M1) chipset, as in that particular case you can execute both x86_64 and armv8 binaries without any issue (even without Rosetta enabled).Extending
tools.cross_building
with yet another parameter similar toskip_x64_x86
seems not a good option. Therefore it would be good to have a dedicated method for this usecase like for exampletools.can_run()
.The text was updated successfully, but these errors were encountered: