Hi! I’m trying to use pants in an airgapped CI. I’...
# general
b
Hi! I’m trying to use pants in an airgapped CI. I’m following the instructions in https://www.pantsbuild.org/docs/proxies I have the
pex
dependency stored under a
pants_files
directory at the root of my repo. What should my
pants.toml
look like for
pants
to use the local
pex
file instead of downloading it form the internet? This does not work
Copy code
[download-pex-bin]
url_template="<file://pants_files/pex>"
It fails with
Copy code
Exception: Error (No such file or directory (os error 2)) opening file at /pex for download to pex
w
oof… it looks like there are some gaps there.
one second.
h
Hello! That needs to be an absolute path, I believe. Does it work if you use the absolute path to
pants_files/pex
? If that works, you can use
%(buildroot)s
to interpolate the absolute path to your build root, like
file://%(buildroot)s/pants_files/pex
I think
w
@hundreds-father-404: looks like it also assumes a hostname
👀 1
@brave-furniture-86963: as Eric said, the path will need to be absolute via the buildroot
but additionally, you apparently need an ignored token above that
so:
Copy code
[download-pex-bin]
url_template = "<file://ignored/%(buildroot)s/pants_files/pex>"
i’ll file an issue about the hostname quirk: sorry about that!
@brave-furniture-86963: but i’ve confirmed that with that workaround you should be able to resolve from a directory.
b
Brilliant!
Copy code
[download-pex-bin]
url_template = "<file://ignored/%(buildroot)s/pants_files/pex>"
worked! Thanks all!
🚀 1
w
as mentioned in the ticket, we might end up breaking backwards compatibility to fix that: sorry for the trouble. adding a TODO referencing the ticket wouldn’t hurt!
👍 2