Skip to content

Commit 25d577d

Browse files
authored
0.15.1: a vcpkg installation waits for another one of the same root (#33)
1 parent 80c2038 commit 25d577d

8 files changed

Lines changed: 21 additions & 10 deletions

File tree

‎.github/scripts/check-deps-and-qt.sh‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ vcpkg_workspace() {
141141
[ "$(find . -path '*/target/*' -path '*deps-vcpkg*' -name '*.stamp' | wc -l)" -ge 2 ] ||
142142
fail "each member did not declare its own installation"
143143
echo "ok: two members that share no dependency both installed and linked one prefix"
144+
# The two installations may run at once; vcpkg's own lock on the root makes
145+
# the second wait only when asked to, and fails it otherwise ("failed to
146+
# take lock", measured on GalTranslPP under 0.15.0).
147+
[ "$(grep -rl -- '--x-wait-for-lock' --include=build.ninja . | wc -l)" -ge 2 ] ||
148+
fail "a member's installation does not wait for the root's lock"
149+
echo "ok: each member's installation waits for another one of the same root"
144150
}
145151

146152
cmake_consumer() {

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module name the member declares, and configures it there.
99

1010
```toml
1111
[build-dependencies.mcpp]
12-
plugins = { version = "0.15.0", features = ["rules-spirv"], host-module = true }
12+
plugins = { version = "0.15.1", features = ["rules-spirv"], host-module = true }
1313
```
1414

1515
```cpp

‎deps/vcpkg.cppm‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,10 @@ inline prefix use(const options& opt = {}) {
274274
// THE ACTION IS vcpkg ITSELF. Everything an installation needs is an
275275
// argument: `--vcpkg-root` pairs the tool with the scripts it was
276276
// released with, whatever `VCPKG_ROOT` the shell has; vcpkg locks the
277-
// installation root itself (`<root>/vcpkg/vcpkg-running.lock`), so two
278-
// workspace members installing one root wait for each other; its build
277+
// installation root itself (`<root>/vcpkg/vcpkg-running.lock`), and
278+
// `--x-wait-for-lock` makes a second installation of the same root --
279+
// two workspace members, run concurrently -- wait for the first
280+
// instead of failing (measured on GalTranslPP under 0.15.0); its build
279281
// and package trees go to a short directory under vcpkg's per-user
280282
// directory, because a port's build nests deep and Windows tools still
281283
// enforce MAX_PATH.
@@ -295,6 +297,7 @@ inline prefix use(const options& opt = {}) {
295297
a.arg(exeS.c_str()).arg("install")
296298
.arg(("--vcpkg-root=" + vcpkgRoot).c_str())
297299
.arg("--disable-metrics")
300+
.arg("--x-wait-for-lock")
298301
.arg("--triplet").arg(triplet.c_str())
299302
.arg(("--x-manifest-root=" + mcpp::deps::generic(manifestRoot)).c_str())
300303
.arg(("--x-install-root=" + mcpp::deps::generic(tripletRoot)).c_str())

‎docs/deps.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Module `mcpp.deps.archive`; engine floor: 2026.9.26.2.
2424

2525
```toml
2626
[build-dependencies.mcpp]
27-
plugins = { version = "0.15.0", features = ["deps-vcpkg"], host-module = true }
27+
plugins = { version = "0.15.1", features = ["deps-vcpkg"], host-module = true }
2828
```
2929

3030
```cpp
@@ -88,8 +88,9 @@ vcpkg's per-user directory (`%LOCALAPPDATA%\vcpkg` on Windows,
8888
`$XDG_CACHE_HOME/vcpkg` or `~/.cache/vcpkg` elsewhere), beside vcpkg's default
8989
binary cache, under a short name, because Windows tools still enforce MAX_PATH;
9090
an existing `VCPKG_DOWNLOADS` is kept. vcpkg locks the installation root itself
91-
(`<root>/vcpkg/vcpkg-running.lock`), so two workspace members installing one
92-
root run one after the other. vcpkg fetches its
91+
(`<root>/vcpkg/vcpkg-running.lock`), and `--x-wait-for-lock` makes two
92+
workspace members installing one root run one after the other; without it the
93+
second fails, "failed to take lock" (0.15.1). vcpkg fetches its
9394
own CMake, Ninja and 7-Zip, and on Windows a portable git; on Linux and macOS
9495
its documented host prerequisites (git, curl, zip, unzip, tar, a C compiler)
9596
are the host's. Ports are compiled with vcpkg's default toolchain for the

‎docs/rules-qt.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
```toml
88
[build-dependencies.mcpp]
9-
plugins = { version = "0.15.0", features = ["rules-qt"], host-module = true }
9+
plugins = { version = "0.15.1", features = ["rules-qt"], host-module = true }
1010

1111
# The SDK and its version are the project's declaration.
1212
[target.'cfg(any(windows, linux, macos))'.xlings.workspace]

‎mcpp.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "plugins"
33
namespace = "mcpp"
4-
version = "0.15.0"
4+
version = "0.15.1"
55
description = "Official mcpp build plugins: rule packages under mcpp.rules.*, build-time utilities under mcpp.tools.*, each member selected by a feature"
66
license = "Apache-2.0"
77
authors = ["mcpp-community"]

‎src/plugins.cppm‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export namespace mcpp::plugins {
4949
//
5050
// One package, one version: the number lives in mcpp.toml, and the CI step
5151
// `the collection states its own version` compares the two.
52-
inline constexpr std::string_view version = "0.15.0";
52+
inline constexpr std::string_view version = "0.15.1";
5353

5454
} // namespace mcpp::plugins
5555

‎tests/vcpkg-workspace/mcpp.toml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# it, and those of no other package do, so each member declares the
66
# installation itself. The two actions run the same `vcpkg install` against the
77
# root's one manifest into one installation root; vcpkg locks that root itself
8-
# (`vcpkg/vcpkg-running.lock`), so they run one after the other and the second
8+
# (`vcpkg/vcpkg-running.lock`) and the member passes `--x-wait-for-lock`, so
9+
# they run one after the other and the second
910
# finds everything installed.
1011
[workspace]
1112
members = ["app-a", "app-b"]

0 commit comments

Comments
 (0)