Skip to content

[vcpkg] vcpkg_configure_meson: Support macOS cross-compile#15867

Merged
ras0219-msft merged 3 commits intomicrosoft:masterfrom
past-due:osx_neson_cross_compile_1
Feb 11, 2021
Merged

[vcpkg] vcpkg_configure_meson: Support macOS cross-compile#15867
ras0219-msft merged 3 commits intomicrosoft:masterfrom
past-due:osx_neson_cross_compile_1

Conversation

@past-due
Copy link
Contributor

@past-due past-due commented Jan 25, 2021

Describe the pull request

NOTE: Depends on #15659 (the first 3 commits in this PR are from #15659, for running CI) - now merged!

Based on discussion on Discord with @ras0219, this takes the approach of a minimal fix to the meson cross-compile config.

While this fixes cross-compiling many meson-based ports, there is one exception:

Meson-based ports that require "native" architecture tools to be built as part of their build process may still have issues. But as @ras0219 noted (on Discord), that is best fixed by port-level fixes after PR #15424 is merged that take advantage of that new "host triplet dependency" functionality. Regardless, this fix is needed for the rest.

  • What does your PR fix?

Fixes arm64-osx cross-compile of meson-based ports.

(Building meson-based ports for arm64-osx would previously build them for the native architecture - i.e. building harfbuzz:arm64-osx on an Intel 64-bit Mac, would seemingly succeed but actually build an x86_64 architecture library.)

  • Which triplets are supported/not supported? Have you updated the CI baseline?

arm64-osx

@JackBoosY JackBoosY self-assigned this Jan 26, 2021
@JackBoosY JackBoosY added the category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly label Jan 26, 2021
@JackBoosY
Copy link
Contributor

cc @Neumann-A for review this PR.

@past-due past-due force-pushed the osx_neson_cross_compile_1 branch from 59b81f6 to d46506b Compare January 29, 2021 03:46
@past-due
Copy link
Contributor Author

past-due commented Jan 29, 2021

Rebased on top of the latest master branch (which has now merged #15659).

@PhoebeHui PhoebeHui changed the title vcpkg_configure_meson: Support macOS cross-compile [vcpkg] vcpkg_configure_meson: Support macOS cross-compile Feb 2, 2021
@past-due
Copy link
Contributor Author

past-due commented Feb 2, 2021

@ras0219-msft @JackBoosY Just for clarity, I would like to encourage the merging of this PR as-is. (Additional port fixes will depend on #15424, but I feel that those are out-of-scope for this PR and best left for a subsequent PR.)

This small change fixes a number of ports (harfbuzz:arm64-osx, and everything that depends on it, being a very important one).

@JackBoosY
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JackBoosY
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@past-due
Copy link
Contributor Author

past-due commented Feb 9, 2021

@JackBoosY x86_windows failure appears to be unrelated to this PR:

Found the following errors:
Error: While reading versions for port log4cpp from file: C:\a\1\s\versions\l-\log4cpp.json
       Version `2.9.1#4` was not found in versions file.
       Run:

           vcpkg x-add-version log4cpp

       to add the new port version.

To attempt to resolve all errors at once, run:

    vcpkg x-add-version --all

past-due and others added 3 commits February 9, 2021 18:20
Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>
Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com>
@past-due past-due force-pushed the osx_neson_cross_compile_1 branch from 7114eef to 03d6415 Compare February 9, 2021 23:31
@past-due
Copy link
Contributor Author

past-due commented Feb 10, 2021

All seems to check out with the new regex, and I'm pretty happy with that as the solution. (It fixes many other issues as well with splitting CFLAGS / CXXFLAGS.)

@Neumann-A, @ras0219-msft?

@ras0219-msft ras0219-msft merged commit d610518 into microsoft:master Feb 11, 2021
@ras0219-msft
Copy link
Contributor

LGTM, this is a clear improvement over the status quo. I'm sure there will be some additional edge cases found in the future, but I don't think that is worth holding up the improvement now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants