mirror of
https://github.com/strukturag/nextcloud-spreed-signaling
synced 2026-03-14 14:35:44 +01:00
Merge pull request #956 from hosting-de-labs/feature/fix-makefile-tmp-noexec
Explicitly set TMPDIR to ensure that it is a path where go-installed utils (pe. easyjson-bootstrap) can be executed
This commit is contained in:
commit
1606a80ee1
2 changed files with 9 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,4 +1,5 @@
|
|||
bin/
|
||||
tmp/
|
||||
vendor/
|
||||
|
||||
*.pem
|
||||
|
|
|
|||
11
Makefile
11
Makefile
|
|
@ -7,6 +7,7 @@ GOFMT := "$(GODIR)/gofmt"
|
|||
GOOS ?= linux
|
||||
GOARCH ?= amd64
|
||||
GOVERSION := $(shell "$(GO)" env GOVERSION | sed "s|go||" )
|
||||
TMPDIR := $(CURDIR)/tmp
|
||||
BINDIR := $(CURDIR)/bin
|
||||
VENDORDIR := "$(CURDIR)/vendor"
|
||||
VERSION := $(shell "$(CURDIR)/scripts/get-version.sh")
|
||||
|
|
@ -76,7 +77,7 @@ endif
|
|||
hook:
|
||||
[ ! -d "$(CURDIR)/.git/hooks" ] || ln -sf "$(CURDIR)/scripts/pre-commit.hook" "$(CURDIR)/.git/hooks/pre-commit"
|
||||
|
||||
$(GOPATHBIN)/easyjson: go.mod go.sum
|
||||
$(GOPATHBIN)/easyjson: go.mod go.sum | $(TMPDIR)
|
||||
$(GO) install github.com/mailru/easyjson/...
|
||||
|
||||
$(GOPATHBIN)/protoc-gen-go: go.mod go.sum
|
||||
|
|
@ -124,7 +125,7 @@ coverhtml: vet
|
|||
|
||||
%_easyjson.go: %.go $(GOPATHBIN)/easyjson | $(PROTO_GO_FILES)
|
||||
rm -f easyjson-bootstrap*.go
|
||||
PATH="$(GODIR)":$(PATH) "$(GOPATHBIN)/easyjson" -all $*.go
|
||||
TMPDIR=$(TMPDIR) PATH="$(GODIR)":$(PATH) "$(GOPATHBIN)/easyjson" -all $*.go
|
||||
|
||||
%.pb.go: %.proto $(GOPATHBIN)/protoc-gen-go $(GOPATHBIN)/protoc-gen-go-grpc
|
||||
PATH="$(GODIR)":"$(GOPATHBIN)":$(PATH) protoc \
|
||||
|
|
@ -142,12 +143,15 @@ common: $(EASYJSON_GO_FILES) $(PROTO_GO_FILES) $(GRPC_PROTO_GO_FILES)
|
|||
# Optimize easyjson files that could call generated functions instead of duplicating code.
|
||||
for file in $(EASYJSON_FILES); do \
|
||||
rm -f easyjson-bootstrap*.go; \
|
||||
PATH="$(GODIR)":$(PATH) "$(GOPATHBIN)/easyjson" -all $$file; \
|
||||
TMPDIR=$(TMPDIR) PATH="$(GODIR)":$(PATH) "$(GOPATHBIN)/easyjson" -all $$file; \
|
||||
done
|
||||
|
||||
$(BINDIR):
|
||||
mkdir -p "$(BINDIR)"
|
||||
|
||||
$(TMPDIR):
|
||||
mkdir -p "$(TMPDIR)"
|
||||
|
||||
client: $(BINDIR)/client
|
||||
|
||||
$(BINDIR)/client: go.mod go.sum $(CLIENT_GO_FILES) $(COMMON_GO_FILES) | $(BINDIR)
|
||||
|
|
@ -168,6 +172,7 @@ clean:
|
|||
rm -f "$(BINDIR)/client"
|
||||
rm -f "$(BINDIR)/signaling"
|
||||
rm -f "$(BINDIR)/proxy"
|
||||
rm -rf "$(TMPDIR)"
|
||||
|
||||
clean-generated: clean
|
||||
rm -f $(EASYJSON_GO_FILES) $(PROTO_GO_FILES) $(GRPC_PROTO_GO_FILES)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue