dart-lang/dartdoc

issue rolling into google3

devoncarew opened this issue · 6 comments

We have an issue rolling dartdoc into the sdk due to a failure rolling into google3. The roll CL is:

https://dart-review.googlesource.com/c/sdk/+/403181

The failure is visible in c-build; it looks like perhaps an infrastructure issue? INTERNAL Failed to apply patch ... .../dart/dartdoc/lib/resources/styles.css: Cannot apply hunk .... I see that lib/resources/styles.css changed quite a bit in recent PRs (#3919 and #3920), but I don't see any internal patch to the file that we'd be conflicting with.

cc @iinozemtsev and @srawlins

Yikes good catch Devon. I will look this week into fixing the patch (I'll also look into whether it's still needed); probably a bit of wiring is needed for the new Sass stuff.

I also don't see any internal patches and the file contents in g3 seems to match exactly to git contents at metadata revision, looking

This is a quite hilarious bug in our rolling infra and I didn't expect to face something like this in 2025 :)

lib/resources/styles.css starts with EF BB BF bytes, but you won't see it almost anywhere, because it's a UTF-8 encoded byte order mark, and at least in Dart it is discarded at the beginning of an input during UTF-8 decoding.

However git diff includes this into added/removed lines, and it is not discarded, since it is not at the beginning of an input (though you can't really see it in github UI, so I've added a text):

diff --git a/lib/resources/styles.css b/lib/resources/styles.css
index 919c4544..be7cdce7 100644
--- a/lib/resources/styles.css
+++ b/lib/resources/styles.css
@@ -1 +1 @@
-(BOM is Here!).light-theme...
+(BOM is Here!).light-theme...

As a result, our infra cannot find an original fragment (with BOM) trying to patch a file contents (without BOM), I'll make a fix.

Wow - that's a subtle issue. Thanks for running this down!

Is this still a problem, or can the issue be closed?

This has been addressed (thanks @iinozemtsev !).