Skip to content

Setting cxxflags="stdlib=libc++" results in Error: {'stdlib=libc++'} does not equal set() after #34218 #34370

@msimberg

Description

@msimberg

Steps to reproduce

The cxxflags variant doesn't seem to accept certain types of flags:

> spack spec cmake cxxflags="-stdlib=libc++"
==> Error: {'-stdlib=libc++'} does not equal set()

Curiously, e.g.

> spack spec cmake cxxflags="-stdlib=libc+"

or

> spack spec cmake cxxflags="-stdlib=libc+++"

or

> spack spec cmake cxxflags="-O3"

do concretize (is -stdlib=libc++ being filtered out at some point?).

Error message

> spack -d spec -lI cmake cxxflags="-stdlib=libc++"
==> [2022-12-07-13:30:07.174827] Imported spec from built-in commands
==> [2022-12-07-13:30:07.175544] Imported spec from built-in commands
==> [2022-12-07-13:30:07.183557] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/defaults/config.yaml
==> [2022-12-07-13:30:07.210096] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/config.yaml
==> [2022-12-07-13:30:07.215239] DATABASE LOCK TIMEOUT: 3s
==> [2022-12-07-13:30:07.215334] PACKAGE LOCK TIMEOUT: No timeout
==> [2022-12-07-13:30:07.216063] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/defaults/bootstrap.yaml
==> [2022-12-07-13:30:07.228291] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/defaults/repos.yaml
==> [2022-12-07-13:30:07.233727] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/defaults/config.yaml
==> [2022-12-07-13:30:07.256862] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/config.yaml
==> [2022-12-07-13:30:07.258273] DATABASE LOCK TIMEOUT: 3s
==> [2022-12-07-13:30:07.258328] PACKAGE LOCK TIMEOUT: No timeout
==> [2022-12-07-13:30:07.258419] [BOOTSTRAP CONFIG SCOPE] name=_builtin
==> [2022-12-07-13:30:07.258863] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/defaults/bootstrap.yaml
==> [2022-12-07-13:30:07.266142] [BOOTSTRAP CONFIG SCOPE] name=defaults, path=/apps/daint/SSL/pika/spack/etc/spack/defaults
==> [2022-12-07-13:30:07.266192] [BOOTSTRAP CONFIG SCOPE] name=defaults/linux, path=/apps/daint/SSL/pika/spack/etc/spack/defaults/linux
==> [2022-12-07-13:30:07.266250] [BOOTSTRAP CONFIG SCOPE] name=bootstrap, path=/users/simbergm/.spack/cache/bootstrap/config
==> [2022-12-07-13:30:07.266288] [BOOTSTRAP CONFIG SCOPE] name=bootstrap/linux, path=/users/simbergm/.spack/cache/bootstrap/config/linux
==> [2022-12-07-13:30:07.266713] Reading config from file /users/simbergm/.spack/cache/bootstrap/config/linux/compilers.yaml
==> [2022-12-07-13:30:07.297600] [BOOTSTRAP ROOT SPEC] [email protected]: %gcc target=x86_64
==> [2022-12-07-13:30:07.298538] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/defaults/bootstrap.yaml
==> [2022-12-07-13:30:07.311453] [BOOTSTRAP EXECUTABLES patchelf] Try installed specs with query '[email protected]: %gcc target=x86_64'
==> [2022-12-07-13:30:07.493116] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/defaults/config.yaml
==> [2022-12-07-13:30:07.574441] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/defaults/modules.yaml
==> [2022-12-07-13:30:07.589838] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/defaults/linux/modules.yaml
==> [2022-12-07-13:30:07.730110] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/defaults/packages.yaml
==> [2022-12-07-13:30:07.768774] [BOOTSTRAP ROOT SPEC] clingo-bootstrap@spack+python %gcc target=x86_64
==> [2022-12-07-13:30:07.768877] [BOOTSTRAP MODULE clingo] Try importing from Python
==> [2022-12-07-13:30:07.875007] [BOOTSTRAP MODULE clingo] The installed spec "clingo-bootstrap@spack+python %gcc target=x86_64 ^[email protected]/gqcctd2ejbgvyvyt4umqpetfoogfycwu" provides the "clingo" Python module
==> [2022-12-07-13:30:07.878519] [BOOTSTRAP ROOT SPEC] [email protected]: %gcc target=x86_64
==> [2022-12-07-13:30:07.879786] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/defaults/concretizer.yaml
==> [2022-12-07-13:30:07.885561] Reading config from file /apps/daint/SSL/pika/spack/../spack-user-config/concretizer.yaml
==> [2022-12-07-13:30:07.887251] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/defaults/repos.yaml
==> [2022-12-07-13:30:08.009689] '/bin/bash' '--norc' '--noprofile' '-lc' 'echo $CRAY_CPU_TARGET'
==> [2022-12-07-13:30:08.015746] using front-end architecture or available ancestor
==> [2022-12-07-13:30:08.072519] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/defaults/packages.yaml
==> [2022-12-07-13:30:08.105827] Reading config from file /apps/daint/UES/jenkins/7.0.UP03/21.09/daint-gpu/tools/software/spack-config/1.7/cdt-cuda-21.09/packages.yaml
==> [2022-12-07-13:30:08.131242] Reading config from file /apps/daint/SSL/pika/spack/../spack-user-config/packages.yaml
==> [2022-12-07-13:30:09.055865] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/defaults/config.yaml
==> [2022-12-07-13:30:09.078436] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/config.yaml
==> [2022-12-07-13:30:09.081298] Reading config from file /apps/daint/SSL/pika/spack/etc/spack/defaults/mirrors.yaml
==> [2022-12-07-13:30:09.083429] Checking existence of https://mirror.spack.io/build_cache/index.json
==> [2022-12-07-13:30:09.217385] Failure reading URL: Download failed: HTTP Error 404: Not Found
==> [2022-12-07-13:30:11.218379] Reading config from file /apps/daint/UES/jenkins/7.0.UP03/21.09/daint-gpu/tools/software/spack-config/1.7/cdt-cuda-21.09/compilers.yaml
==> [2022-12-07-13:30:11.255550] Reading config from file /apps/daint/SSL/pika/spack/../spack-user-config/cray/compilers.yaml
Traceback (most recent call last):
  File "/apps/daint/SSL/pika/spack/bin/spack", line 54, in <module>
    sys.exit(main())
  File "/apps/daint/SSL/pika/spack/lib/spack/spack_installable/main.py", line 36, in main
    sys.exit(spack.main.main(argv))
  File "/apps/daint/SSL/pika/spack/lib/spack/spack/main.py", line 1000, in main
    return _main(argv)
  File "/apps/daint/SSL/pika/spack/lib/spack/spack/main.py", line 955, in _main
    return finish_parse_and_run(parser, cmd_name, env_format_error)
  File "/apps/daint/SSL/pika/spack/lib/spack/spack/main.py", line 983, in finish_parse_and_run
    return _invoke_command(command, parser, args, unknown)
  File "/apps/daint/SSL/pika/spack/lib/spack/spack/main.py", line 632, in _invoke_command
    return_val = command(parser, args)
  File "/apps/daint/SSL/pika/spack/lib/spack/spack/cmd/spec.py", line 103, in spec
    concretized_specs = spack.cmd.parse_specs(args.specs, concretize=True)
  File "/apps/daint/SSL/pika/spack/lib/spack/spack/cmd/__init__.py", line 223, in parse_specs
    spec.concretize(tests=tests)  # implies normalize
  File "/apps/daint/SSL/pika/spack/lib/spack/spack/spec.py", line 2978, in concretize
    self._new_concretize(tests)
  File "/apps/daint/SSL/pika/spack/lib/spack/spack/spec.py", line 2953, in _new_concretize
    result = solver.solve([self], tests=tests)
  File "/apps/daint/SSL/pika/spack/lib/spack/spack/solver/asp.py", line 2518, in solve
    result, _, _ = self.driver.solve(setup, specs, reuse=reusable_specs, output=output)
  File "/apps/daint/SSL/pika/spack/lib/spack/spack/solver/asp.py", line 765, in solve
    answers = builder.build_specs(spec_attrs)
  File "/apps/daint/SSL/pika/spack/lib/spack/spack/solver/asp.py", line 2376, in build_specs
    self.reorder_flags()
  File "/apps/daint/SSL/pika/spack/lib/spack/spack/solver/asp.py", line 2304, in reorder_flags
    assert set(compiler_flags) == set(ordered_compiler_flags), msg
AssertionError: {'-stdlib=libc++'} does not equal set()

Information on your system

The assertion points to

assert set(compiler_flags) == set(ordered_compiler_flags), msg
which was introduced in #34218. Concretization works before that was merged.

> spack debug report
* **Spack:** 0.20.0.dev0 (194f9a9ca97063c302a6fb0e4456b653a876315a)
* **Python:** 3.9.4
* **Platform:** cray-sles15-haswell
* **Concretizer:** clingo

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have searched the issues of this repo and believe this is not a duplicate
  • I have run the failing commands in debug mode and reported the output

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtriageThe issue needs to be prioritized

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions