Opened 6 months ago
Last modified 10 days ago
#73810 assigned defect
qt5-qtwebengine @5.15.19: error: constexpr variable 'kMax' must be initialized by a constant expression
| Reported by: | jwhowse4 (James Howse) | Owned by: | MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 2.12.4 |
| Keywords: | tahoe goldengate | Cc: | reneeotten (Renee Otten), hapaguy (Brian Kurt Fujikawa), Franco-UniTS (Franco Vaccari) |
| Port: | qt5-qtwebengine |
Description
Running an M4 based ARM system with MacOS 26.4 and XCode 26.4. The build for the package qt5-qtwebengine fails. I have attached the build log. I admit I am mystified by the build error. Any thoughts on a fix?
Attachments (1)
Change History (12)
Changed 6 months ago by jwhowse4 (James Howse)
| Attachment: | qt5-qtwebengine_main.log.gz added |
|---|
comment:1 Changed 6 months ago by jmroot (Joshua Root)
| Cc: | reneeotten added |
|---|---|
| Owner: | set to MarcusCalhoun-Lopez |
| Status: | new → assigned |
comment:2 follow-up: 4 Changed 6 months ago by reneeotten (Renee Otten)
The error in the log says:
110895 :info:build ../../3rdparty/chromium/v8/src/base/bit-field.h:43:22: error: constexpr variable 'kMax' must be initialized by a constant expression 110896 :info:build 43 | static constexpr T kMax = static_cast<T>(kNumValues - 1); 110897 :info:build | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 110898 :info:build ../../3rdparty/chromium/v8/src/wasm/wasm-code-manager.h:337:30: note: in instantiation of template class 'v8::base::BitField<v8::internal::wasm::WasmCode::Kind , 0, 3, unsigned char>' requested here 110899 :info:build 337 | using ExecutionTierField = KindField::Next<ExecutionTier, 2>; 110900 :info:build | ^ 110901 :info:build ../../3rdparty/chromium/v8/src/base/bit-field.h:43:29: note: integer value 7 is outside the valid range of values [0, 3] for the enumeration type 'Kind' 110902 :info:build 43 | static constexpr T kMax = static_cast<T>(kNumValues - 1); 110903 :info:build | ^ 110904 :info:build 1 error generated.
I see that qt5-qtwebengine build fine macOS 26 but the buildbot has Xcode 26.2; so likely there is some change between 26.2 and 26.4 that causes this.
According to the buildbot log and the one you attached here, it looks like Xcode 26.4 contains a newer compiler:
Apple clang version 21.0.0 (clang-2100.0.123.102)
, whereas the one on the buildbot says:
Apple clang version 17.0.0 (clang-1700.6.3.2)
I suspect that the newer compiler is more strict and doesn't swallow the older qt5-qtwebengine code anymore (or warnings are now turned into errors). Perhaps there is a flag to suppress/downgrade the error, but it would -of course- be better to fix the code. Unfortunately, I do not know how to do that...
comment:3 Changed 6 months ago by reneeotten (Renee Otten)
Perhaps related to Chromium issue 40233410 but that was reportedly fixed in 2022 already...
It looks like this patchfile downgraded errors-to-warnings, but it appears that doesn't work anymore on newer Clang versions...
comment:4 follow-up: 5 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)
Replying to reneeotten:
but the buildbot has Xcode 26.2
I upgraded the macOS 26 arm64 buildbot worker to macOS 26.4 and Xcode 26.4 recently, as shown here:
comment:5 Changed 6 months ago by reneeotten (Renee Otten)
Replying to ryandesign:
Replying to reneeotten:
but the buildbot has Xcode 26.2
I upgraded the macOS 26 arm64 buildbot worker to macOS 26.4 and Xcode 26.4 recently, as shown here:
I missed that. However, the last build of qt5-qtwebengine on macOS 26 in March was done while the buildbot had macOS 26.3 and Xcode 26.2. The conclusion that the changes between Xcode 26.2 and 26.4 are the reason for the build failure described in this ticket and if we would attempt a new build on the current buildbot it will fails in a similar vein.
comment:6 Changed 6 months ago by jwhowse4 (James Howse)
I tried forcing the build to use the macports clang-18 compiler, but I realized I do not know how to change compilers in a Portfile for a package that uses QMake rather than Configure. Suggestions?
comment:7 Changed 6 months ago by jwhowse4 (James Howse)
To be a bit more specific, trying to build the package using the command
port install qt5-qtwebengine configure.compiler=macports-clang-18
fails and does not appear to change the compiler used during the build.
comment:8 Changed 6 months ago by hapaguy (Brian Kurt Fujikawa)
| Cc: | hapaguy added |
|---|
comment:9 Changed 4 weeks ago by ryandesign (Ryan Carsten Schmidt)
| Keywords: | tahoe goldengate added |
|---|---|
| Summary: | qt5-qtwebengine build fails → qt5-qtwebengine @5.15.19: error: constexpr variable 'kMax' must be initialized by a constant expression |
Has duplicate #74446.
Setting configure.compiler is indeed how you tell MacPorts (for debugging purposes) what compiler you want to use. Within a portfile, you wouldn't set configure.compiler directly; you'd set compiler.blacklist to tell MacPorts what compilers don't work and it will pick the next best compiler. If the port does not honor the compiler selection, that's a bug in the port.
comment:10 Changed 10 days ago by Franco-UniTS (Franco Vaccari)
I got the same error while migrating from Tahoe to Golden Gate on a M1 Mac with Xcode 27. Searching around I found this patch:
https://gist.github.com/smellman/7d573c4e8dbfc475cef107fa65a77eda
HTH
comment:11 Changed 10 days ago by Franco-UniTS (Franco Vaccari)
| Cc: | Franco-UniTS added |
|---|

qt5-qtwebengine build log, compressed