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

skip reinstillation of twoliter from source #3479

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

webern
Copy link
Contributor

@webern webern commented Sep 20, 2023

Issue number:

Closes #3478

Description of changes:

When we are testing changes to Twoliter, we need to install from git. In that case the sha is not going to match the version output from Twoliter --version. This means that we have to rebuild and install Twoliter each time we call cargo make. It takes 10 minutes to compile Twoliter.

Fix this such that TWOLITER_ALLOW_BINARY_INSTALL=false skips checking the version when any twoliter is installed.

Testing done:

Used this locally and it fixed the problem.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

When we are testing changes to Twoliter, we need to install from git. In
that case the sha is not going to match the version output from Twoliter
--version. This means that we have to rebuild and install Twoliter each
time we call cargo make. It takes 10 minutes to compile Twoliter.

Fix this such that TWOLITER_ALLOW_BINARY_INSTALL=false skips checking
the version when any `twoliter` is installed.
@webern webern requested a review from etungsten September 20, 2023 18:37
@webern webern merged commit e69961d into bottlerocket-os:develop Sep 20, 2023
@webern webern deleted the skip-install branch September 20, 2023 19:19
Comment on lines +113 to +115
if [ "${allow_bin}" != "true" ]; then
echo "Twoliter binary found and --allow-binary-install is false. Skipping install."
exit 0
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't agree with this change and would like to see it reverted.

The version check is pretty important as otherwise there's no guarantee that the build will happen with the pinned version rather than whatever happens to be present. This potentially affects the correctness of any build where the binary is not available and the source build must be used, which can happen for other reasons than a developer working locally on twoliter.

It might be better for the twoliter version to not include the Git SHA, or to allow the path to the binary to be overridden (e.g. to ~/twoliter/target/release/twoliter) and skip the version check if the override is set - with a loud warning that the override is preventing the version check.

Copy link
Contributor

Choose a reason for hiding this comment

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

In that case the sha is not going to match the version output from Twoliter --version.

❯ ./tools/twoliter/twoliter -V
twoliter 0.0.3

I don't understand what sha we are or aren't matching since twoliter -V doesn't print a SHA.

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.

twoliter reinstalls for every command when installing from git
4 participants