https://pantsbuild.org/ logo
#general
Title
# general
j

jolly-midnight-72759

08/25/2020, 12:21 AM
Are the following variables still available in the
pants.toml
and other config files for versions 1.27 to 1.30 (V1 engine for now)?
Copy code
# All of the following are seeded with defaults in the config
#   user: the current user
#   homedir: the current user's home directory
#   buildroot: the root of this repo
#   pants_bootstrapdir: the global pants scratch space primarily used for caches
#   pants_configdir: the global pants storage for config files
#   pants_distdir: user visible artifacts for this repo go here
#   pants_workdir: the scratch space used to for live builds in this repo
Nevermind. I checked out v1.27 and see that the
pants.toml
file defines everything I need
👖
h

hundreds-father-404

08/25/2020, 1:14 AM
Yep :) we had to implement our own interpolation logic, which was actually a really fun thing to implement hehe. See config.py if you’re curious
j

jolly-midnight-72759

08/25/2020, 1:20 AM
🙂
in related news. I keep having trouble with
local_artifact_cache
. I have the exact same config as the tag:v1.27
pants.toml
file but I'm getting the error
Exception message: Bad value substitution: option 'read_from' in section 'cache.bootstrap' contains an interpolation key 'local_artifact_cache' which is not a valid option name. Raw value: '%(local_artifact_cache)s'
. And this file doesn't exist in the v1.30 repo. I'm thinking maybe I should delete it.
excuse my shaving the yak out loud. ✂️
h

happy-kitchen-89482

08/25/2020, 5:44 AM
So you define
local_artifact_cache
in your
[DEFAULT]
section and try to use it in an interpolation, but it doesn't allow it?
Hmm, @hundreds-father-404 in pants.toml do we not support interpolating from values previously defined in the same file?
h

hundreds-father-404

08/25/2020, 6:39 AM
We do allow it. You should be able to interpolate from a value in the same section, from a value in the DEFAULT section, or from one of our predefined values. This was broken for a release or two, but I think only in dev releases. I think we fixed it by the stable release
j

jolly-midnight-72759

08/25/2020, 2:15 PM
Actually. I had moved it to
[GENERAL]
when I made the switch to TOML. Let me try it in
[DEFAULT]
.
👍 1
That was it. It doesn't error out and I was able to define
cache.boostrap
section again.
I believe for the INI file, the default section is supposed to define key/values that can be overridden in individual sections. I have not read if this is the case for TOML, too. I guess
local_articact_cache
is more like a variable or marcro. Is that why it needs to be in
[DEFAULT]
?
h

hundreds-father-404

08/25/2020, 3:25 PM
If you define it in DEFAULT, then yes, it’s like a macro, but it also attempts to set the key-value pair for every section of that option name is valid for the section. So, you can either set the key value pair in DEFAULT, or you can use a key name that isn’t an actual option name, and reference that key using string interpolation
👍🏽 1
4 Views