Skip to content

Commit

Permalink
Don't require MSYS2 Python to be available in Windows CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsmith committed Jul 20, 2023
1 parent 7b85ec0 commit 0fd9b9e
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions product/runtime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,23 @@ if (osName == "windows") {
}

String pythonHome
new ByteArrayOutputStream().withStream { output ->
exec {
executable pyPlusVersionExe
args "-c", "import sys; print(sys.base_prefix)"
standardOutput = output
if (osName == "windows" && System.getenv("CI") != null) {
// All the tasks that use pythonHome require MSYS2 Python on Windows, but we don't
// install that in CI because we don't run any of those tasks. TODO: fix this by
// moving to the standard Windows Python builds.
pythonHome = "disabled/in/CI"
} else {
new ByteArrayOutputStream().withStream { output ->
exec {
executable pyPlusVersionExe
args "-c", "import sys; print(sys.base_prefix)"
standardOutput = output
}
pythonHome = output.toString().trim()
}
pythonHome = output.toString().trim()
}



void addArtifact(Task task, Object filename, String pyVersion=null, String abi=null) {
File f = file(filename)
def dotPos = f.name.lastIndexOf(".")
Expand Down

0 comments on commit 0fd9b9e

Please sign in to comment.