Skip to content

buildenv EasyBlock incorrectly sets PATH on --module-only and crashes on --sanity-check-only #4040

Description

@Thyre

See #4037 (comment) and #4037 (comment)

A --module-only rebuild sets:

  >> generating module file @ /data/EasyBuild-develop/modules/all/MPI/GCC/14.3.0/OpenMPI/5.0.8/buildenv/default.lua
== comparing module file with backup /data/EasyBuild-develop/modules/all/MPI/GCC/14.3.0/OpenMPI/5.0.8/buildenv/default.bak_20260112165059_1226463; diff is:
--- /data/EasyBuild-develop/modules/all/MPI/GCC/14.3.0/OpenMPI/5.0.8/buildenv/default.bak_20260112165059_1226463
+++ /data/EasyBuild-develop/modules/all/MPI/GCC/14.3.0/OpenMPI/5.0.8/buildenv/default.lua
@@ -31,12 +31,12 @@
 depends_on("ScaLAPACK/2.2.2-fb")

 prepend_path("CMAKE_PREFIX_PATH", root)
-prepend_path("PATH", "/data/EasyBuild-develop/software/buildenv/default-foss-2025b/bin/rpath_wrappers/gcc_wrapper")
-prepend_path("PATH", "/data/EasyBuild-develop/software/buildenv/default-foss-2025b/bin/rpath_wrappers/ld.gold_wrapper")
-prepend_path("PATH", "/data/EasyBuild-develop/software/buildenv/default-foss-2025b/bin/rpath_wrappers/gxx_wrapper")
-prepend_path("PATH", "/data/EasyBuild-develop/software/buildenv/default-foss-2025b/bin/rpath_wrappers/ld.bfd_wrapper")
-prepend_path("PATH", "/data/EasyBuild-develop/software/buildenv/default-foss-2025b/bin/rpath_wrappers/ld_wrapper")
-prepend_path("PATH", "/data/EasyBuild-develop/software/buildenv/default-foss-2025b/bin/rpath_wrappers/gfortran_wrapper")
+prepend_path("PATH", "/data/EasyBuild-develop/build/buildenv/default/foss-2025b/rpath_wrappers/gcc_wrapper")
+prepend_path("PATH", "/data/EasyBuild-develop/build/buildenv/default/foss-2025b/rpath_wrappers/ld.gold_wrapper")
+prepend_path("PATH", "/data/EasyBuild-develop/build/buildenv/default/foss-2025b/rpath_wrappers/gxx_wrapper")
+prepend_path("PATH", "/data/EasyBuild-develop/build/buildenv/default/foss-2025b/rpath_wrappers/ld.bfd_wrapper")
+prepend_path("PATH", "/data/EasyBuild-develop/build/buildenv/default/foss-2025b/rpath_wrappers/ld_wrapper")
+prepend_path("PATH", "/data/EasyBuild-develop/build/buildenv/default/foss-2025b/rpath_wrappers/gfortran_wrapper")

i.e. uses the build directory instead of the installation directory.

With --sanity-check-only, the build instead crashes entirely, even after re-building without --module-only:

EasyBuild crashed! Please consider reporting a bug, this should not happen...

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/data/EasyBuild/lib/python3.14/site-packages/easybuild/main.py", line 861, in <module>
    main_with_hooks()
    ~~~~~~~~~~~~~~~^^
  File "/data/EasyBuild/lib/python3.14/site-packages/easybuild/main.py", line 846, in main_with_hooks
    exit_code: EasyBuildExit = main(args=args, prepared_cfg_data=(init_session_state, eb_go, cfg_settings))
                               ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/EasyBuild/lib/python3.14/site-packages/easybuild/main.py", line 797, in main
    is_successful = process_eb_args(orig_paths, eb_go, cfg_settings, modtool, testing, init_session_state,
                                    hooks, do_build)
  File "/data/EasyBuild/lib/python3.14/site-packages/easybuild/main.py", line 613, in process_eb_args
    ecs_with_res = build_and_install_software(
        ordered_ecs, init_session_state, exit_on_failure=exit_on_failure, testing=testing)
  File "/data/EasyBuild/lib/python3.14/site-packages/easybuild/main.py", line 226, in build_and_install_software
    raise error
  File "/data/EasyBuild/lib/python3.14/site-packages/easybuild/main.py", line 180, in build_and_install_software
    (ec_res['success'], app_log, err_msg, err_code) = build_and_install_one(ec, init_env)
                                                      ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/data/EasyBuild/lib/python3.14/site-packages/easybuild/framework/easyblock.py", line 5109, in build_and_install_one
    result = app.run_all_steps(run_test_cases=run_test_cases)
  File "/data/EasyBuild/lib/python3.14/site-packages/easybuild/framework/easyblock.py", line 4922, in run_all_steps
    self.run_step(step_name, step_methods)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/EasyBuild/lib/python3.14/site-packages/easybuild/framework/easyblock.py", line 4763, in run_step
    current_method()
    ~~~~~~~~~~~~~~^^
  File "/data/EasyBuild/lib/python3.14/site-packages/easybuild/easyblocks/generic/bundle.py", line 478, in sanity_check_step
    fake_mod_data = self.load_fake_module(purge=True)
  File "/data/EasyBuild/lib/python3.14/site-packages/easybuild/framework/easyblock.py", line 1902, in load_fake_module
    fake_mod_path = self.make_module_step(fake=True)
  File "/data/EasyBuild/lib/python3.14/site-packages/easybuild/easyblocks/generic/buildenv.py", line 119, in make_module_step
    wrappers_dir = os.path.join(self.rpath_wrappers_dir, RPATH_WRAPPERS_SUBDIR)
  File "<frozen posixpath>", line 77, in join
TypeError: expected str, bytes or os.PathLike object, not NoneType

To reproduce:

eb --rebuild buildenv-default-foss-2025b.eb
eb --rebuild buildenv-default-foss-2025b.eb --module-only
eb --rebuild buildenv-default-foss-2025b.eb
eb --rebuild buildenv-default-foss-2025b.eb --sanity-check-only

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions