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

Building outside a git repo #81

Closed
aidanheerdegen opened this issue Aug 4, 2023 · 1 comment · Fixed by #82
Closed

Building outside a git repo #81

aidanheerdegen opened this issue Aug 4, 2023 · 1 comment · Fixed by #82
Assignees

Comments

@aidanheerdegen
Copy link
Contributor

libaccessom2 has to build inside a git repository to create a git hash for versioning

libaccessom2/CMakeLists.txt

Lines 120 to 125 in d750b4b

execute_process(
COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)

This is the same for MOM5 mom-ocean/MOM5#308, which this PR is changing mom-ocean/MOM5#384

For the same reasons as MOM5 it would be good to have the option of build libaccessom2 without needing to be in a git repo.

@aidanheerdegen aidanheerdegen self-assigned this Aug 4, 2023
@aidanheerdegen
Copy link
Contributor Author

Tested this, and it does build ok outside a git repo, but it will emit an error from git and then set GIT_COMMIT_HASH to an empty string.

Best to fix anyway to make behaviour explicit and not emit errors which can be confusing.

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 a pull request may close this issue.

1 participant