Skip to content

Commit 15d947a

Browse files
committed
Fix build issues
1 parent ddc5a3f commit 15d947a

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ covunit: ## Run unit tests with coverage and the race detector
9595
> rm -rf $(OPENRUN_HOME)/coverage/unit && mkdir -p $(OPENRUN_HOME)/coverage/unit
9696
> packages="$(GO_PACKAGES)"
9797
> cover_packages="$(GO_COVER_PACKAGES)"
98-
> go test -race -coverpkg "$$cover_packages" $$packages -args -test.gocoverdir="$(OPENRUN_HOME)/coverage/unit"
98+
> go test -race -covermode=atomic -coverpkg "$$cover_packages" $$packages -args -test.gocoverdir="$(OPENRUN_HOME)/coverage/unit"
9999
> go tool covdata percent -i=$(OPENRUN_HOME)/coverage/unit
100100
> go tool covdata textfmt -i=$(OPENRUN_HOME)/coverage/unit -o $(OPENRUN_HOME)/coverage/profile
101101
> go tool cover -func coverage/profile | grep '^total:'

deploy/obs/update_obs.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ mv "$WORK/embed.go" internal/server/list_apps/embed.go
5454
rm -rf apps
5555

5656
# Distro toolchains lag behind Go patch releases; the minor version is what
57-
# actually gates the language level, so drop the patch from the main module and
58-
# local module dependencies before creating vendor metadata.
57+
# actually gates the language level, so relax the patch to .0 in the main
58+
# module and local module dependencies before creating vendor metadata. The
59+
# .0 form (not a bare major.minor) is required: go mod vendor rejects a go.mod
60+
# whose go directive is not in the canonical three-part form.
5961
echo "==> Relaxing go.mod patch version and vendoring modules"
6062
for mod_file in go.mod pkg/binding/go.mod; do
61-
sed -E 's/^go ([0-9]+\.[0-9]+)\.[0-9]+$/go \1/' "$mod_file" > "$mod_file.new"
63+
sed -E 's/^go ([0-9]+\.[0-9]+)\.[0-9]+$/go \1.0/' "$mod_file" > "$mod_file.new"
6264
mv "$mod_file.new" "$mod_file"
6365
done
6466
GOTOOLCHAIN=local go mod vendor

tests/run_cli_tests.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,10 @@ else
197197
fi
198198

199199
if [[ -n "$GOCOVERDIR" ]]; then
200-
go build -cover ./cmd/openrun
200+
# atomic, not the default set: covtest merges this binary's coverage
201+
# data with the unit test data, which is atomic mode (covunit runs with
202+
# -race), and covdata rejects mixed counter modes
203+
go build -cover -covermode=atomic ./cmd/openrun
201204
else
202205
go build ./cmd/openrun
203206
fi

0 commit comments

Comments
 (0)