Skip to content

CXX-3290 fix static pkgconfig requirements #1406

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kevinAlbs
Copy link
Collaborator

@kevinAlbs kevinAlbs commented May 19, 2025

Restore behavior consistent with r4.0.0. The static bsoncxx / mongocxx pkgconfig file depends on the static bson / mongoc pkg-config files:

In r4.0.0:

# In libbsoncxx-static.pc:
Version: 4.0.0
Requires: libbson-static-1.0 >= 1.29.0

In r4.1.0 (before this fix):

# In libbsoncxx-static.pc:
Version: 4.1.0
Requires: bson2 >= 2.0.0

Related: This PR does not try to resolve a discovered pre-existing issue CXX-3293 (BUILD_SHARED_LIBS_WITH_STATIC_MONGOC appears to incorrectly apply to static libraries, and is not accounted for in pkg-config files).

kevinAlbs added 3 commits May 19, 2025 13:36
Restore behavior prior to 4.1.0: Have static libbsoncxx depend on static (not shared) libbson. Have static libmongocxx depend on static (not shared) libmongoc.
@kevinAlbs kevinAlbs marked this pull request as ready for review May 19, 2025 19:32
@kevinAlbs kevinAlbs requested a review from a team as a code owner May 19, 2025 19:32
Comment on lines 20 to 25
(pkg-config --print-requires libmongocxx-static | grep -- mongoc2-static || (
(
echo "Expected mongoc2-static to be required" >&2
exit 1
)
))
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
(pkg-config --print-requires libmongocxx-static | grep -- mongoc2-static || (
(
echo "Expected mongoc2-static to be required" >&2
exit 1
)
))
if ! pkg-config --print-requires libmongocxx-static | grep -q "mongoc2-static"; then
echo "Expected mongoc2-static to be required" >&2
exit 1
fi

Lot of subshells; this can be reduced to a straightforward conditional.

Use -q to silence grep matches + per grep manpages:

If no FILE is given [...] nonrecursive searches read standard input.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you for the suggestion. Updated.

@kevinAlbs kevinAlbs requested a review from eramongodb May 19, 2025 20:01
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.

2 participants