Skip to content

cmake: enable CURL_USE_PKGCONFIG for cross-MINGW - #15005

Closed
vszakats wants to merge 2 commits into
curl:masterfrom
vszakats:cm-pkgconfig-mingw-cross
Closed

vszakats wants to merge 2 commits into
curl:masterfrom
vszakats:cm-pkgconfig-mingw-cross

Conversation

@vszakats

@vszakats vszakats commented Sep 22, 2024 •

Copy link
Copy Markdown
Member

Enable CURL_USE_PKGCONFIG by default for MinGW cross-builds.

Note: This may cause fallouts in certain envs where pkg-config picks
up native packages.

Follow-up to e1ab01d #14658
Follow-up to c555ab4 #14575

@vszakats vszakats added build cmake Windows Windows-specific labels Sep 22, 2024
@vszakats
vszakats marked this pull request as draft September 22, 2024 18:01
@vszakats
vszakats marked this pull request as ready for review September 22, 2024 18:11
@vszakats vszakats added the feature-window A merge of this requires an open feature window label Sep 22, 2024
@vszakats vszakats changed the title cmake: expand CURL_USE_PKGCONFIG to cross-MINGW cmake: enable CURL_USE_PKGCONFIG for cross-MINGW Sep 23, 2024
@vszakats vszakats mentioned this pull request Oct 24, 2024
4 tasks done
@vszakats
vszakats force-pushed the cm-pkgconfig-mingw-cross branch from 72b1598 to df6f194 Compare October 24, 2024 21:10
Enable `CURL_USE_PKGCONFIG` by default for MinGW cross-builds.

Note: This may cause fallouts in certain envs where pkg-config picks up
native packages.

Follow-up to e1ab01d curl#14658
Follow-up to c555ab4 curl#14575
@vszakats
vszakats force-pushed the cm-pkgconfig-mingw-cross branch from df6f194 to 9ec3f70 Compare October 24, 2024 21:22
@vszakats vszakats closed this in 39c06f7 Dec 16, 2024
@vszakats
vszakats deleted the cm-pkgconfig-mingw-cross branch December 16, 2024 21:16
@vszakats

Copy link
Copy Markdown
Member Author

It's fine to revert this if it causes issues in cross-builds.

@vszakats

vszakats commented Dec 17, 2024 •

Copy link
Copy Markdown
Member Author

This escalated quickly:
#15431 enabled brotli and zstd by default. The linux-mingw, CM gcc
job picked up the native Linux zstd package and broke itself:
https://github.com/curl/curl/actions/runs/12364664705/job/34508307483?pr=15431

The workaround is easy, but I tend to think it might be better
for most cross-builders to not pick up native packages.

vszakats added a commit that referenced this pull request Dec 17, 2024
This reverts commit 39c06f7 #15005.

Combined with most Find modules now supporting `pkg-config`
(39c741b #15408) this change made
mingw-cross builds fragile by picking up OS-native components. Also
adding `/usr/include` to the header path, confusing feature detection.
@vszakats

Copy link
Copy Markdown
Member Author

Reverted.

@vszakats

Copy link
Copy Markdown
Member Author

Adding to this picture that on macOS, CMake false-detects Homebrew
components when doing mingw-w64 cross-builds. It requires
-DCMAKE_IGNORE_PREFIX_PATH=$(brew --prefix) to work around.

Meaning that picking up wrong dependencies isn't unique to pkg-confg.

pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
Enable `CURL_USE_PKGCONFIG` by default for MinGW cross-builds.

Note: This may cause fallouts in certain envs where `pkg-config` picks
up native packages.

Follow-up to e1ab01d curl#14658
Follow-up to c555ab4 curl#14575

Closes curl#15005
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
This reverts commit 39c06f7 curl#15005.

Combined with most Find modules now supporting `pkg-config`
(39c741b curl#15408) this change made
mingw-cross builds fragile by picking up OS-native components. Also
adding `/usr/include` to the header path, confusing feature detection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build cmake feature-window A merge of this requires an open feature window Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

1 participant