-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#! /bin/bash | ||
|
||
# Check the 'cargo metadata' for various requirements | ||
|
||
set -e | ||
|
||
META=$(mktemp) | ||
trap 'rm -rf -- "${META}"' EXIT | ||
|
||
cargo metadata --locked --format-version 1 > "${META}" | ||
|
||
get_version() { | ||
local package="${1}" | ||
jq -r '.packages[] | select(.name == "'"${package}"'") | .version' "${META}" | ||
} | ||
|
||
get_msrv() { | ||
local package="${1}" | ||
jq -r '.packages[] | select(.name == "'"${package}"'") | .rust_version' "${META}" | ||
} | ||
|
||
# check that the cxx packages all have the same version | ||
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") | ||
local cxxbridge_flags_version=$(get_version "cxxbridge-flags") | ||
local cxxbridge_macro_version=$(get_version "cxxbridge-macro") | ||
|
||
ok=true | ||
echo "Found cxx version ${cxx_version}" | ||
if [ "${cxx_version}" != "${cxx_build_version}" ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is already enforced by https://github.com/dtolnay/cxx/blob/1.0.124/Cargo.toml#L34. |
||
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 | ||
Comment on lines
+36
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! I added #3714 to try this. |
||
if [ "${cxx_version}" != "${cxxbridge_flags_version}" ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is already enforced by https://github.com/dtolnay/cxx/blob/1.0.124/Cargo.toml#L31. |
||
echo "Found differing cxxbridge-flags version ${cxxbridge_flags_version}" | ||
ok = false | ||
fi | ||
if [ "${cxx_version}" != "${cxxbridge_macro_version}" ]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is already enforced by https://github.com/dtolnay/cxx/blob/1.0.124/Cargo.toml#L26. |
||
echo "Found differing cxxbridge-macro version ${cxxbridge_macro_version}" | ||
ok = false | ||
fi | ||
|
||
if ! $ok; then | ||
echo "All cxx packages must be at the same version. Fix this in src/taskchampion-cpp/Cargo.toml." | ||
exit 1 | ||
else | ||
echo "✓ All cxx packages are at the same version." | ||
fi | ||
} | ||
|
||
check_msrv() { | ||
local taskchampion_msrv=$(get_msrv taskchampion) | ||
local taskchampion_lib_msrv=$(get_msrv taskchampion-lib) | ||
|
||
echo "Found taskchampion MSRV ${taskchampion_msrv}" | ||
echo "Found taskchampion-lib MSRV ${taskchampion_lib_msrv}" | ||
|
||
if [ "${taskchampion_msrv}" != "${taskchampion_lib_msrv}" ]; then | ||
echo "Those MSRVs should be the same (or taskchampion-lib should be greater, in which case adjust this script)" | ||
exit 1 | ||
else | ||
echo "✓ MSRVs are at the same version." | ||
fi | ||
} | ||
|
||
check_cxx_versions | ||
check_msrv |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦🏼