bitter-ability-32190
02/05/2022, 1:43 AM./pants
./pants
, and then visit the whole repo on how best to "print" the bin name (E.g. an OS env var)sys.argv
(if it's set)happy-kitchen-89482
02/05/2022, 5:26 AMcurved-television-6568
02/05/2022, 7:13 AMpants
without the dot-slash prefix. At least as a possible alternative..bitter-ability-32190
02/05/2022, 1:45 PMpants
as it is the name of the module executing. However, that's likely more confusing.hundreds-father-404
02/05/2022, 2:27 PMPANTS_BIN
that you can use consistently, regardless of help
message vs error message etc. Maybe we can if we'd consider dropping the proper global option and instead inspecting sys.argv[0]
?/Users/ericarellano/code/pants/src/python/pants/bin/pants_loader.py
.
So I think the solution would be to use env var, and drop the option. Also note that the bash script we distribute ./pants
is setting --pants-bin-name="${PANTS_BIN_NAME}"
. We'd need to update it to do export PANTS_BIN_NAME
instead. It's nice that that script has this line PANTS_BIN_NAME="${PANTS_BIN_NAME:-$0}"
./pants help
. Any ideas where we would mention this? In the ./pants
bash script itself via comment works, along with maybe https://www.pantsbuild.org/v2.10/docs/existing-repositories#migrating-from-other-build-tools-set-custom-build-file-names. And maybe when we first introduce the script at https://www.pantsbuild.org/v2.10/docs/installation#creating-the-launch-script via an info toolboxhappy-kitchen-89482
02/05/2022, 3:44 PMbitter-ability-32190
02/05/2022, 4:28 PM"./pants"
except for some whitelisted codehappy-kitchen-89482
02/05/2022, 10:05 PMbitter-ability-32190
02/05/2022, 10:59 PMhappy-kitchen-89482
02/06/2022, 1:56 AMbitter-ability-32190
02/06/2022, 2:09 AM./pants
where we previously weren't ๐hundreds-father-404
02/06/2022, 3:42 AMregister.bootstrap.pants_bin.name
or requesting PantsBinName
as a parameter to your rule. It's verbose and not consistent.
2. It would be convenient to have one consistent way to access the value, a constant like PANTS_BIN
. Similar to how we have VERSION
3. To get that constant to work, it can't consume the options system. So instead, consume an env varhappy-kitchen-89482
02/06/2022, 4:45 PMhundreds-father-404
02/06/2022, 5:03 PMpants_name()
that will lazily read in the env var. That seems good
The key thing I care about is having one single, ergonomic way to get the value. No need to pass in bootstrap optionsbitter-ability-32190
02/06/2022, 5:31 PMhappy-kitchen-89482
02/06/2022, 6:02 PMbitter-ability-32190
02/08/2022, 5:47 PM