Symlinks are a go! ```def test_snapshot_output_sym...
# development
b
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
out of curiosity, what’s the use case driving this? 🙂
b
c
nvm, I could just follow the PR trail to the issue
b
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
oohh.. I see.
b
(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
Ooh, wonder if this will clean up the NodeJS symlink stuff
b
Thats the linked issue it fixes (or at least it mentions node)
w
nice! i had totally forgotten that that was node related, heh
w
Oh, ha ! I didn't notice node in that. Alternatively, we can keep this 🤢
./{nodejs_dir}/lib/node_modules/npm/bin/npx-cli.js",