Skip to content
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

Fix issue with fetching packages when doing cross-compilation #4957

Closed
wants to merge 1 commit into from

Conversation

bionicbeagle
Copy link
Contributor

This change changes the behavior with cross compilation when using packages. Previously the package would not properly fetch or install the cross-compiled packages.

Fixes #4935

@waruqi waruqi changed the base branch from master to dev April 10, 2024 02:21
@waruqi
Copy link
Member

waruqi commented Apr 10, 2024

It will break something, It may introduce more host libraries from on_fetch as well as pkg-config, causing linking errors. Only vcpkg/conan supports fetching cross-compiled libraries.

If we want to improve this, we need to consider more details.

@bionicbeagle
Copy link
Contributor Author

I see. I guess I would consider making conan/vcpkg functional an improvement over the current behaviour which is a very obscure failure mode with every package manager.

I'm not sufficiently familiar with the xmake internals to propose a solution but it seems like it would be useful to have a way to discriminate between the different package managers wrt their cross-compilation capabilities so that a better error could be produced in the cases where it is not supported, and let the package managers which support cross-compilation do their thing.

@waruqi
Copy link
Member

waruqi commented Apr 10, 2024

I will try to improve it, but it may take some time.

@bionicbeagle
Copy link
Contributor Author

Thanks. I'm wondering though if it would be valuable to at least make vcpkg/conan work in the meantime? As far as I understand the net impact of this change will be:

  • xrepo/vcpkg/conan will work for cross-compilation just as it used to
  • other package managers may fail in some manner

whereas the current code leaves us with:

with this change we are able to build for MacOS with latest xmake whereas without it we have to remain on 2.8.2 which is not ideal as we'd really like to leverage newer functionality.

@waruqi
Copy link
Member

waruqi commented Apr 10, 2024

Thanks. I'm wondering though if it would be valuable to at least make vcpkg/conan work in the meantime? As far as I understand the net impact of this change will be:

  • xrepo/vcpkg/conan will work for cross-compilation just as it used to
  • other package managers may fail in some manner

No, the impact of the current patch may be a bit severe, and more users will fail to compile due to finding the wrong system libraries from pkg-config than vcpkg/conan.

@waruqi
Copy link
Member

waruqi commented Apr 10, 2024

try #4963

@waruqi waruqi closed this Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to use asio vcpkg dependency for MacOS (cross compilation) with xmake version later than 2.8.2
3 participants