-
Notifications
You must be signed in to change notification settings - Fork 211
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
Provenance appears not to be handling relative paths correctly #4251
Comments
@jgfouca, are there any recent changes to CIME provenance (in E3SM) that might explain this? |
@xylar , I'm looking at the git log for this file and seeing only minimal changes in recent months. One significant thing that did happen was the CIME reorganization which moved many of the files around, but, looking at the implementation of _record_git_provenance:
... it doesn't look like anything should be sensitive to the location of the current source file. The error indicates that
to help us see what's going on? |
@jgfouca, sure, I can do that. It will be easiest to wait for LCRC to come back up, since that's where I was testing. |
@jgfouca, now that Chrysalis is back, I rad again. Here's what I'm seeing:
I assume this is obvious but the first |
Let me know if I can add more prints to help. It would also be helpful for me to know if there's a quicker way to reproduce this than rerunning the full test, since that takes about 20 minutes. |
Actually, looking at the code, I think what is missing is something to convert a relative path to an absolute path using the original |
config_src = os.path.join(srcroot, gitroot, "config") would seem to take care of this whether if not os.path.isabs(gitroot):
gitroot = os.path.abspath(os.path.join(srcroot, gitroot))
config_src = os.path.join(gitroot, "config") |
Indeed, that seems to fix the problem. @jgfouca, would you like me to make a PR? |
From the debug text
the output of
should be The above fix should be added but I think there might be a bigger issue with determining the correct |
@jasonb5, I don't think that's right. The code is correctly detecting that |
@xylar The E3SM |
Ah, I see. |
Yes, I think you're absolutely right. |
Fixes _find_gitroot for E3SM provenance The function _find_gitroot would error when trying to determine the models .git directory when being used as a submodule of another project. The error would occur when trying to copy a git metadata file for provenance whose path was relative to the git repository. This required two fixes, the first was to resolve the relative path and the second was handling a third scenario for determining the model's .git directory. Test suite: scripts_regression_tests Test baseline: n/a Test namelist changes: n/a Test status: n/a Fixes #4251 User interface changes?: n Update gh-pages html (Y/N)?: n
The compass software for testing MPAS-Ocean and MALI contains E3SM as a submodule. A common workflow is to create a worktree of compass and then to test from the E3SM submodule within the compass worktree.
Today, I encountered an error I have not previously seen with this workflow:
My hunch is that this relative path
../../compass/.git/config
is not being handled correctly because it is relative to the E3SM root rather than thecime/scripts
subdirectory where I am running./create_test
. But this is only a hunch.Steps to reproduce the problem on Chrysalis:
The text was updated successfully, but these errors were encountered: