Skip to content

adjust_config fails to build. #240

@pcanal

Description

@pcanal

In my configuration adjust_config fails to compile:

72/75] Scanning /home/pcanal/phlex_working/code/phlex/test/adjust_config.cpp for CXX dependencies
FAILED: [code=1] test/CMakeFiles/adjust_config.dir/adjust_config.cpp.o.ddi 
/home/pcanal/phlex_working/code/spack/opt/spack/linux-almalinux9-zen2/llvm-15.0.7/gcc-15.2.0-y4gwyaa7hif3hu2vttr4umq2vk657uw4/bin/g++ -DBOOST_CONTAINER_DYN_LINK -DBOOST_CONTAINER_NO_LIB -DBOOST_JSON_DYN_LINK -DBOOST_JSON_NO_LIB -I/home/pcanal/phlex_working/build/2025-12 -I/home/pcanal/phlex_working/code/phlex -isystem /home/pcanal/phlex_working/code/spack/opt/spack/linux-almalinux9-zen2/gcc-15.2.0/catch2-3.8.0-szsrxjdkgwmljpwg6t23udku6xsu3wjy/include -isystem /home/pcanal/phlex_working/code/spack/opt/spack/linux-almalinux9-zen2/gcc-15.2.0/boost-1.88.0-jo5efrhxwue76ysfbjsn3zrk4or6z4sk/include -g -std=c++20   -UNDEBUG -Wall -Werror -Wunused -Wunused-parameter -pedantic -Wno-array-bounds -Wno-stringop-overflow -E -x c++ /home/pcanal/phlex_working/code/phlex/test/adjust_config.cpp -MT test/CMakeFiles/adjust_config.dir/adjust_config.cpp.o.ddi -MD -MF test/CMakeFiles/adjust_config.dir/adjust_config.cpp.o.ddi.d -fmodules-ts -fdeps-file=test/CMakeFiles/adjust_config.dir/adjust_config.cpp.o.ddi -fdeps-target=test/CMakeFiles/adjust_config.dir/adjust_config.cpp.o -fdeps-format=p1689r5 -o test/CMakeFiles/adjust_config.dir/adjust_config.cpp.o.ddi.i
In file included from /home/pcanal/phlex_working/code/phlex/phlex/model/product_specification.hpp:5,
                 from /home/pcanal/phlex_working/code/phlex/phlex/core/product_query.hpp:4,
                 from /home/pcanal/phlex_working/code/phlex/phlex/configuration.hpp:5,
                 from /home/pcanal/phlex_working/code/phlex/phlex/driver.hpp:6,
                 from /home/pcanal/phlex_working/code/phlex/phlex/app/load_module.hpp:5,
                 from /home/pcanal/phlex_working/code/phlex/test/adjust_config.cpp:1:
/home/pcanal/phlex_working/code/phlex/phlex/model/type_id.hpp:7:10: fatal error: fmt/format.h: No such file or directory
    7 | #include "fmt/format.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: cannot make progress due to previous errors.

The problem is that adjust_config.cpp uses phlex/model/type_id.hpp which uses fmt/format.h, however the dependency on fmt::fmt is indirectly private.

adjust_config depends on run_phlex which privately depends on phlex_core.

Thus there are many ways to solve this problem (all tested to lead to successful compilation ):

  1. Make adjust_config depend on fmt::fmt explicitly (but technically this test would then need to be update each time phlex_core or phlex_model uses new external dependencies.
  2. Make adjust_config depends on phlex_core in addition to run_phlex
  3. Make run_phlex depends publicly on phlex_core

I guess the best option is (2). @knoepfel what is your opinion?

Metadata

Metadata

Labels

bugSomething isn't workingquestionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions