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

feat(ci): update cargo gen to 0.2.2 #34

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ashleygwilliams
Copy link
Member

@ashleygwilliams ashleygwilliams commented Dec 27, 2018

cargo generate 0.2.1 introduce a bug that broke the relative paths undoc'd feature that this repo was leveraging. 0.2.2 fixes that bug and makes relative paths an official feature. this PR should force travis to update cargo-gen to 0.2.2 and should fix the ci breakage we've seen since 0.2.1.

@ashleygwilliams
Copy link
Member Author

this is very interesting... passing on PR but not on push... have restarted the build to see. failing with "cannot find branch master" which is odd, since it's clearly being found in the PR test. will see!

@ashleygwilliams
Copy link
Member Author

ok, with the debug statements i think im' getting closer, if travis is using a shallow clone on the push test, it won't have branches which is why this will fail.

on push:

0.00s$ git status
HEAD detached at 8f80944
nothing to commit, working tree clean
The command "git status" exited with 0.
0.10s$ cargo generate --git . --name testing
 Creating project called `testing`...
error: failed to find branch `master`
caused by: cannot locate local branch 'master'; class=Reference (4); code=NotFound (-3)
The command "cargo generate --git . --name testing" exited with 1.

@ashleygwilliams
Copy link
Member Author

yup, detached head mode is what's biting us i believe: travis-ci/travis-ci#1701 (thanks to @drager for finding this!)

Copy link
Member

@fitzgen fitzgen 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 potential sticky point below (but we should just merge and see if we run into that problem, I suppose)

@@ -14,10 +14,13 @@ matrix:
chrome: stable
before_script:
- (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
- (test -x $HOME/.cargo/bin/cargo-generate || cargo install --vers "^0.2" cargo-generate)
- (test -x $HOME/.cargo/bin/cargo-generate || cargo install --vers "0.2.2" cargo-generate)
Copy link
Member

Choose a reason for hiding this comment

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

If we get a cached cargo-generate, and therefore don't execute the updated cargo install command here, whill cargo install-update -a bump minor versions of an installed tool? If not, we may need to do two pushes: one that doesn't use any chached tool to force an install of 0.2.2, and then another to re-enable the use of cached tools. I think I've been bitten by this before. Not sure what the best way to deal with this is going forward.

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