GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Windows tests are failing · Issue #3 · uutils/diffutils

Windows tests are failing #3

New issue
Copy link
New issue
Copy link
Closed
Closed
Windows tests are failing#3
Copy link

Description

@sylvestre
sylvestre
opened on Jan 27, 2024
Issue body actions
---- context_diff::tests::test_permutations_reverse stdout ----
thread 'context_diff::tests::test_permutations_reverse' panicked at src\context_diff.rs:653:33:
Output { status: ExitStatus(ExitStatus(3)), stdout: "patching file target/context-diff//alefr\r\n", stderr: "Assertation failed!\r\n\r\nProgram: C:\\Strawberry\\c\\bin\\patch.exe\r\nFile: .\\src\\patch\\2.5.9\\patch-2.5.9-src\\patch.c, Line 354\r\n\r\nExpression: hunk\r\n" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- ed_diff::tests::test_permutations stdout ----
thread 'ed_diff::tests::test_permutations' panicked at src\ed_diff.rs:222:38:
called `Result::unwrap()` on an `Err` value: Error { kind: NotFound, message: "program not found" }

I wonder if this isn't the Windows "patch" command failing with \n ?!

Activity

  1. sylvestre commented on Feb 17, 2024

    @sylvestre
    sylvestre
    on Feb 17, 2024
    SponsorCollaboratorAuthor
    More actions

    @calixteman has been looking into it :)

  2. cakebaker commented on Apr 1, 2024

    @cakebaker
    cakebaker
    on Apr 1, 2024
    Contributor
    More actions

    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.

  3. oSoMoN commented on Apr 15, 2024

    @oSoMoN
    oSoMoN
    on Apr 15, 2024
    Collaborator
    More actions

    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.

  4. oSoMoN commented on Apr 15, 2024

    @oSoMoN
    oSoMoN
    on Apr 15, 2024
    Collaborator
    More actions

    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).

  5. oSoMoN commented on Apr 20, 2024

    @oSoMoN
    oSoMoN
    on Apr 20, 2024
    Collaborator
    More actions

    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\.

  6. oSoMoN commented on Apr 20, 2024

    @oSoMoN
    oSoMoN
    on Apr 20, 2024
    Collaborator
    More actions

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

  7. oSoMoN commented on Apr 20, 2024

    @oSoMoN
    oSoMoN
    on Apr 20, 2024
    Collaborator
    More actions

    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.

  8. sylvestre
    closed this as completedin 46a26e8on Apr 21, 2024
  9. sylvestre
    added a commit that references this issue on Apr 21, 2024

    Merge pull request uutils#58 from oSoMoN/ed-diff-tests-fix-path

    This issue will close once commit 46a26e8 is merged into the 'main' branch.
    46a26e8
  10. oSoMoN commented on Apr 21, 2024

    @oSoMoN
    oSoMoN
    on Apr 21, 2024
    Collaborator
    More actions

    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?

  11. sylvestre commented on Apr 21, 2024

    @sylvestre
    sylvestre
    on Apr 21, 2024
    SponsorCollaboratorAuthor
    More actions

    yeah, sounds good, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.