Skip to content

Conversation

@JanKrivanek
Copy link
Member

Fixes #6773

Context

Supersedes #8213 and #8282
Symlinked files were not embedded into binlog - previous solution was too much focused on symlinks and hence requried nontrivial code to properly distinguish aymlinks with available contnet.

Alternate approach - proceed with adding file as soon as it has available content

Testing

Preexisting unit test is excercising the scenario. Added a case for empty file - that still should not be added.

Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love the simplification!

One remaining meta-question: is "don't embed empty files" the correct behavior? "File was present but empty" feels like useful information, but I don't recall the motivation for the prior behavior.

@KirillOsenkov may also have an opinion.

@KirillOsenkov
Copy link
Member

Actually that's what I'm thinking too - perhaps it's easier to just allow empty files? I can't remember if there's a valid reason to filter them out anymore...

@JanKrivanek
Copy link
Member Author

Perfect! Seems there is no compelling reason to special case empty files (actually the opposite is preffered) - so let's simplify a bit more.


using Stream entryStream = OpenArchiveEntry(filePath);
using FileStream content = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete);
using Stream entryStream = OpenArchiveEntry(filePath);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this ordering matter?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd revert it just to be safe and keep the change minimal, but at a glance seems benign.

@Forgind Forgind added the merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now. label Jan 17, 2023
@JaynieBai JaynieBai merged commit 98924b8 into dotnet:main Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-when-branch-open PRs that are approved, except that there is a problem that means we are not merging stuff right now.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BinaryLogger doesn't embed file contents for symbolic links

5 participants