tall-battery-32825
04/19/2023, 6:58 PMfile(
name="dockerfile",
source="Dockerfile",
dependencies=["src:pex1"],
)
archive(
name="archive",
files=[":dockerfile"],
packages=["src:pex2"],
format="zip",
)
pants package path/to:archive yields an archive that does not contain src:pex1. Is this by design? Would I have to list every dependency under files or packages for it to be included in the archive? If so, is the dependencies list on file targets used for anything?tall-battery-32825
04/19/2023, 7:01 PMarchive target pick up transitive dependencies?refined-addition-53644
04/19/2023, 7:31 PMswift-river-73520
04/19/2023, 7:31 PMsrc:pex1 in the packages for the archive instead of as a dependency of file . this is kind of a gut feeling to me seeing as it feels kind of weird having a file depend on a pex and I can see Pants not realizing it should pull it into the archive if it's just a dependency of the file target. if that works, hopefully someone else can chime in as to why it does lol.
I guess my followup question would be what are benefiting from by adding src:pex to the dependencies for your file?tall-battery-32825
04/19/2023, 8:34 PMfile dependencies would be pulled into the archive the way they dependencies are added to pex_binary targets. Your comment makes sense and I ended up going with listing everything in the packages field. Semantically, it makes sense to me that `archive`s only worry about their own direct dependencies via files and packages.
TBH it felt weird having the dependency on the file but it sort of made sense to me that the Dockerfile depends on the pex so I just added the pex as a dependency on the file. I am not using docker_img targets, I am just packaging the dockerfiles/docker-compose files along with dependencies to be built later.swift-river-73520
04/19/2023, 9:46 PMhappy-kitchen-89482
04/19/2023, 9:49 PM