Repository navigation
Commit 6a7ae1f
committed
Stop the image build scanning for C++20 modules it does not have scanners for
Three Docker images fail to build PyTorch, all on the same file, for the same
underlying reason in two flavours. The clang image:
FAILED: [code=127] third_party/fmt/CMakeFiles/fmt.dir/src/format.cc.o.ddi
/bin/sh: 1: CMAKE_CXX_COMPILER_CLANG_SCAN_DEPS-NOTFOUND: not found
and the two GCC images:
cc1plus: error: to generate dependencies you must specify either '-M' or '-MM'
PyTorch compiles at C++20 as of 2.14. CMake responds by scanning every source
for module imports before compiling it, which needs a scanner: `clang-scan-deps`
for clang, and a supported invocation for GCC. The clang image installs clang and
llvm but not the package that carries `clang-scan-deps`, and GCC rejects the scan
outright. Neither PyTorch nor anything in these images uses C++20 modules, so the
scan has nothing to find and only has to be turned off.
Turning it off covers all three images. Adding the missing clang package would fix
one of them and leave the two GCC ones failing, which is how this looked at first.
Test Plan:
Compared the three failing job logs. All three fail building the same fmt source,
the clang one on a missing scanner binary and the two GCC ones on the scan
invocation itself, which is what shows this is one problem rather than three.
Confirmed the variable reaches CMake rather than being ignored. PyTorch forwards
any environment variable beginning with `CMAKE_` to a CMake cache variable of the
same name, which its own forwarding module states in those terms.
Confirmed the images were healthy before the pin moved: the same image and job
name built successfully on the previous pin.
Confirmed this is not a duplicate of the cmake change next to it. That one picks
which cmake runs; both cmakes are new enough to scan, so it does not disable
scanning on its own.
Syntax-checked the script.
I cannot build an image on this machine, so CI has to confirm the three images now
build.1 parent 4ae2c81 commit 6a7ae1f
1 file changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
| 81 | + | |
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| |||
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
91 | | - | |
92 | | - | |
93 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
94 | 100 | | |
95 | 101 | | |
96 | 102 | | |
| |||
0 commit comments