Skip to content
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

Include cxxbridge-cmd in Cargo.lock, check version consistency #3712

Merged
merged 1 commit into from
Dec 1, 2024

Conversation

djmitche
Copy link
Collaborator

@djmitche djmitche commented Dec 1, 2024

This adds cxxbridge-cmd to Cargo.lock per dtolnay/cxx#1407 (comment), as linked from #3705.

It adds an MSRV to src/taskchampion-cpp/Cargo.toml so that the version of Cargo.lock is stil compatible with the MSRV.

It additionally adds a check of the Cargo metadata for all of the cxx* versions agreeing, and for the MSRVs agreeing.

cc: @doronbehar

@djmitche djmitche force-pushed the issue3705 branch 3 times, most recently from 1b55aad to 0451f7d Compare December 1, 2024 14:52
Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

Looks pretty good! Thanks for making the effort with that GitHub workflow.

Comment on lines 18 to 41
cxx_version=$(get_version "cxx")
cxx_build_version=$(get_version "cxx-build")
cxxbridge_cmd_version=$(get_version "cxx-build")
cxxbridge_flags_version=$(get_version "cxxbridge-flags")
cxxbridge_macro_version=$(get_version "cxxbridge-macro")

ok=true
echo "Found cxx version ${cxx_version}"
if [ "${cxx_version}" != "${cxx_build_version}" ]; then
echo "Found differing cxx-build version ${cxx_build_version}"
ok = false
fi
if [ "${cxx_version}" != "${cxxbridge_cmd_version}" ]; then
echo "Found differing cxxbridge-cmd version ${cxxbridge_cmd_version}"
ok = false
fi
if [ "${cxx_version}" != "${cxxbridge_flags_version}" ]; then
echo "Found differing cxxbridge-flags version ${cxxbridge_flags_version}"
ok = false
fi
if [ "${cxx_version}" != "${cxxbridge_macro_version}" ]; then
echo "Found differing cxxbridge-macro version ${cxxbridge_macro_version}"
ok = false
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

For loop?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Meh, maybe if we add more :)

@doronbehar
Copy link
Contributor

Haven't tested this locally yet.

This adds cxxbridge-cmd to Cargo.lock per
dtolnay/cxx#1407 (comment)

It adds an MSRV to `src/taskchampion-cpp/Cargo.toml` so that the
version of `Cargo.lock` is stil compatible with the MSRV.

It additionally adds a check of the Cargo metadata for all of the cxx*
versions agreeing, and for the MSRV's agreeing.
@djmitche djmitche enabled auto-merge (squash) December 1, 2024 15:14
@djmitche djmitche merged commit c2cb7f3 into GothenburgBitFactory:develop Dec 1, 2024
16 checks passed
Copy link
Contributor

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

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

Of the 4 cxx version checks in metadata-check.sh, the only 1 that matters is not implemented correctly. That one should be fixed and the other 3 should be removed.

check_cxx_versions() {
local cxx_version=$(get_version "cxx")
local cxx_build_version=$(get_version "cxx-build")
local cxxbridge_cmd_version=$(get_version "cxx-build")
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
local cxxbridge_cmd_version=$(get_version "cxx-build")
local cxxbridge_cmd_version=$(get_version "cxxbridge-cmd")

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

🤦🏼

echo "Found differing cxxbridge-flags version ${cxxbridge_flags_version}"
ok = false
fi
if [ "${cxx_version}" != "${cxxbridge_macro_version}" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

echo "Found differing cxxbridge-cmd version ${cxxbridge_cmd_version}"
ok = false
fi
if [ "${cxx_version}" != "${cxxbridge_flags_version}" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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


ok=true
echo "Found cxx version ${cxx_version}"
if [ "${cxx_version}" != "${cxx_build_version}" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment on lines +36 to +39
if [ "${cxx_version}" != "${cxxbridge_cmd_version}" ]; then
echo "Found differing cxxbridge-cmd version ${cxxbridge_cmd_version}"
ok = false
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

I published cxx 1.0.133 which automatically puts a correct version of cxxbridge-cmd into the lockfile of any crate that depends on cxx (dtolnay/cxx#1408). Could you try upgrading, reverting the taskchampion-cpp/Cargo.toml change from this PR, and see if cxxbridge-cmd stays in the lockfile? If so then this check can also be removed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! I added #3714 to try this.

djmitche added a commit to djmitche/taskwarrior that referenced this pull request Dec 1, 2024
Per
GothenburgBitFactory#3712 (review),
this version includes a cxxbridge-cmd dependency internally, so there's
no need to keep that within Taskwarrior, nor to check it in CI.
@djmitche djmitche mentioned this pull request Dec 1, 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.

3 participants