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

comment handling not working as in modules 3 #402

Closed
wenzler opened this issue Jun 8, 2021 · 5 comments
Closed

comment handling not working as in modules 3 #402

wenzler opened this issue Jun 8, 2021 · 5 comments

Comments

@wenzler
Copy link

wenzler commented Jun 8, 2021

Describe the bug

Comments are not supported like they were in modules 3

To Reproduce

Steps to reproduce the behavior:

Have module with something like
setenv foo bar # comment

Expected behavior

No error

Error and debugging information

Module ERROR: wrong # args: should be "setenv var val"
      invoked from within
  "setenv          MGC_BIN         $mgc_home/bin                   #comment"
...

Additional context

Tested with modules 4.5.2 and 4.7.1

@wenzler wenzler added the bug label Jun 8, 2021
@xdelaruelle
Copy link
Member

Could you provide the full content of the modulefile to reproduce the issue?

@wenzler
Copy link
Author

wenzler commented Jun 8, 2021

This is just a minor incompatibility and should be mentioned as its probably just working by accident on v3

#%Module1.0
setenv foo "bar" #comment
prepend-path PATH ENV(foo)

@xdelaruelle
Copy link
Member

Same behavior is obtained with bare Tcl script:

$ cat test.tcl
set var val #comment
$ tclsh test.tcl
wrong # args: should be "set varName ?newValue?"
    while executing
"set var val #comment"
    (file "test.tcl" line 1)

The Tcl community recommends using ;# for inline comment.

Modules since version 4.0 evaluates full modulefile script as a Tcl script. Specific modulefile read and evaluation was performed previously (on Modules 3.2), which must explain why the error were not obtained on old version of Modules.

@wenzler
Copy link
Author

wenzler commented Jun 8, 2021

Yeah, as said - not really a bug but a v3 feature :)

@xdelaruelle
Copy link
Member

Now I better understand why it is working on version 3.2: on this version the setenv modulefile command accepts any number of argument. All arguments after the second one are ignored but they do not raise an error.

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