is it allowed to dynamically infer dependencies fo...
# general
is it allowed to dynamically infer dependencies for a target which lies outside of the project root where pants is run?
somewhat… it’s necessary to do it very cautiously, and it requires some abstraction leaks.
because we don’t have, there is no built in way to grab a file from an absolute path. to do it, you need to: 1. mark your
uncacheable, either via its output type being
, or by marking
2. use Python’s file API to load the file
and even then: it cannot have a declared
in the
./pants dependencies
sense, because you won’t be able to create a target for something outside the repo.
maybe i need to think about this another way .. but i might as well step back a few
i’m looking for a way to integrate nix with pants — i.e, i want to let nix handle builds of software and assist in providing the shell setup to run certain commands, or ensure certain tools are in PATH .. similar to shell commands, i want tools to be provided/built by nix … my main problem is i want to cache the “result” of nix expressions while tracking the dependencies with pants so it knows when the deps of the nix expressions has been changed if that makes any sense at all — don’t know if you’re familiar with nix or how it works
and just now — if i can just do everything with flakes, i’ll get a lockfile — which can likely be used for the exact purpose i’m looking for, where it can be a regular dependency within the project …
hm… yea, some support for
would be great. i expect that there are at least two aspects there though: 1.
entries from nix 2. other absolute files from nix
1. is subject to and , because we don’t currently deeply fingerprint
2. is more like what i mentioned above
👍 1
i’ll try my flake lockfile approach first and see if i can make that work as a starter
Hi @freezing-lamp-12123 did you manage to get pants working in nix shell? if so, maybe can you share any relevant