Skip to content

Commit 99b0335

Browse files
committed
probe: i686-windows-msvc import std with llvm 23.1.3 and 22.1.8, and the MSVC STL coroutine guards
1 parent c6dca54 commit 99b0335

26 files changed

Lines changed: 145 additions & 8045 deletions
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
# TEMPORARY PROBE (do not merge): how the machine's MSVC STL guards its
3+
# coroutine headers, and which headers of the std module depend on them.
4+
# Prints; asserts nothing.
5+
set -u
6+
vswhere="/c/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe"
7+
vs=$("$vswhere" -latest -products '*' -property installationPath | tr -d '\r')
8+
vs=$(cygpath -u "$vs")
9+
for tools in "$vs"/VC/Tools/MSVC/*; do
10+
inc="$tools/include"; mods="$tools/modules"
11+
echo "### toolset $(basename "$tools")"
12+
echo "--- x86 libraries present:"; ls -d "$tools/lib/x86" 2>&1
13+
echo "--- <coroutine> preprocessor lines:"
14+
grep -nE '^\s*#\s*(if|ifdef|ifndef|elif|else|endif|error|define _COROUTINE_)|_EMIT_STL|__cpp_impl_coroutine' "$inc/coroutine" | head -40
15+
echo "--- <generator> preprocessor lines:"
16+
grep -nE '^\s*#\s*(if|ifdef|ifndef|elif|else|endif|error|define _GENERATOR_)|_EMIT_STL|__cpp_impl_coroutine|__cpp_lib_coroutine|include <coroutine>' "$inc/generator" | head -40
17+
echo "--- yvals_core.h coroutine feature lines:"
18+
grep -nE '__cpp_impl_coroutine|__cpp_lib_coroutine|__cpp_lib_generator' "$inc/yvals_core.h"
19+
echo "--- std.ixx lines naming generator/coroutine (with the surrounding conditionals):"
20+
grep -nE 'generator|coroutine|^\s*#\s*(if|elif|else|endif)' "$mods/std.ixx" | head -60
21+
echo "--- STL headers that use coroutine_handle / suspend_always:"
22+
grep -lE 'coroutine_handle|suspend_always' "$inc"/* 2>/dev/null | xargs -n1 basename
23+
done
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/usr/bin/env bash
2+
# TEMPORARY PROBE (do not merge): `import std` on i686-windows-msvc with
3+
# clang 23.1.3 and 22.1.8, mcpp built from the #781 head. Answers G1/G2 of
4+
# .agents/reviews/2026-10-08-llvm-2313-part3-review-fixes-and-x86-msvc-coroutines-design.md.
5+
# Prints; asserts nothing.
6+
set -u
7+
M="${MCPP_BUILT:?}"
8+
W="$RUNNER_TEMP/x86-msvc-std"; mkdir -p "$W"
9+
"$M" --version
10+
11+
# case <name> <target> <standard> <toolchain-table> <source-kind>
12+
case_run() {
13+
local name=$1 target=$2 std=$3 tc=$4 src=$5
14+
local d="$W/$name"; rm -rf "$d"; mkdir -p "$d/src"; cd "$d"
15+
printf '[package]\nname = "p"\nversion = "0.1.0"\nstandard = "%s"\n\n%s\n' "$std" "$tc" > mcpp.toml
16+
case "$src" in
17+
std) printf 'import std;\nint main() { std::println("std ok {}", sizeof(void*)); }\n' > src/main.cpp ;;
18+
compat) printf 'import std.compat;\nint main() { std::printf("compat ok %%zu\\n", sizeof(void*)); }\n' > src/main.cpp ;;
19+
std20) printf 'import std;\nint main() { std::cout << "std ok " << sizeof(void*) << "\\n"; }\n' > src/main.cpp ;;
20+
coro) printf '#include <coroutine>\nstruct t { struct promise_type { t get_return_object() { return {}; } std::suspend_never initial_suspend() noexcept { return {}; } std::suspend_never final_suspend() noexcept { return {}; } void return_void() {} void unhandled_exception() {} }; };\nt f() { co_return; }\nint main() { f(); }\n' > src/main.cpp ;;
21+
esac
22+
echo; echo "################ $name target=$target standard=$std src=$src"
23+
echo "--- mcpp.toml"; cat mcpp.toml
24+
echo "--- build"
25+
"$M" build --verbose --target "$target" > build.log 2>&1; local rc=$?
26+
cat build.log; echo "build rc=$rc"
27+
echo "--- lines naming generator / coroutine / __cpp_impl_coroutine:"
28+
grep -nE 'generator|coroutine|__cpp_impl_coroutine' build.log | head -30
29+
if [ $rc -eq 0 ]; then
30+
local exe; exe=$(find target -type f -name 'p.exe' | head -1)
31+
echo "--- run $exe"; "$exe"; echo "run rc=$?"
32+
command -v file >/dev/null && file "$exe"
33+
fi
34+
}
35+
36+
T23='[toolchain]
37+
windows = "llvm@23.1.3"'
38+
T22i='[toolchain]
39+
windows = "llvm@23.1.3"
40+
41+
[target.i686-windows-msvc]
42+
toolchain = "llvm@22.1.8"'
43+
T22x='[toolchain]
44+
windows = "llvm@23.1.3"
45+
46+
[target.x86-windows-msvc]
47+
toolchain = "llvm@22.1.8"'
48+
49+
# G1: the reported failure, and what the compiler says where.
50+
case_run g1-23-cxx23-i686 i686-windows-msvc c++23 "$T23" std
51+
# G2: C++20 on the same compiler and target.
52+
case_run g2-23-cxx20-i686 i686-windows-msvc c++20 "$T23" std20
53+
case_run g2-23-cxx20-i686-compat i686-windows-msvc c++20 "$T23" compat
54+
# Using the coroutine library itself under C++20 (expected to be refused by the
55+
# STL or the compiler; recorded for the documentation).
56+
case_run g2-23-cxx20-i686-coro i686-windows-msvc c++20 "$T23" coro
57+
# Option (b): llvm 22.1.8 for this target only, in the spelling the note uses
58+
# and in MSVC's x86 spelling.
59+
case_run g1b-22-cxx23-i686 i686-windows-msvc c++23 "$T22i" std
60+
case_run g1b-22-cxx23-x86 x86-windows-msvc c++23 "$T22x" std
61+
# G3: the 64-bit row is unaffected.
62+
case_run g3-23-cxx23-x64 x86_64-windows-msvc c++23 "$T23" std

‎.github/workflows/aur-publish.yml‎

Lines changed: 0 additions & 163 deletions
This file was deleted.

0 commit comments

Comments
 (0)