Skip to content

Commit 256981a

Browse files
authored
fix(build): set GOROOT for remote Go builds (#1198)
* fix(build): set GOROOT for remote Go builds Assisted-by: GPT-5 via pi * fix(ci): avoid stdin device in remote sandboxes Assisted-by: GPT-5 via pi * fix(nvidia): keep preset heredoc inside YAML block Assisted-by: GPT-5 via pi * docs(skills): document no-/dev/stdin rule in remote sandboxes Assisted-by: Gemini 3.6 Flash via GitHub Copilot
1 parent 3375856 commit 256981a

10 files changed

Lines changed: 34 additions & 11 deletions

File tree

docs/skills/buildstream.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,7 @@ Do not cancel a build under 120 min just because it "seems slow." Historical ran
152152
### 32 fetchers is the right setting for cache.projectbluefin.io (2026-06-23)
153153

154154
`buildstream-ci.conf` uses `fetchers: 32` (BST default is 10). With default + nvidia running simultaneously = 64 concurrent gRPC streams. The CAS server is a Hetzner AX102-U (1 Gbit/s uplink, NVMe Gen4) and can serve 64 streams comfortably. The bottleneck is network bandwidth (~125 MB/s total), not server capacity. Do not reduce fetchers without evidence of server-side saturation.
155+
156+
### Avoid /dev/stdin redirection in remote sandboxes (2026-07-25)
157+
158+
BuildStream elements that write inline configuration files using `install -Dm644 /dev/stdin ... <<'EOF'` fail in remote execution sandboxes (like BuildBarn) where `/dev/stdin` is not available as a standard character device. Write inline files using a two-step pattern: create the destination file with `install -Dm644 /dev/null target`, then populate it with `cat > target <<'EOF'`.

docs/skills/packaging-go.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,7 @@ reads from the source), the Go vendor tarball must be generated offline and uplo
191191
separately. Factor in this extra maintenance step when deciding between Pattern 1 and
192192
Pattern 2 — Pattern 1 (go_module sources) is more maintainable long-term because refs
193193
can be updated in-place.
194+
### Dependent Go elements need an explicit GOROOT in remote sandboxes
195+
196+
The freedesktop-sdk Go toolchain installs its standard library under `%{libdir}/go`, but dependent elements do not inherit the toolchain element’s `GOROOT_BOOTSTRAP`. Set `GOROOT: "%{libdir}/go"` in every Dakota element that invokes `go build`; otherwise BuildBarn remote actions can fail with `go: cannot find GOROOT directory` even though the Go binary is present.
197+

elements/bluefin-nvidia/nvidia-container-toolkit-preset.bst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ variables:
1414
config:
1515
install-commands:
1616
- |
17-
install -Dm644 /dev/stdin "%{install-root}%{indep-libdir}/systemd/system-preset/80-nvidia-container-toolkit.preset" <<'PRESET'
17+
install -Dm644 /dev/null "%{install-root}%{indep-libdir}/systemd/system-preset/80-nvidia-container-toolkit.preset"
18+
cat > "%{install-root}%{indep-libdir}/systemd/system-preset/80-nvidia-container-toolkit.preset" <<'PRESET'
1819
enable nvidia-cdi-refresh.path
1920
enable nvidia-cdi-refresh.service
2021
PRESET

elements/bluefin-nvidia/nvidia-container-toolkit.bst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ build-depends:
2626
depends:
2727
- freedesktop-sdk.bst:public-stacks/runtime-minimal.bst
2828

29+
environment:
30+
GOROOT: "%{libdir}/go"
31+
2932
variables:
3033
local_ldflags: -Wl,-z,lazy
3134

elements/bluefin/common.bst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ config:
4343
cp -r bluefin-branding/system_files/etc/./ "%{install-root}%{sysconfdir}/"
4444
4545
# Default Bluefin shell MOTD to disabled, while allowing user overrides.
46-
install -Dm644 /dev/stdin "%{install-root}%{sysconfdir}/profile.d/bluefin-shell-defaults.sh" <<'EOF'
46+
install -Dm644 /dev/null "%{install-root}%{sysconfdir}/profile.d/bluefin-shell-defaults.sh"
47+
cat > "%{install-root}%{sysconfdir}/profile.d/bluefin-shell-defaults.sh" <<'EOF'
4748
: "${BLUEFIN_SHELL_ENABLE_MOTD:=0}"
4849
export BLUEFIN_SHELL_ENABLE_MOTD
4950
EOF

elements/bluefin/distrobox.bst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ variables:
1616
strip-binaries: ""
1717

1818
environment:
19+
GOROOT: "%{libdir}/go"
1920
GOARCH: "%{go-arch}"
2021

2122
config:

elements/bluefin/motd.bst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ config:
2626
- install -Dm644 template.md "%{install-root}/usr/share/ublue-os/motd/template.md"
2727
- install -Dm644 tips/10-tips.md "%{install-root}/usr/share/ublue-os/motd/tips/10-tips.md"
2828
- |
29-
install -Dm644 /dev/stdin "%{install-root}%{sysconfdir}/profile.d/bluefin-shell-defaults.sh" <<'EOF'
29+
install -Dm644 /dev/null "%{install-root}%{sysconfdir}/profile.d/bluefin-shell-defaults.sh"
30+
cat > "%{install-root}%{sysconfdir}/profile.d/bluefin-shell-defaults.sh" <<'EOF'
3031
: "${BLUEFIN_SHELL_ENABLE_MOTD:=1}"
3132
export BLUEFIN_SHELL_ENABLE_MOTD
3233
EOF

elements/bluefin/network.bst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ variables:
1010
config:
1111
install-commands:
1212
- |
13-
install -Dm644 /dev/stdin "%{install-root}%{indep-libdir}/tmpfiles.d/bluefin-network.conf" <<'EOF'
13+
install -Dm644 /dev/null "%{install-root}%{indep-libdir}/tmpfiles.d/bluefin-network.conf"
14+
cat > "%{install-root}%{indep-libdir}/tmpfiles.d/bluefin-network.conf" <<'EOF'
1415
# Symlink /etc/resolv.conf to systemd-resolved's stub resolver.
1516
# L+ removes any existing file (e.g. the empty placeholder from the base image)
1617
# so applications that read resolv.conf directly (Steam, Distrobox, etc.) get DNS.
1718
L+ /etc/resolv.conf - - - - /run/systemd/resolve/stub-resolv.conf
1819
EOF
1920
2021
- |
21-
install -Dm644 /dev/stdin "%{install-root}%{sysconfdir}/hosts" <<'EOF'
22+
install -Dm644 /dev/null "%{install-root}%{sysconfdir}/hosts"
23+
cat > "%{install-root}%{sysconfdir}/hosts" <<'EOF'
2224
127.0.0.1 localhost
2325
::1 localhost
2426
EOF

elements/bluefin/tailscale.bst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ config:
3131
mv "%{install-root}%{indep-libdir}/systemd/system/tailscaled.service.patched" \
3232
"%{install-root}%{indep-libdir}/systemd/system/tailscaled.service"
3333
- |
34-
install -Dm644 /dev/stdin "%{install-root}%{indep-libdir}/systemd/system-preset/80-tailscale.preset" <<'PRESET'
34+
install -Dm644 /dev/null "%{install-root}%{indep-libdir}/systemd/system-preset/80-tailscale.preset"
35+
cat > "%{install-root}%{indep-libdir}/systemd/system-preset/80-tailscale.preset" <<'PRESET'
3536
enable tailscaled.service
3637
PRESET
3738
- |

elements/bluefin/uupd.bst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ config:
2222
- |
2323
install -Dm755 -t "%{install-root}%{bindir}" uupd
2424
- |
25-
install -Dm644 /dev/stdin "%{install-root}%{indep-libdir}/systemd/system/uupd.service" <<'SERVICE'
25+
install -Dm644 /dev/null "%{install-root}%{indep-libdir}/systemd/system/uupd.service"
26+
cat > "%{install-root}%{indep-libdir}/systemd/system/uupd.service" <<'SERVICE'
2627
[Unit]
2728
Description=Universal Blue Update Oneshot Service
2829
StartLimitBurst=3
@@ -40,7 +41,8 @@ config:
4041
SELinuxContext=system_u:unconfined_r:unconfined_t:s0
4142
SERVICE
4243
- |
43-
install -Dm644 /dev/stdin "%{install-root}%{indep-libdir}/systemd/system/uupd.timer" <<'TIMER'
44+
install -Dm644 /dev/null "%{install-root}%{indep-libdir}/systemd/system/uupd.timer"
45+
cat > "%{install-root}%{indep-libdir}/systemd/system/uupd.timer" <<'TIMER'
4446
[Unit]
4547
Description=Auto Update System Timer For Universal Blue
4648
Wants=network-online.target
@@ -59,7 +61,8 @@ config:
5961
WantedBy=timers.target
6062
TIMER
6163
- |
62-
install -Dm644 /dev/stdin "%{install-root}%{indep-libdir}/systemd/system/uupd-manual.service" <<'MANUAL'
64+
install -Dm644 /dev/null "%{install-root}%{indep-libdir}/systemd/system/uupd-manual.service"
65+
cat > "%{install-root}%{indep-libdir}/systemd/system/uupd-manual.service" <<'MANUAL'
6366
[Unit]
6467
Description=Universal Blue Update Oneshot Service - Manual Activation
6568
StartLimitBurst=3
@@ -76,7 +79,8 @@ config:
7679
SELinuxContext=system_u:unconfined_r:unconfined_t:s0
7780
MANUAL
7881
- |
79-
install -Dm644 /dev/stdin "%{install-root}%{sysconfdir}/uupd/config.json" <<'CONFIG'
82+
install -Dm644 /dev/null "%{install-root}%{sysconfdir}/uupd/config.json"
83+
cat > "%{install-root}%{sysconfdir}/uupd/config.json" <<'CONFIG'
8084
{
8185
"checks": {
8286
"hardware": {
@@ -104,7 +108,8 @@ config:
104108
}
105109
CONFIG
106110
- |
107-
install -Dm644 /dev/stdin "%{install-root}%{sysconfdir}/polkit-1/rules.d/uupd.rules" <<'RULES'
111+
install -Dm644 /dev/null "%{install-root}%{sysconfdir}/polkit-1/rules.d/uupd.rules"
112+
cat > "%{install-root}%{sysconfdir}/polkit-1/rules.d/uupd.rules" <<'RULES'
108113
polkit.addRule(function(action, subject) {
109114
if (action.id == "org.freedesktop.systemd1.manage-units") {
110115
switch(action.lookup("unit")) {

0 commit comments

Comments
 (0)