Track symlinks between local files via DICE dependencies#1286
Open
cormacrelf wants to merge 1 commit intofacebook:mainfrom
Open
Track symlinks between local files via DICE dependencies#1286cormacrelf wants to merge 1 commit intofacebook:mainfrom
cormacrelf wants to merge 1 commit intofacebook:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Here's a test case that I was quite alarmed Buck fails at. The use case is reading files at bzl eval time that don't have a .toml suffix, as TOML, for https://github.com/cormacrelf/elk which I have updated to depend on this entire thing at the heart of its strategy only to realise it doesn't work very well at all. (I would be happy with a way to tell load() to load as TOML if we can't get symlinks to work.)
BUCK blah.lock blah.lock.toml -> blah.lock [a symlink]Now, buck does not pick up changes to blah.lock.
buck2 build --out=- :test {value: original} echo 'value = "changed"' > blah.lock buck2 build --out=- :test {value: original} # wat? # now you have to buck2 clean to get it to pick up changes...Solution
I am not very familiar with the fs operations here. This is pretty likely not to be quite correct and I invite some attention on the implementation. In particular I don't think it handles directory symlinks at all. But the general idea is being symlink-aware when reading a file, and making the DICE dependency graph reflect the symlink graph, so that a change to a real file propagates through any symlinks referring to it.
Basically this PR passes the test above, I make no claim other than that.