build-info
build-info copied to clipboard
Regression: PipInstall fails when envActivation is provided
Describe the bug
Triggered by #677
When an envActivation is given to PipInstall, a PipDriver is created with the command set to envActivation + " && pip".
PipDriver then forwards this to CommandExecutor, setting the executablePath to the said value.
CommandExecutor escapes the spaces, treating the whole string like a single executable.
e.g. /bin/sh -c source\ env/bin/activate\ &&\ pip"
To Reproduce Using a Jenkins Pipeline with the Artifactory plugin version 3.18.0, eg
pipeline {
stages {
stage('Pip Install') {
steps {
sh 'python3 -m venv env'
rtPipResolver (
id: 'PipResolver',
serverId: 'my-server',
repo: 'my-repo'
)
rtPipInstall(
resolverId: 'PipResolver',
args: 'pytest black',
envActivation: '. env/bin/activate'
}
}
}
}
Expected behavior Users should be able to pass an envActivation to PipInstall.
Example Failure on Jenkins Note the escaped spaces.
INFO: Executing command: /bin/sh -c .\ env/bin/activate\ &&\ pip install .[dev] build -i https://myartifactory.com/pip-local/simple
org.jfrog.build.extractor.packageManager.PackageManagerLogger error
SEVERE: pip install failed: /bin/sh: . env/bin/activate : not found
java.io.IOException: pip install failed: /bin/sh: . env/bin/activate : not found
at org.jfrog.build.extractor.pip.PipDriver.install(PipDriver.java:36)
at org.jfrog.build.extractor.pip.extractor.PipInstall.execute(PipInstall.java:98)
at org.jfrog.build.extractor.packageManager.PackageManagerExtractor.executeAndSaveBuildInfo(PackageManagerExtractor.java:33)
at org.jfrog.build.extractor.pip.extractor.PipInstall.main(PipInstall.java:85)
Caused by: java.io.IOException: /bin/sh: . env/bin/activate : not found
Versions
- Extractor version: 2.39.0
- Operating system: Alpine Linux Docker container on Linux
- Artifactory Jenkins Plugin Version: 3.18.0
Any chance this will get traction?
+1 we have got the same issue after recently upgrading our Jenkins Artifactory plugin.
I'm actually somewhat shocked that this issue doesn't have more comments and upvotes - the primary use case (afaik) for including an envActivation param in a rtPipInstall build step is completely broken by this bug.
JFrog recommends switching to the JFrog Jenkins plugin, which is a simple wrapper around the JFrog CLI tool. We have done so, and I'd recommend it too, since it's more feature rich, is actively developed, and allows one to more easily run the same code both in the Jenkinsfile and the command line.
That said, this should still be fixed!