Skip to content

'which' helper method not defined  #1095

@robertdfrench

Description

@robertdfrench

Hello!

Is anyone else getting complaints about the which helper not being defined in build_environment.py? I am getting this when trying to build anything with the latest develop (e41d67e) on Cray systems, but not on civilized systems.

Robert.French@gaea9 ~/Projects/spack $ spack install libpng %[email protected] arch=cray_xc-SuSE11-ivybridge
==> Installing libpng
==> zlib is already installed in /autofs/mnt/ncrc-svm1_home1/Robert.French/Projects/spack/opt/spack/cray_xc-SuSE11-ivybridge/gcc-4.3.4/zlib-1.2.8-jblztzcconqyhj6bigfz4bh453zrjgoz
Traceback (most recent call last):
  File "/autofs/mnt/ncrc-svm1_home1/Robert.French/Projects/spack/bin/spack", line 179, in <module>
    main()
  File "/autofs/mnt/ncrc-svm1_home1/Robert.French/Projects/spack/bin/spack", line 157, in main
    return_val = command(parser, args)
  File "/autofs/mnt/ncrc-svm1_home1/Robert.French/Projects/spack/lib/spack/spack/cmd/install.py", line 82, in install
    explicit=True)
  File "/autofs/mnt/ncrc-svm1_home1/Robert.French/Projects/spack/lib/spack/spack/package.py", line 997, in do_install
    spack.build_environment.fork(self, build_process)
  File "/autofs/mnt/ncrc-svm1_home1/Robert.French/Projects/spack/lib/spack/spack/build_environment.py", line 491, in fork
    setup_package(pkg)
  File "/autofs/mnt/ncrc-svm1_home1/Robert.French/Projects/spack/lib/spack/spack/build_environment.py", line 431, in setup_package
    set_build_environment_variables(pkg, spack_env)
  File "/autofs/mnt/ncrc-svm1_home1/Robert.French/Projects/spack/lib/spack/spack/build_environment.py", line 292, in set_build_environment_variables
    load_module(pkg.spec.architecture.target.module_name)
  File "/autofs/mnt/ncrc-svm1_home1/Robert.French/Projects/spack/lib/spack/spack/build_environment.py", line 123, in load_module
    modulecmd = which('modulecmd')
NameError: name 'which' is not defined
==> Error: Installation process had nonzero exit code : 256

It looks like build_environment.py:123 definitely invokes which without first importing it from spack.util.executable. I reckon this route through the code only gets used on Crays?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions