Opened 5 months ago
Last modified 4 months ago
#73910 assigned defect
codex @0.121.0: error: invalid value 'c++20' in '-std=c++20'
| Reported by: | awn | Owned by: | shun@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 2.12.5 |
| Keywords: | catalina | Cc: | |
| Port: | codex |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
Both MacPorts-2.12.4 and MacPorts-2.12.5 are unable to compile codex-0.121.0 (codex-0.116.0 was built without problems) under macOS Catalina.
Error messages: Error: Failed to build codex: command execution failed Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_llm_codex/codex/main.log for details.
Aforementioned '/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_llm_codex/codex/main.log' is attached.
Attachments (3)
Change History (9)
Changed 5 months ago by awn
comment:1 Changed 5 months ago by awn
Of course and obviously: Feel free to ask any question to provide any useful to you information, of course, and/or run host local/Catalina specific tests if need.
comment:2 follow-up: 3 Changed 5 months ago by awn
I think the key is that phrase in log: "cargo:warning=error: invalid value 'c++20' in '-std=c++20" (Xcode's Clang on Catalina capable of C++17 at maximum).
But, sorry, I know too little about MacPorts machinery to suggest how to patch whatever drives build so it would to say "drop Xcode's Clang if it isn't c++20 capable, check most fresh currently installed active MacPorts' Clang, use it if it is capable, or install fresher one if need" :-(
comment:3 Changed 5 months ago by ryandesign (Ryan Carsten Schmidt)
| Description: | modified (diff) |
|---|---|
| Keywords: | catalina added |
| Owner: | set to shun@… |
| Status: | new → assigned |
| Summary: | codex port fails to compile under macOS Catalina → codex @0.121.0: error: invalid value 'c++20' in '-std=c++20' |
| Version: | → 2.12.5 |
Replying to awn:
I know too little about MacPorts machinery to suggest how to patch whatever drives build so it would to say "drop Xcode's Clang if it isn't c++20 capable, check most fresh currently installed active MacPorts' Clang, use it if it is capable, or install fresher one if need" :-(
The way to do more or less that is to add this line to the Portfile:
compiler.cxx_standard 2020
If you like, you could try adding that line to the Portfile and see if it then compiles, and let us know here.
Otherwise, we'll probably add it later and see what happens on the build system.
comment:4 Changed 4 months ago by awn
If I add
compiler.cxx_standard 2020
the ports infrastructure picks clang-17 and build fails at compile stage (seed attached codex-clang-17.build.log).
If I force clang-21 by adding
configure.compiler macports-clang-21
(in addition to compiler.cxx_standard 2020) build fails at linking stage (see attached codex-clang-21.build.log)
Changed 4 months ago by awn
| Attachment: | codex-clang-17.build.log added |
|---|
Changed 4 months ago by awn
| Attachment: | codex-clang-21.build.log added |
|---|
comment:5 Changed 4 months ago by ryandesign (Ryan Carsten Schmidt)
So we seem to have multiple problems:
- The port doesn't say it requires C++20.
- When that's added, MacPorts still picks a compiler that doesn't support enough C++20 (clang 17). (According to CompilerSelection, we believe clang 16 supports C++20.)
- When you force a sufficient C++20 compiler (clang 21), it still fails due to a new problem.
In the clang 21 log, I see:
:info:build = note: some arguments are omitted. use `--verbose` to show all linker arguments :info:build = note: ld: framework not found ScreenCaptureKit :info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
As you mentioned previously, you're on macOS 10.15. ScreenCaptureKit was introduced in macOS 12.3. You could file a codex bug report and see if they would be willing to make the use of ScreenCaptureKit optional; if not, then you'll need macOS 12.3 or later to continue to use this port.
We could possibly change the port to offer an older pre-ScreenCaptureKit version of the software to macOS 11 and earlier, however then you wouldn't get any updates of the port anymore.
comment:6 Changed 4 months ago by awn
As you mentioned previously, you're on macOS 10.15. ScreenCaptureKit was introduced in macOS 12.3. You could file a codex bug report and see if they would be willing to make the use of ScreenCaptureKit optional
They already managed to workaround that somehow: "official" codex-0.125.0 works on macOS Catalina without problems. I just don't like the idea of having NodeJs just for install codex ("official" channel is through 'npm') and neither like to have a zoo of different packages installed through different package managers ¯\_(ツ)_/¯

'/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_llm_codex/codex/main.log' mentioned in the ticket.