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

gsed not tested for in configure script, build not failing if it doesn't exist #742

Open
haampie opened this issue Jan 7, 2025 · 1 comment

Comments

@haampie
Copy link

haampie commented Jan 7, 2025

Describe the bug

When building lmod on macOS, the build succeeds, but all init scripts are empty, so the installation is entirely broken:

% wc -l $(find lmod/lmod/init -type f -maxdepth 1)
       0 lmod/lmod/init/lisp
       0 lmod/lmod/init/csh
       0 lmod/lmod/init/cmake
       0 lmod/lmod/init/perl
       0 lmod/lmod/init/R
       0 lmod/lmod/init/cshrc
       0 lmod/lmod/init/env_modules_ruby.rb
       0 lmod/lmod/init/env_modules_python.py
       0 lmod/lmod/init/bash
       0 lmod/lmod/init/profile.fish
       0 lmod/lmod/init/sh
       0 lmod/lmod/init/profile
       0 lmod/lmod/init/lmod_bash_completions
       0 lmod/lmod/init/tcsh
       0 lmod/lmod/init/profile.rc
       0 lmod/lmod/init/lmodrc.lua
       0 lmod/lmod/init/ksh
       0 lmod/lmod/init/zsh
       0 lmod/lmod/init/rc
       0 lmod/lmod/init/fish
       0 total

This is because the build system assumes gsed exists without testing for it in configure, and your shell scripts using sed do not fail if the command errors.

Notice that the sed build system does not install a gsed executable on macOS. The gsed symlink is something specific to homebrew. So you should not assume gsed exists.

To Reproduce

% brew uninstall gsed
% <build lmod>

Expected behavior

  1. Preferably just use portable sed commands.
  2. Error out when a sed command fails during the build.

If you really can't use portable sed commands, then please:

  1. Test whether sed works for your types of replacements in the configure script
  2. Allow users to specify what sed command to use in configure. Basically I wanna avoid that if I specify a dependency on sed in my package manager, the lmod build will insist on gsed which doesn't exist on my macbook, cause my gnu sed executable is just called sed.

Desktop (please complete the following information):

  • OS: macOS
  • Lmod Version: 8.7.55
@rtmclay
Copy link
Member

rtmclay commented Jan 10, 2025

I have switched to use the dump-down version of sed on macOS. Please test the IS742-gsed branch to see if it works for you. Thanks for reporting this issue.

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

No branches or pull requests

2 participants