Skip to content

Commit 7845da1

Browse files
committed
tests: the fixtures that used the removed key, and the one assertion only macOS could fail
Three CI-only failures, all from this change and each in a fixture rather than in the engine. e2e 88 and 205 declared [xlings.envs], which is now refused. 205 drops it; 88 asserted the key was materialized and now asserts it is not, and gains two criteria the merge introduced: the same statement in both tables collapses to one entry, and the superseded key is reported with the line to write. The manifest parser gained that collapse. deps and workspace agreeing about one package is not an error and is not two entries — appending it twice would ask xlings to install one package twice. Manifest.XlingsWorkspaceAcceptsPerPlatformValues compared host_platform_key() against "macos", and this change made that key xlings' own spelling, "macosx". The assertion was written in terms of the function precisely so it would run on every host, and it was the one line in the file that could only fail on a macOS runner. It did.
1 parent 6020027 commit 7845da1

4 files changed

Lines changed: 22 additions & 12 deletions

File tree

modules/manifest/src/toml.cppm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,14 @@ std::expected<Manifest, ManifestError> parse_string(std::string_view content,
15521552
// Compared on the whole pin, not on the version: two namespaces at
15531553
// one version are two packages sharing a name.
15541554
if (auto pinned = m.xlings.workspace.find(entry.target);
1555-
pinned != m.xlings.workspace.end() && pinned->second != entry.pin()) {
1555+
pinned != m.xlings.workspace.end() && pinned->second == entry.pin()) {
1556+
// The same statement in both tables. Not an error and not two
1557+
// entries: appending it again would ask xlings to install one
1558+
// package twice, so only the advisory below is produced.
1559+
replacement += std::format("\n {} = \"{}\"",
1560+
entry.target, entry.pin());
1561+
continue;
1562+
} else if (pinned != m.xlings.workspace.end()) {
15561563
auto say = [](const std::string& p) {
15571564
return p.empty() ? std::string("unconstrained") : p;
15581565
};

tests/e2e/205_root_local_subos.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ members = ["app"]
7979
8080
[xlings]
8181
subos = "root-el8"
82-
83-
[xlings.envs]
84-
ROOT_ONLY = "1"
8582
EOF
8683
cat >"$ws/app/mcpp.toml" <<'EOF'
8784
[package]

tests/e2e/88_xlings_environment.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,10 @@ deps = ["ninja@1.12.1"]
3737
subos = "dev"
3838
3939
[xlings.workspace]
40-
# Pin a tool version (the general form of [toolchain]).
40+
# The one table (2026.9.3.1+). The same statement as the `deps` line above,
41+
# which is deliberate: the two must collapse to one entry rather than ask
42+
# xlings to install one package twice.
4143
ninja = "1.12.1"
42-
43-
[xlings.envs]
44-
# Env vars applied by xvm shims.
45-
APP_BUILD_ENV = "1"
4644
EOF
4745
echo 'int main() { return 0; }' > app/src/main.cpp
4846

@@ -65,7 +63,12 @@ grep -q 'ninja@1.12.1' "$J" || { echo "FAIL: deps entry missing"; exit 1; }
6563
grep -q '"subos": "dev"' "$J" || { echo "FAIL: subos not materialized"; exit 1; }
6664
grep -q '"workspace"' "$J" || { echo "FAIL: workspace not materialized"; exit 1; }
6765
grep -q '"ninja": "1.12.1"' "$J" || { echo "FAIL: workspace pin missing"; exit 1; }
68-
grep -q '"envs"' "$J" || { echo "FAIL: envs not materialized"; exit 1; }
69-
grep -q '"APP_BUILD_ENV": "1"' "$J" || { echo "FAIL: env var missing"; exit 1; }
66+
grep -q '"envs"' "$J" && { echo "FAIL: envs is materialized and nothing reads it"; exit 1; }
67+
# One statement, one entry: `deps` and `[xlings.workspace]` agree here, and the
68+
# materialized list must not name the package twice.
69+
[ "$(grep -o 'ninja@1.12.1' "$J" | wc -l)" -eq 1 ] \
70+
|| { echo "FAIL: the same statement was materialized twice"; exit 1; }
71+
# The superseded key is reported, with the line to write instead.
72+
grep -q '\[xlings.workspace\]' b.log || { echo "FAIL: no advisory for [xlings] deps"; cat b.log; exit 1; }
7073

7174
echo "OK"

tests/unit/test_manifest.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4503,7 +4503,10 @@ xmake = "3.0.7"
45034503
const auto host = mcpp::manifest::host_platform_key();
45044504
if (host == "linux") EXPECT_EQ(m->xlings.workspace.at("gcc"), "15.1.0");
45054505
else EXPECT_EQ(m->xlings.workspace.count("gcc"), 0u);
4506-
EXPECT_EQ(m->xlings.workspace.at("llvm"), host == "macos" ? "20" : "22");
4506+
// `host_platform_key()` is xlings' spelling, `macosx`, since 2026.9.3.1.
4507+
// Comparing against "macos" here made this the one assertion in the file
4508+
// that could only fail on a macOS runner — and it did.
4509+
EXPECT_EQ(m->xlings.workspace.at("llvm"), host == "macosx" ? "20" : "22");
45074510
EXPECT_EQ(m->xlings.workspace.at("xmake"), "3.0.7");
45084511
}
45094512

0 commit comments

Comments
 (0)