Search code examples
jenkinsjenkins-pluginsartifactoryconan

Jenkins Artifactory Plugin with ConanClient: huge BuildInfo refering unrelated packages returned by ConanClient


for some reason the BuildInfo object returned by the ConanClient.run() method contains references to a lot of unrelated Conan Packages as "modules". It seems these packages were also built on the same Jenkins slave but of course in different jobs.

This is a minimal example leading to the huge BuildInfo being published to the Artifactory:

def conanUploadClient = Artifactory.newConanClient()
def buildInfoTest = conanUploadClient.run command: "upload ${aliasID} -r ${remoteName}".toString()
artifactoryServer.publishBuildInfo buildInfoTest

All other previous Conan commands like conan install were executed with another ConanClient instance to make sure the wrong info about the unrelated packages is not carried over from these operations.

Here is a "control experiment" leading to a BuildInfo without any associated Conan Packages/"modules" being published to the Artifactory.

def conanUploadClient = Artifactory.newConanClient()
def buildInfoTest = Artifactory.newBuildInfo()
artifactoryServer.publishBuildInfo buildInfoTest

Where could this wrong information from other builds come from?

Conan 1.8.2, Windows 10, Jenkins Artifactory Plugin 2.16.2


Solution

  • It seems the Jenkins Plugin reads in the entire $CONAN_USER_HOME/conan_log.log and puts it into the BuildInfo returned by the ConanClient.run(). I removed the file before the build and the info is ok now.