Skip to content

Avoid filename collision of static and dynamic lib#1394

Merged
tatsuhiro-t merged 1 commit intonghttp2:masterfrom
wrowe:fix-static-libname
Sep 21, 2019
Merged

Avoid filename collision of static and dynamic lib#1394
tatsuhiro-t merged 1 commit intonghttp2:masterfrom
wrowe:fix-static-libname

Conversation

@wrowe
Copy link
Copy Markdown
Contributor

@wrowe wrowe commented Sep 16, 2019

Renames the output of the ENABLE_STATIC_LIB library/archive output
to nghttp2_static.lib/.a to avoid filenames colliding with the output
name for ENABLE_SHARED_LIB library/archive, when both are enabled.

This change requires a release notes notice.

Signed-off-by: William A Rowe Jr [email protected]
Signed-off-by: Yechiel Kalmenson [email protected]

Renames the output of the ENABLE_STATIC_LIB library/archive output
to nghttp2_static.lib/.a to avoid filenames colliding with the output
name for ENABLE_SHARED_LIB library/archive, when both are enabled.

Signed-off-by: William A Rowe Jr <[email protected]>
Signed-off-by: Yechiel Kalmenson <[email protected]>
@tatsuhiro-t
Copy link
Copy Markdown
Member

Thank you for PR. Merged now.

@vszakats
Copy link
Copy Markdown
Contributor

vszakats commented Nov 15, 2019

It means that now dependent projects using the static libs are suddenly broken. I'd argue it's not good practice to use different names for dynamic and static libs, because dependent projects are almost always unable to adapt to such naming peculiarities.

However, there exists a standard to select static vs. shared e.g. in the GNU toolchain, so I'm guessing this is meant to fix the situation on Windows and MSVC specifically. In the meantime though, it just broke all other platforms. E.g. now I'll need to figure out a patch + nghttp2-specific configuration options for curl to pick the new names, which will require a custom patch, which will in turn break building with all preceding nghttp2 versions.

I think for MSVC users it may be a solution to run the build twice if both the static and dynamic results are required.

vszakats added a commit to curl/curl-for-win that referenced this pull request Nov 15, 2019
An nghttp2 update broke the build with no trivial way to fix it
in dependent projects.

Ref: nghttp2/nghttp2#1394
@vszakats
Copy link
Copy Markdown
Contributor

vszakats commented Nov 15, 2019

Issued a PR which makes the hard-coded lib name suffix optional/configurable.

jay added a commit to jay/curl that referenced this pull request Jul 19, 2021
- Support both nghttp2.lib and nghttp2_static.lib for static nghttp2.

nghttp2 briefly changed its static lib name to nghttp2_static, but then
made the _static suffix optional.

Ref: nghttp2/nghttp2#1394
Ref: nghttp2/nghttp2#1418
Ref: nghttp2/nghttp2#1466

Reported-by: Pierre Yager

Fixes curl#7446
Closes #xxxx
jay added a commit to curl/curl that referenced this pull request Jul 20, 2021
- Support both nghttp2.lib and nghttp2_static.lib for static nghttp2.

nghttp2 briefly changed its static lib name to nghttp2_static, but then
made the _static suffix optional.

Ref: nghttp2/nghttp2#1394
Ref: nghttp2/nghttp2#1418
Ref: nghttp2/nghttp2#1466

Reported-by: Pierre Yager

Fixes #7446
Closes #7447
openvela-robot pushed a commit to open-vela/external_nghttp2 that referenced this pull request Jul 23, 2025
It can be set via the `STATIC_LIB_SUFFIX` variable.

This fixes every existing dependent project that relied on the name
having no suffix and thus capable of using either a static or shared
flavour depending on which one is present on this or how the linker
is configured.

Ref: nghttp2/nghttp2#1394
liujinye-sys pushed a commit to open-vela/external_nghttp2 that referenced this pull request Dec 16, 2025
It can be set via the `STATIC_LIB_SUFFIX` variable.

This fixes every existing dependent project that relied on the name
having no suffix and thus capable of using either a static or shared
flavour depending on which one is present on this or how the linker
is configured.

Ref: nghttp2/nghttp2#1394
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