Skip to content

CXX-2749 Fix debian-package-build-mnmlstc #1036

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

Merged
merged 4 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .evergreen/debian_package_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ if [ "${IS_PATCH}" = "true" ]; then
fi
if [ "${DEB_BUILD_PROFILES#*pkg.mongo-cxx-driver.mnmlstc}" != "${DEB_BUILD_PROFILES}" ]; then
MNMLSTC_DEPS="git ca-certificates"
MNMLSTC_INCLUDE="-I/usr/include/bsoncxx/v_noabi/bsoncxx/third_party/mnmlstc "
fi


Expand All @@ -66,10 +67,10 @@ sudo DEB_BUILD_PROFILES="${DEB_BUILD_PROFILES}" chroot ./unstable-chroot /bin/ba
LANG=C /bin/bash -x ./debian/build_snapshot.sh && \
debc ../*.changes && \
dpkg -i ../*.deb && \
/usr/bin/g++ -I/usr/include/bsoncxx/v_noabi -I/usr/include/mongocxx/v_noabi -o runcommand_examples examples/mongocxx/mongodb.com/runcommand_examples.cpp -lmongocxx -lbsoncxx && \
/usr/bin/g++ -I/usr/include/bsoncxx/v_noabi -I/usr/include/mongocxx/v_noabi -o aggregation_examples examples/mongocxx/mongodb.com/aggregation_examples.cpp -lmongocxx -lbsoncxx && \
/usr/bin/g++ -I/usr/include/bsoncxx/v_noabi -I/usr/include/mongocxx/v_noabi -o index_examples examples/mongocxx/mongodb.com/index_examples.cpp -lmongocxx -lbsoncxx && \
/usr/bin/g++ -I/usr/include/bsoncxx/v_noabi -I/usr/include/mongocxx/v_noabi -o documentation_examples examples/mongocxx/mongodb.com/documentation_examples.cpp -lmongocxx -lbsoncxx )"
/usr/bin/g++ ${MNMLSTC_INCLUDE:-}-I/usr/include/bsoncxx/v_noabi -I/usr/include/mongocxx/v_noabi -o runcommand_examples examples/mongocxx/mongodb.com/runcommand_examples.cpp -lmongocxx -lbsoncxx && \
/usr/bin/g++ ${MNMLSTC_INCLUDE:-}-I/usr/include/bsoncxx/v_noabi -I/usr/include/mongocxx/v_noabi -o aggregation_examples examples/mongocxx/mongodb.com/aggregation_examples.cpp -lmongocxx -lbsoncxx && \
/usr/bin/g++ ${MNMLSTC_INCLUDE:-}-I/usr/include/bsoncxx/v_noabi -I/usr/include/mongocxx/v_noabi -o index_examples examples/mongocxx/mongodb.com/index_examples.cpp -lmongocxx -lbsoncxx && \
/usr/bin/g++ ${MNMLSTC_INCLUDE:-}-I/usr/include/bsoncxx/v_noabi -I/usr/include/mongocxx/v_noabi -o documentation_examples examples/mongocxx/mongodb.com/documentation_examples.cpp -lmongocxx -lbsoncxx )"

[ -e ./unstable-chroot/tmp/mongo-cxx-driver/runcommand_examples ] || (echo "Example 'runcommand_examples' was not built!" ; exit 1)
[ -e ./unstable-chroot/tmp/mongo-cxx-driver/aggregation_examples ] || (echo "Example 'aggregation_examples' was not built!" ; exit 1)
Expand Down
11 changes: 1 addition & 10 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ifneq (,$(filter pkg.mongo-cxx-driver.mnmlstc,$(DEB_BUILD_PROFILES)))
dh_auto_configure -B$(CURDIR)/build -- \
-DBUILD_VERSION=$(DEB_VERSION_UPSTREAM) \
-DBSONCXX_POLY_USE_MNMLSTC=1 \
-DFETCHCONTENT_FULLY_DISCONNECTED=OFF \
-DENABLE_UNINSTALL=OFF
else
dh_auto_configure -B$(CURDIR)/build -- \
Expand All @@ -35,22 +36,12 @@ else
endif

override_dh_auto_build:
ifneq (,$(filter pkg.mongo-cxx-driver.mnmlstc,$(DEB_BUILD_PROFILES)))
dh_auto_build -B$(CURDIR)/build -- all doxygen-current DESTDIR=$(CURDIR)/debian/tmp-mnmlstc
else
dh_auto_build -B$(CURDIR)/build -- all doxygen-current
endif

override_dh_auto_install:
dh_auto_install -B$(CURDIR)/build
find $(CURDIR)/debian/tmp -type d -empty -delete
rm -f $(CURDIR)/debian/tmp/usr/share/mongo-cxx-driver/LICENSE
ifneq (,$(filter pkg.mongo-cxx-driver.mnmlstc,$(DEB_BUILD_PROFILES)))
# Drop MNMLSTC headers in a location where dh_install will pick them up
mv $(CURDIR)/debian/tmp-mnmlstc/usr/include/bsoncxx/v_noabi/bsoncxx/third_party \
$(CURDIR)/debian/tmp/usr/include/bsoncxx/v_noabi/bsoncxx/
rm -rf $(CURDIR)/debian/tmp-mnmlstc
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also remove DESTDIR=$(CURDIR)/debian/tmp-mnmlstc in override_dh_auto_build since MNMLSTIC is no longer installed during build step?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ooh, I missed that. I agree that it should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Verified by this patch.

endif

override_dh_auto_test:
# do nothing
Expand Down