Created
February 23, 2026 13:03
-
-
Save traversaro/de0fd7c1b80072b06509164a2c22903b to your computer and use it in GitHub Desktop.
Reproducer for clang_linux-64 and clangxx_linux-64 build failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| c_compiler: | |
| - clang | |
| cxx_compiler: | |
| - clangxx | |
| c_stdlib: | |
| - sysroot # [linux] | |
| - macosx_deployment_target # [osx] | |
| - vs # [win] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <optional> | |
| #include <string> | |
| int main() { | |
| std::optional<std::string> msg = std::string("optional-ok"); | |
| if (!msg) { | |
| return 1; | |
| } | |
| std::cout << *msg << '\n'; | |
| return 0; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [workspace] | |
| name = "cpp17-optional-reproducer" | |
| description = "Minimal C++17 std::optional compiler/stdlib sanity check" | |
| channels = ["conda-forge"] | |
| platforms = ["linux-64"] | |
| [dependencies] | |
| rattler-build = "*" | |
| [tasks] | |
| # Reproduces the breakage: libstdcxx-devel_linux-64 is NOT added to build requirements | |
| build-broken = "rattler-build build --recipe . --variant 'pin_libstdcxx_devel=false' --output-dir output" | |
| # Fixes the issue: libstdcxx-devel_linux-64 15.* IS added to build requirements | |
| build-fixed = "rattler-build build --recipe . --variant 'pin_libstdcxx_devel=true' --output-dir output" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| context: | |
| name: cpp17-optional-reproducer | |
| version: "0.1.0" | |
| package: | |
| name: ${{ name }} | |
| version: ${{ version }} | |
| source: | |
| path: . | |
| use_gitignore: false | |
| build: | |
| number: 0 | |
| skip: | |
| - win | |
| script: | |
| # Helpful diagnostics in the build log | |
| - echo "CC=${CC}" | |
| - echo "CXX=${CXX}" | |
| - ${CXX} -std=c++17 -v -E -x c++ /dev/null | |
| # Actual compile (this is where <optional> will fail if stdlib headers are broken) | |
| - ${CXX} -std=c++17 -O2 main.cpp -o optional-smoke | |
| - mkdir -p ${PREFIX}/bin | |
| - cp optional-smoke ${PREFIX}/bin/optional-smoke | |
| requirements: | |
| build: | |
| - ${{ compiler('c') }} | |
| - ${{ stdlib('c') }} | |
| - ${{ compiler('cxx') }} | |
| # Controlled via -m variant-fixed.yaml / variant-broken.yaml (use_libstdcxx_devel) | |
| - if: pin_libstdcxx_devel == "true" | |
| then: | |
| - libstdcxx-devel_linux-64 15.* | |
| tests: | |
| - script: | |
| - optional-smoke | |
| - test "$(optional-smoke)" = "optional-ok" | |
| about: | |
| summary: "Minimal C++17 std::optional compiler/stdlib sanity check" | |
| license: BSD-3-Clause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment