From a478b734fd7d93ea30a1de2210c3160e185a06f7 Mon Sep 17 00:00:00 2001 From: "Andrew Jackson (Ajax)" Date: Mon, 11 Dec 2023 23:15:41 -0600 Subject: [PATCH] build-env: unable to exit from deps --- cmd/lotus-provider/deps/deps.go | 5 +---- cmd/lotus-provider/main.go | 6 +++--- cmd/lotus-provider/run.go | 10 +++++++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/cmd/lotus-provider/deps/deps.go b/cmd/lotus-provider/deps/deps.go index 13b83b83d..9a0a3691f 100644 --- a/cmd/lotus-provider/deps/deps.go +++ b/cmd/lotus-provider/deps/deps.go @@ -106,10 +106,6 @@ const ( ) func (deps *Deps) PopulateRemainingDeps(ctx context.Context, cctx *cli.Context, makeRepo bool) error { - - if deps == nil { - *deps = Deps{} - } var err error if makeRepo { // Open repo @@ -242,6 +238,7 @@ Get it with: jq .PrivateKey ~/.lotus-miner/keystore/MF2XI2BNNJ3XILLQOJUXMYLUMU`, deps.Maddrs = append(deps.Maddrs, dtypes.MinerAddress(addr)) } } + fmt.Println("last line of populate") return nil } diff --git a/cmd/lotus-provider/main.go b/cmd/lotus-provider/main.go index 48ff70122..18b2e87f3 100644 --- a/cmd/lotus-provider/main.go +++ b/cmd/lotus-provider/main.go @@ -5,7 +5,7 @@ import ( "fmt" "os" "os/signal" - "runtime/debug" + "runtime/pprof" "syscall" "github.com/fatih/color" @@ -29,8 +29,8 @@ func SetupCloseHandler() { go func() { <-c fmt.Println("\r- Ctrl+C pressed in Terminal") - debug.PrintStack() - os.Exit(1) + pprof.Lookup("goroutine").WriteTo(os.Stdout, 1) + panic(1) }() } diff --git a/cmd/lotus-provider/run.go b/cmd/lotus-provider/run.go index f58d0c939..8e7d5ad79 100644 --- a/cmd/lotus-provider/run.go +++ b/cmd/lotus-provider/run.go @@ -113,14 +113,18 @@ var runCmd = &cli.Command{ } } - var deps deps.Deps - err = deps.PopulateRemainingDeps(ctx, cctx, true) + fmt.Println("before populateRemainingDeps") + dependencies := &deps.Deps{} + err = dependencies.PopulateRemainingDeps(ctx, cctx, true) + fmt.Println("after popdeps") if err != nil { + fmt.Println("err", err) return err } - dependencies := &deps + fmt.Println("ef") taskEngine, err := tasks.StartTasks(ctx, dependencies) + fmt.Println("gh") if err != nil { return nil