https://pantsbuild.org/ logo
#development
Title
# development
b

bitter-ability-32190

11/08/2022, 9:07 PM
Symlinks are a go!
Copy code
def test_snapshot_output_symlink_aware(rule_runner: RuleRunner) -> None:
    process = Process(
        argv=("/bin/ln", "-s", "dest", "source"),
        output_files=["source"],
        description="",
        working_directory="",
    )
    result = rule_runner.request(ProcessResult, [process])
    entries = rule_runner.request(DigestEntries, [result.output_digest])
    assert entries == DigestEntries([SymlinkEntry("source", "dest")])
Also tried:
Copy code
experimental_shell_command(
    name="foo",
    command="ln -s dest source",
    tools=["ln",],
    outputs=["source"],
)
And
export-codegen
exports a symlink! 🎉 (PR)
🔥 3
c

curved-television-6568

11/08/2022, 9:21 PM
out of curiosity, what’s the use case driving this? 🙂
b

bitter-ability-32190

11/08/2022, 9:22 PM
c

curved-television-6568

11/08/2022, 9:22 PM
nvm, I could just follow the PR trail to the issue
b

bitter-ability-32190

11/08/2022, 9:23 PM
Privately speaking I have a plugin I PoC'd that has Pants downloading and exposing system libraries (reproducibility to the MAX) And system libraries are symlinked to hell and back. Next stop: https://github.com/pantsbuild/pants/issues/17282 (because system libraries can be big)
c

curved-television-6568

11/08/2022, 9:23 PM
oohh.. I see.
b

bitter-ability-32190

11/08/2022, 9:24 PM
(Also some sys packages use absolute symlinks, so that was another reason this needed to be in. Pants chokes on those today)
(Although those will point to nothing unless they're fixed up 🤔 )
w

wide-midnight-78598

11/08/2022, 9:32 PM
Ooh, wonder if this will clean up the NodeJS symlink stuff
b

bitter-ability-32190

11/08/2022, 9:32 PM
Thats the linked issue it fixes (or at least it mentions node)
w

witty-crayon-22786

11/08/2022, 9:40 PM
nice! i had totally forgotten that that was node related, heh
w

wide-midnight-78598

11/08/2022, 11:01 PM
Oh, ha ! I didn't notice node in that. Alternatively, we can keep this 🤢
./{nodejs_dir}/lib/node_modules/npm/bin/npx-cli.js",