-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make clean test: sometimes fails on version.go #874
Comments
It's a Makefile parallel job race due to insufficient dependencies. The problem is more deterministic when you put a sleep in there: --- a/Makefile
+++ b/Makefile
@@ -66,4 +66,5 @@ lib-typecheck: | lib/node_modules
cmd/esbuild/version.go: version.txt
+ sleep 5 # for debugging only
node -e 'console.log(`package main\n\nconst esbuildVersion = "$(ESBUILD_VERSION)"`)' > cmd/esbuild/version.go
@@ -236,4 +237,5 @@ publish-neutral: platform-neutral
clean:
rm -f esbuild
+ rm -f cmd/esbuild/version.go
rm -f npm/esbuild-windows-32/esbuild.exe
rm -f npm/esbuild-windows-64/esbuild.exe fix: --- a/Makefile
+++ b/Makefile
@@ -20,11 +20,12 @@ check-go-version:
@go version | grep ' go1\.16 ' || (echo 'Please install Go version 1.16.0' && false)
-test-go:
- go test -race ./internal/...
+RACE ?= "-race"
+test-go: cmd/esbuild/version.go
+ go test $(RACE) ./internal/...
-vet-go:
+vet-go: cmd/esbuild/version.go
go vet ./cmd/... ./internal/... ./pkg/...
-fmt-go:
+fmt-go: cmd/esbuild/version.go
go fmt ./cmd/... ./internal/... ./pkg/...
@@ -236,4 +237,5 @@ publish-neutral: platform-neutral
clean:
rm -f esbuild
+ rm -f cmd/esbuild/version.go
rm -f npm/esbuild-windows-32/esbuild.exe
rm -f npm/esbuild-windows-64/esbuild.exe Side note: @evanw I'd appreciate it if you added the |
That's strange. I've never experienced this personally. I'm guessing it's something to do with the file not being updated atomically? I'm also confused about why that is even running at all because
This file is not deleted during |
Thanks!! |
Hello, this is what I've observed several times on my Linux amd64 workstation with
go1.16
.Then when I run
make clean test
again, it works.The text was updated successfully, but these errors were encountered: