Skip to content

CXX-2832 Restore VERSION_CURRENT in release tarball #1092

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 6 commits into from
Feb 14, 2024

Conversation

kevinAlbs
Copy link
Collaborator

@kevinAlbs kevinAlbs commented Feb 13, 2024

Summary

Restore the VERSION_CURRENT file in the tarball produced by the dist target.

Background & Motivation

The 3.8.1 release tarball includes the file build/VERSION_CURRENT. The 3.9.0 release tarball (currently) does not include a build/VERSION_CURRENT file. This requires users to specify the version when building.

The missing VERSION_CURRENT file was discovered investigating CDRIVER-4834. It appears to be the result of changes in #1020.

Building the dist target on b133ac5 results in the VERSION_CURRENT file being omitted:

#!/usr/bin/env bash

# Clear build directory
rm -rf build/*
cd build

# Make dist tarball similar to the release process.
echo "3.9.0-pre" > VERSION_CURRENT
cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_PREFIX_PATH=/Users/kevin.albertson/code/c-bootstrap/install/mongo-c-driver-1.25.1 \
    -DENABLE_UNINSTALL=ON \
    ..
cmake --build . --target dist

# Untar dist tarball.
tar xf mongo-cxx-driver-r3.9.0-pre.tar.gz

# Check for VERSION_CURRENT
if [[ -f mongo-cxx-driver-r3.9.0-pre/build/VERSION_CURRENT ]]; then
    echo "VERSION_CURRENT found with contents $(cat mongo-cxx-driver-r3.9.0-pre/build/VERSION_CURRENT) Test passed"
else
    echo "VERSION_CURRENT not found. Test failed"
    exit 1
fi

# Test passes on 3.8.1. Test fails on commit b133ac58.

This PR changes the path to VERSION_CURRENT from absolute to relative to address this error:

make[3]: *** No rule to make target `Users/kevin.albertson/code/tasks/mongo-cxx-driver-restore-VERSION_CURRENT/build/VERSION_CURRENT', needed by `mongo-cxx-driver-r3.9.0-pre.tar.gz'.  Stop.`

The distcheck target has been updated to ensure VERSION_CURRENT is present.

Once this PR is merged, I plan to update the 3.9.0 release tarball to include the VERSION_CURRENT file.

@kevinAlbs kevinAlbs changed the title Restore VERSION_CURRENT in release tarball CXX-2832 Restore VERSION_CURRENT in release tarball Feb 13, 2024
@kevinAlbs kevinAlbs marked this pull request as ready for review February 13, 2024 17:46
@kevinAlbs kevinAlbs requested a review from eramongodb February 13, 2024 17:46
Copy link
Collaborator Author

@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.

Filed CXX-2834 to propose including a VERSION_CURRENT file in the source. That may help prevent the possibility of building a tarball without a VERSION_CURRENT file.

@kevinAlbs kevinAlbs requested a review from eramongodb February 14, 2024 16:41
@kevinAlbs
Copy link
Collaborator Author

Tarball on https://github.com/mongodb/mongo-cxx-driver/releases/tag/r3.9.0 has been updated.

@kevinAlbs kevinAlbs merged commit 775b978 into mongodb:master Feb 14, 2024
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