]> Cypherpunks.ru repositories - goredo.git/commitdiff
Do not acquire job token when exiting top level instance
authorSergey Matveev <stargrave@stargrave.org>
Wed, 23 Jun 2021 11:38:27 +0000 (14:38 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 23 Jun 2021 11:38:27 +0000 (14:38 +0300)
ifchange.go
main.go

index 0f430fdebd76741065215382cb76ee406690e3fe..3a0ebf395211943178ea72d5442a71c4e6bd6408 100644 (file)
@@ -180,7 +180,9 @@ RebuildDeps:
 
 func ifchange(tgts []string, forced, traced bool) (bool, error) {
        jsInit()
-       defer jsAcquire("ifchange exiting")
+       if !IsTopRedo {
+               defer jsAcquire("ifchange exiting")
+       }
        defer Jobs.Wait()
        seen := buildDependants(tgts)
        oodTgtsClear()
diff --git a/main.go b/main.go
index 8c9c16da1430a761779856688da8382b82a98e18..860d63a5bd43f315a97350ca6efeaf729a332662 100644 (file)
--- a/main.go
+++ b/main.go
@@ -40,6 +40,7 @@ import (
 var (
        Cwd       string
        BuildUUID string
+       IsTopRedo bool // is it the top redo instance
 )
 
 func mustSetenv(key, value string) {
@@ -229,6 +230,7 @@ func main() {
        BuildUUID = os.Getenv(EnvBuildUUID)
        tgtsWasEmpty := len(tgts) == 0
        if BuildUUID == "" {
+               IsTopRedo = true
                raw := new([16]byte)
                if _, err = io.ReadFull(rand.Reader, raw[:]); err != nil {
                        log.Fatalln(err)