spack / spack

A flexible package manager that supports multiple versions, configurations, platforms, and compilers.
https://spack.io
Other
4.27k stars 2.26k forks source link

`'NoneType' object is not iterable` when using double-colon syntax in environment file #43019

Open giordano opened 7 months ago

giordano commented 7 months ago

Steps to reproduce

Consider the following Spack environment

spack:
  specs: [libtree]
  'config:': {}

Note that config:: is using the Spack extended YAML format to use a double-colon to override lower-precedence configurations. Try to install this environment

Error message

$ spack -e . install
==> Installing gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 [1/3]
==> No binary for gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 found: installing from source
==> Warning: Skipping build of gmake-4.4.1-7qo7twdzpl26g4jq7dhxhp3rnrgpn7f3 since gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 failed
==> Warning: Skipping build of libtree-3.1.1-43hx7yt4lgk4lqzjxfapv6ykvz3wb3tc since gmake-4.4.1-7qo7twdzpl26g4jq7dhxhp3rnrgpn7f3 failed
==> Error: Failed to install gcc-runtime due to TypeError: 'NoneType' object is not iterable
==> Error: libtree-3.1.1-43hx7yt4lgk4lqzjxfapv6ykvz3wb3tc: Package was not installed
==> Error: Installation request failed.  Refer to reported errors for failing package(s).
Output with debug information ```console $ spack -d -e . install ==> [2024-03-05-11:45:55.735506] Reading config from file /home/mose/repo/spack/etc/spack/defaults/config.yaml ==> [2024-03-05-11:45:55.776304] Reading config from file /home/mose/spack/test/spack.yaml ==> [2024-03-05-11:45:55.793370] Reading config from file /home/mose/repo/spack/etc/spack/defaults/config.yaml ==> [2024-03-05-11:45:55.808494] Reading config from file /home/mose/spack/test/spack.yaml ==> [2024-03-05-11:45:55.824990] Reading config from file /home/mose/repo/spack/etc/spack/defaults/config.yaml ==> [2024-03-05-11:45:55.840046] Reading config from file /home/mose/spack/test/spack.yaml ==> [2024-03-05-11:45:55.856290] Reading config from file /home/mose/repo/spack/etc/spack/defaults/config.yaml ==> [2024-03-05-11:45:55.871187] Using environment '/home/mose/spack/test' ==> [2024-03-05-11:45:55.874270] Imported install from built-in commands ==> [2024-03-05-11:45:55.875036] Imported install from built-in commands ==> [2024-03-05-11:45:55.891750] Reading config from file /home/mose/spack/test/spack.yaml ==> [2024-03-05-11:45:55.907563] Deactivated environment '/home/mose/spack/test' ==> [2024-03-05-11:45:55.907971] Reading config from file /home/mose/repo/spack/etc/spack/defaults/config.yaml ==> [2024-03-05-11:45:55.922856] Reading config from file /home/mose/spack/test/spack.yaml ==> [2024-03-05-11:45:55.939393] Reading config from file /home/mose/repo/spack/etc/spack/defaults/config.yaml ==> [2024-03-05-11:45:55.954232] Reading config from file /home/mose/spack/test/spack.yaml ==> [2024-03-05-11:45:55.970483] Reading config from file /home/mose/repo/spack/etc/spack/defaults/config.yaml ==> [2024-03-05-11:45:55.985342] Reading config from file /home/mose/spack/test/spack.yaml ==> [2024-03-05-11:45:56.001352] Reading config from file /home/mose/repo/spack/etc/spack/defaults/config.yaml ==> [2024-03-05-11:45:56.016047] Using environment '/home/mose/spack/test' ==> [2024-03-05-11:45:56.016251] Reading config from file /home/mose/repo/spack/etc/spack/defaults/concretizer.yaml ==> [2024-03-05-11:45:56.034904] '/usr/bin/git' '-C' '/home/mose/repo/spack' 'rev-parse' 'HEAD' ==> [2024-03-05-11:45:56.037656] Reading config from file /home/mose/repo/spack/etc/spack/defaults/repos.yaml ==> [2024-03-05-11:45:56.076441] Reading config from file /home/mose/repo/spack/etc/spack/defaults/packages.yaml ==> [2024-03-05-11:45:56.100610] DATABASE LOCK TIMEOUT: Nones ==> [2024-03-05-11:45:56.100648] PACKAGE LOCK TIMEOUT: No timeout ==> [2024-03-05-11:45:56.107156] Initializing the build queue from the build requests ==> [2024-03-05-11:45:56.107185] Initializing the build queue for libtree ==> [2024-03-05-11:45:56.107865] Pkg id gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 has the following dependents: ==> [2024-03-05-11:45:56.107888] - gmake-4.4.1-7qo7twdzpl26g4jq7dhxhp3rnrgpn7f3 ==> [2024-03-05-11:45:56.107903] - libtree-3.1.1-43hx7yt4lgk4lqzjxfapv6ykvz3wb3tc ==> [2024-03-05-11:45:56.112512] Requeueing a build task for gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 with status 'queued' ==> [2024-03-05-11:45:56.112691] Removing failure marking for gcc-runtime ==> [2024-03-05-11:45:56.113065] Pkg id gmake-4.4.1-7qo7twdzpl26g4jq7dhxhp3rnrgpn7f3 has the following dependents: ==> [2024-03-05-11:45:56.113089] - libtree-3.1.1-43hx7yt4lgk4lqzjxfapv6ykvz3wb3tc ==> [2024-03-05-11:45:56.113785] Requeueing a build task for gmake-4.4.1-7qo7twdzpl26g4jq7dhxhp3rnrgpn7f3 with status 'queued' ==> [2024-03-05-11:45:56.113933] Removing failure marking for gmake ==> [2024-03-05-11:45:56.114113] Removing failure marking for libtree ==> [2024-03-05-11:45:56.114186] Pkg id libtree-3.1.1-43hx7yt4lgk4lqzjxfapv6ykvz3wb3tc has the following dependents: ==> [2024-03-05-11:45:56.114904] Requeueing a build task for libtree-3.1.1-43hx7yt4lgk4lqzjxfapv6ykvz3wb3tc with status 'queued' ==> [2024-03-05-11:45:56.114931] Ensure all dependencies know all dependents across specs ==> [2024-03-05-11:45:56.114987] Processing gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7: task=priority=0, status=dequeued, start=0, #dependencies=0 ==> [2024-03-05-11:45:56.115259] Acquiring a write lock on gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 with timeout 1.000ns ==> [2024-03-05-11:45:56.115373] gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 is now write locked ==> [2024-03-05-11:45:56.194240] Installing gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 [1/3] ==> [2024-03-05-11:45:56.194306] Reading config from file /home/mose/repo/spack/etc/spack/defaults/mirrors.yaml ==> [2024-03-05-11:45:56.195897] No binary for gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 found: installing from source ==> [2024-03-05-11:45:56.196334] Creating the installation directory /home/mose/repo/spack/opt/spack/linux-ubuntu22.04-zen2/gcc-12.3.0/gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 ==> [2024-03-05-11:45:56.197271] '/usr/bin/git' '-C' '/home/mose/repo/spack' 'rev-parse' 'HEAD' ==> [2024-03-05-11:45:56.199697] Flagging gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 as failed: 'NoneType' object is not iterable ==> [2024-03-05-11:45:56.200213] Warning: Skipping build of gmake-4.4.1-7qo7twdzpl26g4jq7dhxhp3rnrgpn7f3 since gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 failed ==> [2024-03-05-11:45:56.200249] Flagging gmake-4.4.1-7qo7twdzpl26g4jq7dhxhp3rnrgpn7f3 as failed ==> [2024-03-05-11:45:56.200703] Warning: Skipping build of libtree-3.1.1-43hx7yt4lgk4lqzjxfapv6ykvz3wb3tc since gmake-4.4.1-7qo7twdzpl26g4jq7dhxhp3rnrgpn7f3 failed ==> [2024-03-05-11:45:56.200738] Flagging libtree-3.1.1-43hx7yt4lgk4lqzjxfapv6ykvz3wb3tc as failed ==> [2024-03-05-11:45:56.201258] Removing build task for libtree-3.1.1-43hx7yt4lgk4lqzjxfapv6ykvz3wb3tc from list ==> [2024-03-05-11:45:56.201293] Removing build task for gmake-4.4.1-7qo7twdzpl26g4jq7dhxhp3rnrgpn7f3 from list ==> [2024-03-05-11:45:56.201316] No build task for libtree-3.1.1-43hx7yt4lgk4lqzjxfapv6ykvz3wb3tc to skip since gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 failed ==> [2024-03-05-11:45:56.201344] Error: Failed to install gcc-runtime due to TypeError: 'NoneType' object is not iterable ==> [2024-03-05-11:45:56.202247] Downgrading to a read lock on gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 with timeout 1.000ns ==> [2024-03-05-11:45:56.202327] gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 is now read locked ==> [2024-03-05-11:45:56.202364] Releasing read lock on gcc-runtime-12.3.0-3ctewohxpnmklckthps4i7gugrwgloz7 ==> [2024-03-05-11:45:56.202504] Error: libtree-3.1.1-43hx7yt4lgk4lqzjxfapv6ykvz3wb3tc: Package was not installed ==> [2024-03-05-11:45:56.202538] Associating installation failure with first missing package (libtree-3.1.1-43hx7yt4lgk4lqzjxfapv6ykvz3wb3tc) from libtree-3.1.1-43hx7yt4lgk4lqzjxfapv6ykvz3wb3tc ==> [2024-03-05-11:45:56.220470] Reading config from file /home/mose/spack/test/spack.yaml ==> [2024-03-05-11:45:56.236453] Deactivated environment '/home/mose/spack/test' ==> [2024-03-05-11:45:56.236860] Reading config from file /home/mose/repo/spack/etc/spack/defaults/config.yaml ==> [2024-03-05-11:45:56.251888] Reading config from file /home/mose/spack/test/spack.yaml ==> [2024-03-05-11:45:56.268638] Reading config from file /home/mose/repo/spack/etc/spack/defaults/config.yaml ==> [2024-03-05-11:45:56.283755] Reading config from file /home/mose/spack/test/spack.yaml ==> [2024-03-05-11:45:56.315460] Reading config from file /home/mose/repo/spack/etc/spack/defaults/config.yaml ==> [2024-03-05-11:45:56.330818] Reading config from file /home/mose/spack/test/spack.yaml ==> [2024-03-05-11:45:56.347203] Reading config from file /home/mose/repo/spack/etc/spack/defaults/config.yaml ==> [2024-03-05-11:45:56.362269] Using environment '/home/mose/spack/test' ==> [2024-03-05-11:45:56.374467] '/usr/bin/git' '-C' '/home/mose/repo/spack' 'rev-parse' 'HEAD' ==> [2024-03-05-11:45:56.377134] DATABASE LOCK TIMEOUT: Nones ==> [2024-03-05-11:45:56.377187] PACKAGE LOCK TIMEOUT: No timeout ==> [2024-03-05-11:45:56.383049] View at /home/mose/spack/test/.spack-env/view does not need regeneration. ==> [2024-03-05-11:45:56.383114] InstallError: Installation request failed. Refer to reported errors for failing package(s). ==> [2024-03-05-11:45:56.383135] Error: Installation request failed. Refer to reported errors for failing package(s). Traceback (most recent call last): File "/home/mose/repo/spack/lib/spack/spack/main.py", line 1068, in main return _main(argv) File "/home/mose/repo/spack/lib/spack/spack/main.py", line 1021, in _main return finish_parse_and_run(parser, cmd_name, args, env_format_error) File "/home/mose/repo/spack/lib/spack/spack/main.py", line 1051, in finish_parse_and_run return _invoke_command(command, parser, args, unknown) File "/home/mose/repo/spack/lib/spack/spack/main.py", line 648, in _invoke_command return_val = command(parser, args) File "/home/mose/repo/spack/lib/spack/spack/cmd/install.py", line 355, in install install_with_active_env(env, args, install_kwargs, reporter_factory) File "/home/mose/repo/spack/lib/spack/spack/cmd/install.py", line 424, in install_with_active_env env.install_specs(specs_to_install, **install_kwargs) File "/home/mose/repo/spack/lib/spack/spack/environment/environment.py", line 1734, in install_specs PackageInstaller(installs).install() File "/home/mose/repo/spack/lib/spack/spack/installer.py", line 2249, in install raise InstallError( spack.installer.InstallError: Installation request failed. Refer to reported errors for failing package(s). ```

It's quite possible I misinterpreted the double-colon syntax, but the

'NoneType' object is not iterable

error message is rather obscure.

Information on your system

General information

alalazo commented 7 months ago

It's quite possible I misinterpreted the double-colon syntax,

I think it's more likely we don't have built-in defaults for some of the config options :slightly_smiling_face: