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

support version built from latest repo source code #486

Closed
Passw opened this issue Mar 3, 2023 · 3 comments
Closed

support version built from latest repo source code #486

Passw opened this issue Mar 3, 2023 · 3 comments
Labels
Milestone

Comments

@Passw
Copy link

Passw commented Mar 3, 2023

I compiled modules from the latest main branch source code.

When load the modulefiles, it pops out error:

Module ERROR: Modulefile requires at least Modules version 5.0
  In '/INSTALL/Modules/etc/initrc'
  Please contact <root@localhost>
module --version
Modules Release  (2023-02-27)

Could we add version flag like latest or repo to meet the version checking, when using the latest repo source code module to load modulefiles ?

@xdelaruelle
Copy link
Member

Could you describe how modules is retrieved, compiled then installed.

Version number seems empty on your setup, which causes the Module ERROR.

On such setup, version number should be equal to 5.2.0+xxxxx

@Passw
Copy link
Author

Passw commented Mar 4, 2023

Thanks for your reply.

I have found the root cause:
To generate correct version.inc, we need full git commits tree.

At first, I just get one commit from only main branch as below

  • git clone --depth 1 --branch main git@github.com:cea-hpc/modules.git
  • cat version.inc
# Release definitions shared across the Makefiles of this project
# run make to generate version.inc

MODULES_RELEASE := 5.2.0
MODULES_BUILD_HASH := $Format:%h$
MODULES_BUILD_REFS := $Format:%D$
MODULES_BUILD_FDATE := $Format:%ci$
MODULES_BUILD :=
MODULES_BUILD_DATE := 2023-02-27

If we get full commits via

  • git clone git@github.com:cea-hpc/modules.git

  • cat version.inc

# Release definitions shared across the Makefiles of this project
# run make to generate version.inc

MODULES_RELEASE := 5.2.0
MODULES_BUILD_HASH := $Format:%h$
MODULES_BUILD_REFS := $Format:%D$
MODULES_BUILD_FDATE := $Format:%ci$
MODULES_BUILD := +95-g4bf77a0e
MODULES_BUILD_DATE := 2023-02-27

We can put notes at README.md file and do some improvements to avoid this.

About MODULES_BUILD_DATE := 2023-02-27, the value is actually not BUILD_DATE, it is the date of the last commit.
We can get correct value for MODULES_BUILD_DATE with date +%F
And add a new macro MODULES_LAST_COMMIT_DATE := 2023-02-27.

@xdelaruelle
Copy link
Member

Regarding MODULES_BUILD_DATE, BUILD is referring to the code modification in the repository, not the assembly process.

I will look at how to compute a MODULES_BUILD string even when only the last commit is checked out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants