Skip to content

Commit 5f9b22f

Browse files
committed
Merge branch version/0-47-1-RC1 to adopt changes from PR ActiveState#3651
2 parents 133121b + 156b56b commit 5f9b22f

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

pkg/buildscript/marshal.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const (
2222
ltFuncName = "Lt"
2323
lteFuncName = "Lte"
2424
andFuncName = "And"
25+
anyFuncName = "Any"
2526
)
2627

2728
// Marshal returns this structure in AScript, suitable for writing to disk.

pkg/buildscript/marshal_buildexpression.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ func marshalReq(fn *funcCall) ([]byte, error) {
153153
return errs.Wrap(err, "Could not marshal additional requirement")
154154
}
155155
}
156+
case anyFuncName:
157+
// We can ignore the `version = Any()` argument; omitting it is an equivalent statement.
158+
// As mentioned in this function's comment, once buildexpressions support requirements as
159+
// functions, we won't need to do any of this anymore.
156160
default:
157161
return errs.New("Unknown version comparator: %s", name)
158162
}

test/integration/buildscript_int_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,30 @@ main = wheel
162162
suite.Contains(files, "sample_activestate-1.0.0.dist-info/WHEEL")
163163
}
164164

165+
func (suite *BuildScriptIntegrationTestSuite) TestBuildScriptRequirementVersionAny() {
166+
suite.OnlyRunForTags(tagsuite.BuildScripts)
167+
ts := e2e.New(suite.T(), false)
168+
defer ts.Close()
169+
170+
cp := ts.Spawn("config", "set", constants.AsyncRuntimeConfig, "true")
171+
cp.ExpectExitCode(0)
172+
173+
// Enable as part of DX-3230.
174+
//cp = ts.Spawn("config", "set", constants.OptinBuildscriptsConfig, "true")
175+
//cp.ExpectExitCode(0)
176+
177+
// This project's build expression has a requirement whose version is the "Any()" function.
178+
// Make sure we can successfully checkout and modify this project.
179+
// Previously, no version would be given for such a requirement.
180+
cp = ts.Spawn("checkout", "ActiveState/python3-MacOS#b6aac9cf-a758-42d6-9574-78ec513ad8e9", ".")
181+
cp.Expect("Checked out project")
182+
cp.ExpectExitCode(0)
183+
184+
cp = ts.Spawn("install", "dotenv")
185+
cp.Expect("Added: language/python/dotenv@Auto")
186+
cp.ExpectExitCode(0)
187+
}
188+
165189
func TestBuildScriptIntegrationTestSuite(t *testing.T) {
166190
suite.Run(t, new(BuildScriptIntegrationTestSuite))
167191
}

0 commit comments

Comments
 (0)