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 macOS CI job #894

Merged
merged 1 commit into from
Dec 27, 2024
Merged

Fix macOS CI job #894

merged 1 commit into from
Dec 27, 2024

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Oct 14, 2024

As can be seen from the pkg-config output, libpng apparently no longer lives in /usr/local but rather in /opt/homebrew. We apply a hard-coded quick fix.

As can be seen from the pkg-config output, libpng apparently no longer
lives in /usr/local but rather in /opt/homebrew.  We apply a hard-coded
quick fix.
@cmb69
Copy link
Member Author

cmb69 commented Oct 14, 2024

Cool, works, although I dunno why, since I forgot to update the PNG_PNG_LIBRARY_DIR. And the include dir reported by pkg-config doesn't match the hard-coded PNG_PNG_INCLUDE_DIR. Maybe @dg0yt can help?

For the heif_read test failure see #889.

Copy link
Member

@vapier vapier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if pkg-config provides the correct values, we shouldn't need to override any of the PNG variables in the first place ...

@@ -58,14 +58,14 @@ jobs:
pkg-config --libs libpng
pkg-config --libs --cflags libpng16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should prob delete --libs here since we already use that on the next line

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is "debug" output, and should probably removed at some point.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's helpful for troubleshooting this sort of thing :)

@dg0yt
Copy link
Contributor

dg0yt commented Oct 14, 2024

Oh, I was the last person to touch this file ... in December, 2023.
At that time the chosen macos-latest runner image was an x64 one (aka Intel).
But since April, 2024, this key maps to an arm64 image (aka Apple Silicon).
On arm64 hosts, the default brew prefix is no longer /usr/local but /opt/homebrew.
AFAICS this script still hardcodes /usr/local x64 host assumptions, e.g. in PKG_CONFIG_PATH.

@cmb69
Copy link
Member Author

cmb69 commented Dec 21, 2024

if pkg-config provides the correct values, we shouldn't need to override any of the PNG variables in the first place ...

Only if we used pkg-config for CMake configuration, but we don't (like for many other packages as well):

libgd/CMakeLists.txt

Lines 127 to 130 in c2867fd

if (ENABLE_PNG)
FIND_PACKAGE(ZLIB REQUIRED)
FIND_PACKAGE(PNG REQUIRED)
endif (ENABLE_PNG)

@vapier vapier marked this pull request as ready for review December 27, 2024 16:21
@vapier vapier merged commit 4efc1ad into libgd:master Dec 27, 2024
5 of 12 checks passed
${{github.workspace}}/.github/scripts/removemono.sh

- name: Configure CMake
run: cmake -DENABLE_PNG=1 -DENABLE_FREETYPE=1 -DENABLE_JPEG=1 -DENABLE_WEBP=1
-DENABLE_TIFF=1 -DENABLE_GD_FORMATS=1 -DENABLE_CPP=0 -DENABLE_HEIF=1 -D CMAKE_PREFIX_PATH=/usr/local
-DBUILD_TEST=1 -DVERBOSE_MAKEFILE=1 -DPNG_PNG_INCLUDE_DIR=/usr/local/Cellar/libpng/${{ env.LIBPNG_VERSION }}/include -DPNG_PNG_LIBRARY_DIR=/usr/local/Cellar/libpng/${{ env.LIBPNG_VERSION }}/lib -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DBUILD_TEST=1 -DVERBOSE_MAKEFILE=1 -DPNG_PNG_INCLUDE_DIR=/opt/homebrew/Cellar/libpng/${{ env.LIBPNG_VERSION }}/include -DPNG_PNG_LIBRARY_DIR=/usr/local/Cellar/libpng/${{ env.LIBPNG_VERSION }}/lib -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still -DPNG_PNG_LIBRARY_DIR=/usr/local/Cellar/libpng/${{ env.LIBPNG_VERSION }}/lib here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, but that doesn't seem to matter: https://github.com/libgd/libgd/actions/runs/12518290911/job/34920495485#step:5:52

Should probably still be cleaned up, but I'm bad at macOS. Feel free to provide a PR! :)

@cmb69 cmb69 deleted the cmb/macos-ci branch December 27, 2024 17:03
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.

3 participants