Bug #4243

master-simtrace2 failed to build from October 19 onwards: $WORKSPACE environment missing

Added by laforge about 1 year ago. Updated about 1 year ago.

Target version:
Start date:
Due date:
% Done:


Spec Reference:


When we write a "contrib/" job, we assume that all the jenkins environment variables as documented at are available to the script. In the specific case, $WORKSPACE was used, which failed after the job had been moved inside docker.

I think it's generally a good idea to make sure all the jenkins environment variables as described at the link above are passed into the docker container, so authors of contrib/ don't have to consider undocumented osmocom-docker-specific restrictions but can use the normal set of environment variables..

For $WORKSPACE, it's questionable what to do. Probably best we mount it into the docker container, and then specify that mount point as "-e WORKSPACE"?


#1 Updated by osmith about 1 year ago

I would prefer if scripts tried to avoid using these variables. Because the more jenkins specific variables they use, the more effort it is to run the script locally, outside of jenkins, for testing (as one has to provide dummy values for all of them). And the more room there is for errors, when getting one of the variables wrong and having the script potentially taking a different code path.

With that in mind, I would not pass any of these variables to docker.

Is that fine with you?

#2 Updated by laforge about 1 year ago

you have a valid point. However, the problem is we then have to specify what kind of assumptions we can make when writing those scripts. For example, using "/build" suffers from exactly the same problem as you describe, just that instead of $WORKSPACE (which you as the user can override) you now have to locally create a /build directory and give write permissions for your local user to it :/

#3 Updated by osmith about 1 year ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 90

I have updated the wiki page "Jenkins build verification jobs" to list all available environment variables:

Here is a patch to add it to the yml files, so we remember to keep them in sync:

#4 Updated by osmith about 1 year ago

  • Status changed from In Progress to Resolved
  • % Done changed from 90 to 100

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)