Skip to content

Commit 7474d49

Browse files
authored
Merge pull request ActiveState#3392 from ActiveState/DX-2738-fix
UpdateByReference respect async runtimes
2 parents 71944be + ba26f1e commit 7474d49

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

internal/runbits/requirements/requirements.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/ActiveState/cli/internal/prompt"
2424
"github.com/ActiveState/cli/internal/rtutils/ptr"
2525
"github.com/ActiveState/cli/internal/runbits"
26-
"github.com/ActiveState/cli/internal/runbits/buildscript"
26+
buildscript_runbit "github.com/ActiveState/cli/internal/runbits/buildscript"
2727
"github.com/ActiveState/cli/internal/runbits/dependencies"
2828
"github.com/ActiveState/cli/internal/runbits/rationalize"
2929
runbit "github.com/ActiveState/cli/internal/runbits/runtime"
@@ -281,7 +281,7 @@ func (r *RequirementOperation) ExecuteRequirementOperation(ts *time.Time, requir
281281
}
282282

283283
// refresh or install runtime
284-
err = runbit.UpdateByReference(rt, rtCommit, r.Auth, r.Project, r.Output, runbit.OptMinimalUI)
284+
err = runbit.UpdateByReference(rt, rtCommit, r.Auth, r.Project, r.Output, r.Config, runbit.OptMinimalUI)
285285
if err != nil {
286286
if !runbits.IsBuildError(err) {
287287
// If the error is not a build error we want to retain the changes

internal/runbits/runtime/refresh.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,16 @@ func UpdateByReference(
176176
auth *authentication.Auth,
177177
proj *project.Project,
178178
out output.Outputer,
179+
cfg Configurable,
179180
opts Opts,
180181
) (rerr error) {
181182
defer rationalizeError(auth, proj, &rerr)
182183

184+
if cfg.GetBool(constants.AsyncRuntimeConfig) {
185+
logging.Debug("Skipping runtime update due to async runtime")
186+
return nil
187+
}
188+
183189
if rt.NeedsUpdate() {
184190
if !bitflags.Has(opts, OptMinimalUI) {
185191
if !rt.HasCache() {

internal/runners/checkout/checkout.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (u *Checkout) Run(params *Params) (rerr error) {
112112
return errs.Wrap(err, "Could not checkout project")
113113
}
114114
dependencies.OutputSummary(u.out, commit.BuildPlan().RequestedArtifacts())
115-
err = runtime.UpdateByReference(rti, commit, u.auth, proj, u.out, runtime.OptNone)
115+
err = runtime.UpdateByReference(rti, commit, u.auth, proj, u.out, u.config, runtime.OptNone)
116116
if err != nil {
117117
return errs.Wrap(err, "Could not setup runtime")
118118
}

internal/runners/initialize/init.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"regexp"
88
"strings"
99

10-
"github.com/ActiveState/cli/internal/runbits/buildscript"
10+
buildscript_runbit "github.com/ActiveState/cli/internal/runbits/buildscript"
1111
"github.com/ActiveState/cli/internal/runbits/errors"
1212
"github.com/ActiveState/cli/internal/runbits/runtime"
1313
"github.com/ActiveState/cli/pkg/platform/model/buildplanner"
@@ -292,7 +292,7 @@ func (r *Initialize) Run(params *RunParams) (rerr error) {
292292
return errs.Wrap(err, "Could not initialize runtime")
293293
}
294294
dependencies.OutputSummary(r.out, commit.BuildPlan().RequestedArtifacts())
295-
err = runtime.UpdateByReference(rti, commit, r.auth, proj, r.out, runtime.OptNone)
295+
err = runtime.UpdateByReference(rti, commit, r.auth, proj, r.out, r.config, runtime.OptNone)
296296
if err != nil {
297297
return errs.Wrap(err, "Could not setup runtime after init")
298298
}

0 commit comments

Comments
 (0)