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

Log module command cookbook breaks modules initialization #453

Closed
eburgueno opened this issue Apr 28, 2022 · 2 comments
Closed

Log module command cookbook breaks modules initialization #453

eburgueno opened this issue Apr 28, 2022 · 2 comments
Labels
Milestone

Comments

@eburgueno
Copy link

Describe the bug

Log module command cookbook breaks modules initialization. Appears to be related to uasked. I suspect the root cause here is that cmdModuleSource does not include a uasked argument like cmdModuleLoad does.

To Reproduce

Steps to reproduce the behavior (this is a minimal example):

$ cat /software/EnvironmentModules/5.0.1/etc/siteconfig.tcl
# SITECONFIG.TCL, site-specific configuration script for Modules
#
# This Tcl script enables to supersede any global variable or procedure
# definition of modulecmd.tcl. See 'Modulecmd startup' section in module(1)
# manpage for detailed information.
##########################################################################
proc logTest {cmdstring code result op} {
  set mode [currentState mode]
  if { $mode eq {load} } {
    upvar 1 uasked uasked
    puts stderr "debug logTest: cmdstring=$cmdstring"
    puts stderr "debug logTest: mode=$mode"
    puts stderr "debug logTest: uasked=$uasked"
 }
}
trace add execution execute-modulefile leave logTest

$ source /software/EnvironmentModules/5.0.1/init/bash
debug logTest: cmdstring=execute-modulefile /software/EnvironmentModules/5.0.1/etc/initrc /software/EnvironmentModules/5.0.1/etc/initrc /software/EnvironmentModules/5.0.1/etc/initrc /software/EnvironmentModules/5.0.1/etc/initrc 0 0
debug logTest: mode=load
ERROR: 0
      while executing
  "execute-modulefile $absfpath $absfpath $absfpath $absfpath 0 0"
      (procedure "cmdModuleSource" line 10)
      invoked from within
  "cmdModuleSource load /software/EnvironmentModules/5.0.1/etc/initrc"
      (procedure "cmdModuleAutoinit" line 64)
      invoked from within
  "cmdModuleAutoinit"
      (procedure "module" line 333)
      invoked from within
  "{*}$execcmdlist"
  Please report this issue at https://github.com/cea-hpc/modules/issues

Expected behavior

uasked is set to whatever values identify that a modulefile is auto-loaded or not, or the cookbook provides a more explicit command name for trace than execute-modulefile.

@eburgueno eburgueno added the bug label Apr 28, 2022
@xdelaruelle xdelaruelle added this to the 5.1 milestone Apr 28, 2022
@xdelaruelle
Copy link
Member

Many thank for your report and analysis. I am fixing this right away.

@eburgueno
Copy link
Author

Thank you! I can confirm that fixes it :)

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