I'm trying to set `named_caches_dir` and `local_st...
# general
s
I'm trying to set
named_caches_dir
and
local_store_dir
in my
pants.ci.toml
. I have
PANTS_CONFIG_FILES=pants.ci.toml
set an environment variable in my CI, but when I look at
./pants help-advanced global
(again in my CI) I see
Copy code
local_store_dir
      default: /root/.cache/pants/lmdb_store
      current value: /root/.cache/pants/lmdb_store
In my
pants.ci.toml
I have
Copy code
[GLOBAL]
pantsd = true
named_caches_dir = "/codefresh/volume/.cache/pants/named_caches"
local_store_dir = "/codefresh/volume/.cache/pants/lmdb_store"
In
pants.toml
I have
Copy code
[GLOBAL]
pants_version = "2.14.1"
I can sanity check
Copy code
root@codefresh:/codefresh/volume/archipelago$ echo $PANTS_CONFIG_FILES
pants.ci.toml
and
ls /codefresh/volume/.cache/pants
only shows
setup
. If I run
./pants test capstan/:: --local-store-dir=/codefresh/volume/.cache/pants/lmdb_store
I see
lmdb_store
. when I
ls
. Am I doing something wrong, I'm not sure why my configuration isn't getting picked up
1
h
That looks to me like it should work
So time to debug. For example, try this in CI:
./pants --pants-config-files=pants.ci.toml help-advanced global
to see if the issue is with the env var.
s
edit - To add context. After running the above command I see
Copy code
--local-store-dir=<str>
  PANTS_LOCAL_STORE_DIR
  local_store_dir
      default: /root/.cache/pants/lmdb_store
      current value: /root/.cache/pants/lmdb_store
      Directory to use for the local file store, which stores the results of
      subprocesses run by Pants.
FYI I also had to run
Copy code
stty rows 50 cols 80
which I learned from https://github.com/CircleCI-Public/gcp-cli-orb/issues/36 but I guess one thing at a time
Here's a sanity check that's failing
Copy code
root@codefresh:/codefresh/volume/archipelago$ cat pants.ci.toml 
[GLOBAL]
pantsd = false
my CI is lying to me Edit - I forked a repo to play around with CI and it looks like the other repo was hardcoded in the clone step. I didn't know that was there! I was under the impression it'd clone my forked repo because that's the repo I used when creating the pipeline.
Heh I'm tempted to just delete this whole post to save face 🙃
Good news is
ls
is doing what I expect now
Copy code
drwxr-xr-x. 5 root root 57 Mar 17 23:39 .                                                                                         
drwxr-xr-x. 3 root root 19 Mar 17 22:11 ..                                                                                        
drwxr-xr-x. 5 root root 51 Mar 17 23:03 lmdb_store                                                                                
drwxr-xr-x. 3 root root 22 Mar 17 23:39 named_caches                                                                              
drwxr-xr-x. 3 root root 36 Mar 17 22:11 setup
h
Glad you figured it out!