Differentiating between errors in `conda build --test` and build skips
Some of our packages need to skip the build in certain architecture combinations. E.g. bob.ip.mtcnn should be skipped on everything but linux.
In order to detect this, I implemented the following condition:
$ pkgname=$(conda build ... --output conda)
$ if [ -z "${pkgname}" ]; then echo "Build is going to be skipped..."; else echo "Runs the build"; fi
This has been working fine on the nightlies, where we build all packages and must skip some. Example:
https://gitlab.idiap.ch/bob/bob.nightlies/-/jobs/150738/raw
(look for the pattern is NOT supposed to be built for
)
The problem is that if there is an error in the $(conda build ... --output conda)
command, then it still exits with status 0 and returns empty.
In this case an error must be signed instead of just skipping the build. This is a problem, for example, when connectivity is down. See an example build that is supposed to fail (network error) and passes with a build skip:
https://gitlab.idiap.ch/beat/beat.core/-/jobs/150701
I tested locally by adding a skip: true
line in the build section of a/any package and running conda build ... --output conda
on it:
``sh $ #edit conda/meta.yaml, add "skip: true" in the build section $ conda build ../bob/bob.admin/conda/conda-build.sh --test --output --python=3.6 conda
$ echo $? 0 ``
Now I turn off the network on my computer, to provoke an error:
$ conda build ... --output conda
WARNING:urllib3.connectionpool:Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x109753e48>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',)': /pkgs/main/osx-64/repodata.json.bz2
WARNING:urllib3.connectionpool:Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x10975f080>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',)': /pkgs/main/osx-64/repodata.json.bz2
WARNING:urllib3.connectionpool:Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x10975f128>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',)': /pkgs/main/osx-64/repodata.json.bz2
Returning non-final recipe for a.b.c; one or more dependencies was unsatisfiable:
Build: None
Host: python, setuptools
WARNING:conda_build.render:Returning non-final recipe for a.b.c; one or more dependencies was unsatisfiable:
Build: None
Host: python, setuptools
/Users/user/conda/conda-bld/osx-64/a.b.c-py36h51fb0fc_0.tar.bz2
$ echo $?
0
So, is there a way to check for this correctly? @amohammadi: any suggestions?