devrandom / gitian-builder

Build packages in a secure deterministic fashion inside a VM
https://gitian.org/
Other
400 stars 226 forks source link

Enable use of USE_* variables with values 0 or 1 #254

Closed AbcSxyZ closed 2 years ago

AbcSxyZ commented 3 years ago

Problematic

When you're using USE_DOCKER, USE_LXC or USE_VBOX, if you specify mutliple variables you're going slowly to some undefined behavior.

Also, if you set a variable with the value 0, USE_LXC = 0 the software will see it as using LXC because it's checking if the variable is set whatever the value is.

Suggestion

I added some value check when those variables are used, mainly checking if the value is equal 1. This allow users to specify USE_* with the value 0 or 1 and to set multiple variables at once with less conflict.

But still some undefined behavior, like what happen if multiple variables are set to 1.