Skip to content

[CDRIVER-4640] Remove the Release Archive #1333

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

Conversation

vector-of-bool
Copy link
Contributor

@vector-of-bool vector-of-bool commented Jun 30, 2023

Refer: CDRIVER-4640

This changeset removes the release archive.

Background

The release archive was implemented as a source distribution method that contained only the relevant files to build the libraries and tests, as well as containing the built documentation.

Why Remove It?

It is currently unclear if any users are particularly dependent upon this exact release format, and if there is significant benefit over a regular snapshot of the repository at the release tag. Maintaining the source distribution required manually listing the constituent files, which led to a lot of redundancy and trivial CMakeLists.txt that only contained these file lists. Forgetting to add/remove items from the listings would result in CI failures upon push.

Notably, the enumerated file listing restricted the inclusion of any generated build results that were not strictly known ahead-of-time. For documentation, this was a problem as Sphinx would change its output with different theme updates. This led to us vendoring in a Sphinx theme that is still used several years later, and it's age is showing 😦.

It was decided that the additional complexity and build constraints are not worth it going forward, so this changeset removes the release archive tasks.

What's Here?

  • Most of this changeset is deletion of the file listings that had to be maintained.
  • Several CI tasks consumed the output source archive as their primary input. These tasks had to be modified to consume the repository directly.
    • These changes are found within the link-sample-... scripts, which now copy the source tree into their scratch space rather than expand an archive.
    • Because the dependency upon the make-release-archive task is gone, the link-... test tasks now queue much faster and will not bottleneck.
    • The **Release Archive Creator variant has been removed and replaced with a Smoke Tests variant, since that is what remains within it.
    • A new task make-docs is defined, which builds and uploads the generated documentation pages. (This was previously done as part of make-release-archive)
  • The release-compile tasks common across most variants no longer uses the release archive. The RELEASE environment variable is now used simply to disable debug assertions. We may be safe to remove this task as low-value?

mongo::detail::c_platform is intended to hold usage requirements common to all
libraries in the project. This will replace usage of directory-level
compile/link options, which do not propagate on the generated libraries when
they are installed.

This allows one to export/install libmongoc libraries that expose
additional usage requirements, such as linking instrumentation runtimes
(coverage, sanitizers, etc.)

Also: Sanitizers.cmake and ENABLE_COVERAGE now attach their options
to the platform-support library. This allows installed libmongoc with
sanitizers enabled to "just work," as downstream users will now receive
link options for coverage and sanitizers as usage requirements from the
libbson and libmongoc libraries.

Also: Enable threading on c_platform rather than linking. Fix the bson
and mongoc packages to pull Threads::Threads as a dependency

This also affects generated pkg-config files automatically.
This removes code that accumulates lists of sources to include in the
source dist, as well as the targets which generate it.
mongo::detail::c_platform is intended to hold usage requirements common to all
libraries in the project. This will replace usage of directory-level
compile/link options, which do not propagate on the generated libraries when
they are installed.

This allows one to export/install libmongoc libraries that expose
additional usage requirements, such as linking instrumentation runtimes
(coverage, sanitizers, etc.)

Also: Sanitizers.cmake and ENABLE_COVERAGE now attach their options
to the platform-support library. This allows installed libmongoc with
sanitizers enabled to "just work," as downstream users will now receive
link options for coverage and sanitizers as usage requirements from the
libbson and libmongoc libraries.

Also: Enable threading on c_platform rather than linking. Fix the bson
and mongoc packages to pull Threads::Threads as a dependency

This also affects generated pkg-config files automatically.
@vector-of-bool vector-of-bool force-pushed the CDRIVER-4640-no-source-dist.3 branch from 309a6f6 to be0222e Compare June 30, 2023 19:09
@vector-of-bool vector-of-bool marked this pull request as ready for review July 3, 2023 18:55
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

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

LGTM with additional comments addressed. The build simplification and removal of the CI bottleneck is much appreciated.


If this change is merged, I expect the C driver 1.25.0 will not release create/sign/upload a tarball. I suggest adding a note to the NEWS file for a new "Unreleased" section noting the removal of the tarball:

libmongoc 1.25.0 (Unreleased)
============================

* The release archive tarball is no longer created. Please instead use the snapshot tarball attached in GitHub for this release tag.

Remove the ## Creating and checking a distribution tarball section from CONTRIBUTING.md.


The RELEASE environment variable is now used simply to disable debug assertions. We may be safe to remove this task as low-value?

I incorrectly assumed those tasks were building with a release config (e.g. -DCMAKE_BUILD_TYPE=RelWithDebInfo). Though maybe that does not provide much value either. I support removing the compile-release tasks.

CMakeLists.txt Outdated
@@ -548,63 +554,7 @@ if (ENABLE_MONGOC)
set (PACKAGE_PREFIX "mongo-c-driver-${MONGOC_DIST_VERSION}")
set (DIST_FILE "${PACKAGE_PREFIX}.tar.gz")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
set (DIST_FILE "${PACKAGE_PREFIX}.tar.gz")

I suggest grepping this file for dist. Several comments and lines look no longer needed.

CMakeLists.txt Outdated
DEPENDS
${ALL_DIST} ${dist_generated_depends}
)

if (NOT USE_SYSTEM_LIBBSON AND ENABLE_MAN_PAGES STREQUAL ON AND ENABLE_HTML_DOCS STREQUAL ON)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove unneeded if and else.

Copy link
Contributor

@eramongodb eramongodb left a comment

Choose a reason for hiding this comment

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

Minor feedback; otherwise, LGTM.

Comment on lines 20 to 21
bash tools/poetry.sh run \
bash .evergreen/scripts/build-docs.sh
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
bash tools/poetry.sh run \
bash .evergreen/scripts/build-docs.sh
bash tools/poetry.sh run bash .evergreen/scripts/build-docs.sh

Avoids messy formatting in the generated config file.

@@ -171,7 +171,7 @@ def __init__(

super().__init__(
task_name=task_name,
depends_on=[OD([("name", "make-release-archive"), ("variant", "releng")])],
depends_on=[],
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
depends_on=[],

Now unused; simply remove?

@@ -76,6 +76,7 @@ def days(n: int) -> int:
# Disable the MongoDB legacy shell download, which is not available in 5.0 for u22
"SKIP_LEGACY_SHELL": "1"
},
tags=["merge-gate"],
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
tags=["merge-gate"],
tags=["pr-merge-gate"],

To make it clearer what "merge" is referring to.

SCRATCH_DIR=$(pwd)/.scratch
rm -rf "$SCRATCH_DIR"
mkdir -p "$SCRATCH_DIR"
cp -vr -- "$SRCROOT"/* "$SCRATCH_DIR"
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider using cmake -S . -B "$BUILD_DIR" and cmake --build "$BUILD_DIR" instead of copying the source root directory and running CMake commands with relative paths from inside $BUILD_DIR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was originally going to be overhauling many of these scripts, but had to abandon those changes as they are incredibly fragile, especially in assuming $PWD. Doing any slight "engoodening" of these scripts ends up cascading into a Gordian Knot. I decided to do the minimum-possible changes to get them working, but I hope to entirely replace them soon (with something hopefully faster and better as well).

Copy link
Contributor

@rcsanchez97 rcsanchez97 left a comment

Choose a reason for hiding this comment

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

The changes look good to me.

I don't think that this has been brought up yet, but remember that this change will also break release.py in the tools repo. That script uses make dist for generating the release artifacts. It will require updating, and that probably also means that the document which describes the release steps will require updating.

@vector-of-bool vector-of-bool merged commit 75db6e1 into mongodb:master Jul 18, 2023
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.

4 participants