Giter Club home page Giter Club logo

Comments (9)

sylvestre avatar sylvestre commented on June 3, 2024

@calixteman has been looking into it :)

from diffutils.

cakebaker avatar cakebaker commented on June 3, 2024

The ed_diff tests fail because ed is not installed. I opened a separate ticket for it as it is not a Windows-only issue.

from diffutils.

oSoMoN avatar oSoMoN commented on June 3, 2024

The failures look very similar to the error described in https://gnuwin32.sourceforge.net/packages/patch.htm#install:

On MS-Windows, the patchfile must be a text file, i.e. CR-LF must be used as line endings. A file with LF may give the error: "Assertion failed, hunk, file patch.c, line 343," unless the option '--binary' is given.

from diffutils.

oSoMoN avatar oSoMoN commented on June 3, 2024

I ran some tests in a windows VM, and I can confirm that diff.exe uses CR-LF (\r\n) as line endings.

Our implementation mostly uses the writeln macro, the documentation of which explicitly states:

On all platforms, the newline is the LINE FEED character (\n/U+000A) alone (no additional CARRIAGE RETURN (\r/U+000D).

from diffutils.

oSoMoN avatar oSoMoN commented on June 3, 2024

According to actions/runner-images#5459 (comment), and seeing the contents of stderr in our failures, the patch.exe binary that gets used is from Strawberry Perl, and it is probably not what we want.
The Git for Windows installer installs recent versions of the diffutils tools in C:\Program Files\Git\usr\bin\.

from diffutils.

oSoMoN avatar oSoMoN commented on June 3, 2024

#57 makes 13 failures (out of 16) go away.

from diffutils.

oSoMoN avatar oSoMoN commented on June 3, 2024

I fixed the remaining test failures in #58.
The problem wasn't with line endings, after all.

That doesn't mean we shouldn't look into line ending differences on Windows (see #42), but it should be tracked in a separate issue.

from diffutils.

oSoMoN avatar oSoMoN commented on June 3, 2024

That doesn't mean we shouldn't look into line ending differences on Windows (see #42), but it should be tracked in a separate issue.

I ran some tests on Windows. With the very old build of diffutils distributed by the Gnuwin32 project (version 2.8.7, 20 years old!), diff.exe rewrites all line endings to \r\n, even content lines that ended with \n only. However with a more recent build distributed in the Git for Windows installer (version 3.10), the rewrite doesn't happen any longer, and diff.exe behaves like on Unix, i.e. it defaults to \n for line endings (and content lines ending with \r\n are preserved). This might be due to a build-time option or the build environment, but regardless, our implementation isn't completely inconsistent with what's out there, so I don't think this warrants a separate issue, and perhaps #42 can be abandoned?

from diffutils.

sylvestre avatar sylvestre commented on June 3, 2024

yeah, sounds good, thanks

from diffutils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.