Skip to content

Align MANPATH handling in lmod.spec to preserve system man pages (#2070) #2105

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

Merged
merged 2 commits into from
Apr 28, 2025

Conversation

Amrithasuresh
Copy link
Contributor

Summary

This PR updates the lmod.spec file to align MANPATH handling

Changes

  • Initialize MANPATH if unset to system defaults
  • Use Lmod's 'addto' helper script to append Lmod man pages
  • Applied changes in both bash (lmod.sh) and csh (lmod.csh) profile scripts
  • Prevents module MANPATH overrides that hide system man pages (fixes manpath in modules #2070)

Related Issue

Fixes: #2070

Signed-off-by

Suresh Panneerselvam sureshcbt@gmail.com

@adrianreber
Copy link
Member

@Amrithasuresh If you look at the result of the CI runs there will be an RPM which you can test locally to see if your change works as expected.

@adrianreber
Copy link
Member

@mslacken

lmod fails to build on opensuse:

Problem: 1: the to be installed lmod-ohpc-8.7.53-27.ohpc.1.src requires 'apparmor-abstractions', but this requirement cannot be provided
not installable providers: apparmor-abstractions-3.0.4-150500.9.3.noarch[repo-oss]
                   apparmor-abstractions-3.0.4-150500.11.3.1.noarch[repo-sle-update]

I think this is related to your PR to fix things around apparmor. Any ides how this could be fixed?

Copy link

github-actions bot commented Apr 11, 2025

Test Results

 30 files   -  9  30 suites   - 9   37s ⏱️ -33s
 54 tests  - 21  50 ✅  - 21  4 💤 ±0  0 ❌ ±0 
102 runs   - 51  96 ✅  - 51  6 💤 ±0  0 ❌ ±0 

Results for commit 00a80bc. ± Comparison against base commit bf2f5cd.

This pull request removes 22 and adds 1 tests. Note that renamed tests count towards both.
rm_execution ‑ [libs/PHDF5] MPI C binary runs under resource manager (slurm/gnu14/mpich)
rm_execution ‑ [libs/PHDF5] MPI C binary runs under resource manager (slurm/gnu14/openmpi5)
rm_execution ‑ [libs/PHDF5] MPI C binary runs under resource manager (slurm/intel/mpich)
rm_execution ‑ [libs/PHDF5] MPI C binary runs under resource manager (slurm/intel/openmpi5)
rm_execution ‑ [libs/PHDF5] Parallel Fortran binary runs under resource manager (slurm/gnu14/mpich)
rm_execution ‑ [libs/PHDF5] Parallel Fortran binary runs under resource manager (slurm/gnu14/openmpi5)
rm_execution ‑ [libs/PHDF5] Parallel Fortran binary runs under resource manager (slurm/intel/mpich)
rm_execution ‑ [libs/PHDF5] Parallel Fortran binary runs under resource manager (slurm/intel/openmpi5)
test_module ‑ [HDF5] Verify HDF5 module is loaded and matches rpm version (gnu14)
test_module ‑ [HDF5] Verify HDF5 module is loaded and matches rpm version (intel)
…
lmod ‑ [lmod] test that the setup function passed

♻️ This comment has been updated with latest results.

@Amrithasuresh Amrithasuresh force-pushed the 3.x branch 2 times, most recently from 7f740a1 to 07efc5e Compare April 12, 2025 04:44
@adrianreber
Copy link
Member

@Amrithasuresh can you rebase this PR. The errors should be fixed.

@Amrithasuresh
Copy link
Contributor Author

Sure. Will do.

…em man pages

- Initialize MANPATH if unset to use system default paths
- Append Lmod's own man directory using upstream 'addto' helper script
- Prevents module MANPATH overrides that hide system man pages (fixes openhpc#2070)
- Applied changes in both bash (lmod.sh) and csh (lmod.csh) profile scripts

Signed-off-by: Suresh Panneerselvam <sureshcbt@gmail.com>
- Cleaned up MANPATH assignment in csh script as per review feedback

Signed-off-by: Suresh Panneerselvam <sureshcbt@gmail.com>
@adrianreber adrianreber merged commit dbdafdc into openhpc:3.x Apr 28, 2025
25 checks passed
@adrianreber
Copy link
Member

Thanks for fixing this. Merged.

@adrianreber
Copy link
Member

It required a fixup:

diff --git a/components/admin/lmod/SPECS/lmod.spec b/components/admin/lmod/SPECS/lmod.spec
index e3af2b423..a323a64b1 100644
--- a/components/admin/lmod/SPECS/lmod.spec
+++ b/components/admin/lmod/SPECS/lmod.spec
@@ -116,7 +116,7 @@ if [ -z "\${MANPATH:-}" ]; then
     export MANPATH=":"
 fi
 # Initialize MANPATH if unset, then safely append Lmod's man directory using addto helper
-export MANPATH=\$(${OHPC_ADMIN}/lmod/lmod/libexec/addto MANPATH ${OHPC_ADMIN}/lmod/lmod/share/man)
+export MANPATH=\$(%{OHPC_ADMIN}/lmod/lmod/libexec/addto MANPATH %{OHPC_ADMIN}/lmod/lmod/share/man)
 
 # Set BASH_ENV for environment
 export BASH_ENV=%{OHPC_ADMIN}/lmod/lmod/init/bash
@@ -162,7 +162,7 @@ if ( ! $?MANPATH ) then
     setenv MANPATH ":"
 endif
 # Initialize MANPATH if unset, then safely append Lmod's man directory using addto helper
-setenv MANPATH `${OHPC_ADMIN}/lmod/lmod/libexec/addto MANPATH ${OHPC_ADMIN}/lmod/lmod/share/man`
+setenv MANPATH `%{OHPC_ADMIN}/lmod/lmod/libexec/addto MANPATH %{OHPC_ADMIN}/lmod/lmod/share/man`
 
 # Initialize modules system
 source %{OHPC_ADMIN}/lmod/lmod/init/csh >/dev/null

There was a mixup between shell variables and RPM variables.

@Amrithasuresh
Copy link
Contributor Author

@adrianreber Thank you so much for the review and support!

I'm still a beginner in open-source contributions, but I would love to continue helping OpenHPC if possible. I have a few hours weekly. Please let me know if there are any small issues, tasks, or documentation areas where I could contribute.

@adrianreber
Copy link
Member

@adrianreber Thank you so much for the review and support!

I'm still a beginner in open-source contributions, but I would love to continue helping OpenHPC if possible. I have a few hours weekly. Please let me know if there are any small issues, tasks, or documentation areas where I could contribute.

Reach out on the OpenHPC slack to me and we can discuss possible things to do.

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 this pull request may close these issues.

manpath in modules
2 participants