-
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
[vcpkg-cmake][libpng] Add "OSX_SPLIT_BUILD" feature #22898
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have modified or added at least one vcpkg.json where a "license" field is missing.
If you feel able to do so, please consider adding a "license" field to the following files:
ports/libpng/vcpkg.json
ports/vcpkg-cmake/vcpkg.json
Valid values for the license field are listed at https://spdx.org/licenses/
@JackBoosY It seems the pipeline failed
Is this something I can fix on my end or is this some other issue? Should we just restart the pipeline? |
0f1ceb6
to
294ed25
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have modified or added at least one vcpkg.json where a "license" field is missing.
If you feel able to do so, please consider adding a "license" field to the following files:
ports/libpng/vcpkg.json
Valid values for the license field are listed at https://spdx.org/licenses/
294ed25
to
5a7ff94
Compare
@JackBoosY: Can you shed a light on this build failure: https://dev.azure.com/vcpkg/public/_build/results?buildId=66849&view=logs&j=878666d5-db33-5b27-9e7d-b0c7ee352005&t=d914c609-a9aa-5880-221f-cbd46db9069e It says it's failed, but I don't understand why. |
That's because you also need to update the related docs. |
5a7ff94
to
f6734a6
Compare
Thanks, @JackBoosY, I would have never guessed that from the output! |
cc @strega-nil-ms for review this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is really cool! I'll bring it up to the team 😄
One thing that I'd like to see here is, instead of passing OSX_SPLIT_BUILD
to both vcpkg_cmake_configure
and vcpkg_cmake_install
, just setting a Z_OSX_SPLIT_BUILD
cache variable (just like how we do generators).
It also seems like this could be a more general solution; I think it could very easily be adapted for autotools and meson builds, at least, with a helper z_vcpkg_merge_osx_architectures
.
I'm sorry it took so long for me to see this PR; it completely slipped under the radar.
f6734a6
to
f62fb20
Compare
f62fb20
to
a76fe5f
Compare
Can you please resolve the file conflicts? Thanks. |
a76fe5f
to
932c97d
Compare
Certainly. I thought I had, but I think I must've rebased on an older version of the master branch. Should be good to go now. |
@ras0219-msft Please review the vcpkg-cmake part. |
Can you please merge to master first? |
I guess you mean "merge master in first"? Just as an aside, merging to master would be when we finally get this feature in the master branch. Anyway, during merging I noticed that master is broken. Somebody has been playing around renaming variables (which happens surprisingly often it seems), |
4e5de4f
b958923
to
4e5de4f
Compare
When building mesa:x64-windows:
Is this related to your changes? |
I'd be very surprised if it were, given that the changes are only enabled on macos. It's possible I made a mistake during one of the merges. I'll check this out later today. |
@omartijn Any progress? |
I've tried building the package on the master branch, and that also failed in the |
Can you please resolve the file conflicts so I can take a look? |
Some ports (e.g. libpng) don't support building for multiple architectures at the same time. For these ports, we can now use the OSX_SPLIT_BUILD option, which will perform multiple builds (one for each requested architecture) and then merge them into a universal binary when the build is complete
4e5de4f
to
1b6a2db
Compare
"${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" | ||
-D CMAKE_OSX_ARCHITECTURES=${OSX_ARCHITECTURE} | ||
${arg_OPTIONS} | ||
${arg_OPTIONS_RELEASE} | ||
-G "${generator}" | ||
"-DCMAKE_BUILD_TYPE=Release" | ||
"-DCMAKE_INSTALL_PREFIX=${OSX_SPLIT_BUILD_INSTALL_DIR_RELEASE}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to use dbg_command
and rel_command
here, can you please make some changes for this?
"-DCMAKE_BUILD_TYPE=Release" | ||
"-DCMAKE_INSTALL_PREFIX=${OSX_SPLIT_BUILD_INSTALL_DIR_RELEASE}" | ||
WORKING_DIRECTORY "${build_dir_release}-${OSX_ARCHITECTURE}" | ||
LOGNAME "${arg_LOGFILE_BASE}-rel-${OSX_ARCHITECTURE}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may also need to declare SAVE_LOG_FILES
here.
vcpkg_execute_required_process( | ||
COMMAND | ||
"${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" | ||
-D CMAKE_OSX_ARCHITECTURES=${OSX_ARCHITECTURE} | ||
${arg_OPTIONS} | ||
${arg_OPTIONS_DEBUG} | ||
-G "${generator}" | ||
"-DCMAKE_BUILD_TYPE=Debug" | ||
"-DCMAKE_INSTALL_PREFIX=${OSX_SPLIT_BUILD_INSTALL_DIR_DEBUG}" | ||
WORKING_DIRECTORY "${build_dir_debug}-${OSX_ARCHITECTURE}" | ||
LOGNAME "${arg_LOGFILE_BASE}-dbg-${OSX_ARCHITECTURE}" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
I've taken a look into using Somehow, the option is then not correctly processed. I have spent about as much time as I am willing on this, but the constant code churn is taking too much of my time. So I'll leave this PR for anyone who's willing to maintain it. |
Convert this PR to draft since there is no progress for 10 days. |
Closing this PR since it seems that no progress is being made. Please ping me to reopen if work is still being done. |
Describe the pull request
What does your PR fix?
It enabled universal binaries for cmake-based ports that somehow don't support it (e.g. because they use NASM). One such example is libpng, which now works with this PR
Which triplets are supported/not supported? Have you updated the CI baseline?
All. It also works for libpng when you set VCPKG_OSX_ARCHITECTURES to both arm64 and x86_64
Does your PR follow the maintainer guide?
Yes
If you have added/updated a port: Have you run
./vcpkg x-add-version --all
and committed the result?Yes