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

Calculation of version hash suffix can be confused if headless reframe is run from within an irrelevant Git repo #3120

Open
vkarak opened this issue Feb 20, 2024 · 2 comments · Fixed by #3204
Assignees
Milestone

Comments

@vkarak
Copy link
Contributor

vkarak commented Feb 20, 2024

It's easy to reproduce:

  1. Install a dev ReFrame version with pip: pip3 install git+https://github.com/reframe-hpc/reframe.git@develop
  2. Go to a random locally cloned git repo and run reframe -V

You will see the hash of the local repo's HEAD being attached to reframe's version.

We should check that the reframe.INSTALL_PREFIX is indeed a Git repo before calling git rev-parse to get the hash:

wd = wd or reframe.INSTALL_PREFIX
with change_dir(wd):
# Do not log this command, since we need to call this function
# from the logger
completed = run_command(f'git rev-parse {commit}',
check=True, log=False)

@vkarak vkarak added this to the ReFrame 4.6 milestone Feb 20, 2024
@vkarak vkarak self-assigned this Feb 20, 2024
@vkarak vkarak added triage and removed bug labels Apr 13, 2024
@vkarak
Copy link
Contributor Author

vkarak commented Apr 13, 2024

Strange, I can't reproduce it. Back to triage.

I was trying with a stable version; you need a development version.

@vkarak vkarak modified the milestones: ReFrame 4.6, ReFrame 4.7 Apr 19, 2024
@vkarak vkarak added bug and removed triage labels May 23, 2024
@vkarak
Copy link
Contributor Author

vkarak commented May 23, 2024

Although we do change to the installation prefix, the problem arises if this prefix is inside another (unrelated) Git working tree at any level deep as git rev-parse will still find the working tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant