aboutsummaryrefslogtreecommitdiff
path: root/build.go
diff options
context:
space:
mode:
authorVladimir Rusinov <vladimir.rusinov@gmail.com>2021-06-27 16:59:02 +0100
committerGitHub <noreply@github.com>2021-06-27 17:59:02 +0200
commit7a4c6d262f121cd63502c1065cd9276bf66124aa (patch)
treed4506096313dd0ca53e1fe7808e80a750ec6200a /build.go
parent445a82f1205890dceb366a4d0e21e9f920c4d5f5 (diff)
downloadsyncthing-7a4c6d262f121cd63502c1065cd9276bf66124aa.tar.gz
syncthing-7a4c6d262f121cd63502c1065cd9276bf66124aa.zip
build: Remove no longer used temporaryBuildDir (#7795)
Diffstat (limited to 'build.go')
-rw-r--r--build.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/build.go b/build.go
index 9b3f7ddbd..dd6105674 100644
--- a/build.go
+++ b/build.go
@@ -14,7 +14,6 @@ import (
"bytes"
"compress/flate"
"compress/gzip"
- "crypto/sha256"
"encoding/json"
"errors"
"flag"
@@ -1382,32 +1381,6 @@ func metalintShort() {
runPrint(goCmd, "test", "-short", "-run", "Metalint", "./meta")
}
-func temporaryBuildDir() (string, error) {
- // The base of our temp dir is "syncthing-xxxxxxxx" where the x:es
- // are eight bytes from the sha256 of our working directory. We do
- // this because we want a name in the global temp dir that doesn't
- // conflict with someone else building syncthing on the same
- // machine, yet is persistent between runs from the same source
- // directory.
- wd, err := os.Getwd()
- if err != nil {
- return "", err
- }
- hash := sha256.Sum256([]byte(wd))
- base := fmt.Sprintf("syncthing-%x", hash[:4])
-
- // The temp dir is taken from $STTMPDIR if set, otherwise the system
- // default (potentially infrluenced by $TMPDIR on unixes).
- var tmpDir string
- if t := os.Getenv("STTMPDIR"); t != "" {
- tmpDir = t
- } else {
- tmpDir = os.TempDir()
- }
-
- return filepath.Join(tmpDir, base), nil
-}
-
func (t target) BinaryName() string {
if goos == "windows" {
return t.binaryName + ".exe"