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

Don't define GIT_ environment variables if the work directory is out-of-sync #758

Merged
merged 1 commit into from
Feb 3, 2016

Conversation

stuarteberg
Copy link
Contributor

Before the package source is downloaded, variables like GIT_DESCRIBE_TAG can be given incorrect values if a previous build left a git repo in the source directory. It's not a huge problem, but it does produce incorrect status messages until the source is finally downloaded.

This PR fixes it by leaving those GIT_ variables undefined if the work directory doesn't correspond to the package being built.

@msarahan
Copy link
Contributor

msarahan commented Feb 3, 2016

Sorry, this looks like some Python 3 string issues at https://github.com/conda/conda-build/pull/758/files#diff-8cf4f5bfdd4544775a2f28ef5e24b2c5R59 . Otherwise OK, thanks for fixing.

… the current source directory has the correct git repo in it.
@stuarteberg
Copy link
Contributor Author

looks like some Python 3 string issues

Whoops, thanks. Fixed now.

d.update(**get_git_build_info(d['SRC_DIR']))
d.update(**get_git_build_info(d['SRC_DIR'],
m.get_value('source/git_url'),
m.get_value('source/git_rev', default='master')))
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to check for git_tag here, also?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was my first try, but it turns out git_rev is a synonym for git_tag, and it's the canonical spelling.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for pointing that out. I just want to make sure: this fix works for people who specify git_tag in their recipe, rather than git_rev?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right. git_tag and git_branch are copied into git_rev (and then deleted -- git_tag is empty at this point).

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the clarification. Merging.

Copy link
Member

Choose a reason for hiding this comment

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

Interesting, I saw the introduction of git_rev in the docs and was wondering what was going on. Will git_tag and git_branch then be deprecated and then removed at some point.

msarahan added a commit that referenced this pull request Feb 3, 2016
Don't define GIT_ environment variables if the work directory is out-of-sync
@msarahan msarahan merged commit 0491732 into conda:master Feb 3, 2016
stuarteberg referenced this pull request in groutr/conda-build Mar 3, 2016
@github-actions github-actions bot added the locked [bot] locked due to inactivity label May 18, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants