Skip to content

Conversation

@softworkz
Copy link
Collaborator

@softworkz softworkz commented May 12, 2025

When setting up the new Patchword builders I noticed some issues when running FATE tests on Windows. Initially I had them suppressed on the builders, but this patchset should finally fix it.

Version V2

  • Clarified commit message in 3/3 regarding the requirement for a relative path to the fate samples (thanks, Zhao)

.

softworkz added 2 commits May 12, 2025 08:50
..when checked out with autocrlf=on, which is Git default
on Windows.

Signed-off-by: softworkz <[email protected]>
..to make it work when checked out with autocrlf=on,
which is Git default on Windows.

Signed-off-by: softworkz <[email protected]>
@softworkz softworkz force-pushed the submit_fate_subs_eol branch from 1cabca4 to 520f9af Compare May 12, 2025 09:57
@softworkz
Copy link
Collaborator Author

/submit

@ffmpeg-codebot
Copy link

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-77/softworkz/submit_fate_subs_eol-v1

To fetch this version to local tag pr-ffstaging-77/softworkz/submit_fate_subs_eol-v1:

git fetch --no-tags https://github.com/ffstaging/FFmpeg tag pr-ffstaging-77/softworkz/submit_fate_subs_eol-v1

MSYS2 considers the colon (:) as path separator (=separating multiple
paths) and thinks it needs to convert it to a Windows
path separator (;).

Setting the MSYS2_ARG_CONV_EXCL environment variable
keeps MSYS2 from doing this replacement.

NOTE: This makes it possible to run the test from an MSYS2 shell,
but it only works when using a relative path like

--samples=../fate-suite (in configure)

or

SAMPLES=../fate-suite (in make fate)

Reviewed-by: Zhao Zhili <[email protected]>
Signed-off-by: softworkz <[email protected]>
@softworkz softworkz force-pushed the submit_fate_subs_eol branch from 520f9af to c9e2157 Compare May 13, 2025 14:20
@softworkz
Copy link
Collaborator Author

/submit

@ffmpeg-codebot
Copy link

Submitted as [email protected]

To fetch this version into FETCH_HEAD:

git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-77/softworkz/submit_fate_subs_eol-v2

To fetch this version to local tag pr-ffstaging-77/softworkz/submit_fate_subs_eol-v2:

git fetch --no-tags https://github.com/ffstaging/FFmpeg tag pr-ffstaging-77/softworkz/submit_fate_subs_eol-v2

@ffmpeg-codebot
Copy link

On the FFmpeg mailing list, "softworkz ." wrote (reply to this):



> -----Original Message-----
> From: ffmpegagent <[email protected]>
> Sent: Dienstag, 13. Mai 2025 16:23
> To: [email protected]
> Cc: softworkz <[email protected]>
> Subject: [PATCH v2 0/3] tests/fate: Improvements for running FATE on
> Windows/MSYS2
> 
> When setting up the new Patchword builders I noticed some issues when
> running FATE tests on Windows. Initially I had them suppressed on the
> builders, but this patchset should finally fix it.
> 
> Version V2
> 
>  * Clarified commit message in 3/3 regarding the requirement for a relative
>    path to the fate samples (thanks, Zhao)
> 
> .
> 
> softworkz (3):
>   tests/fate: Fix subtitle fate tests on Windows
>   tests/source-check: Fix make inclusion-guard check EOL-agnostic
>   tests/hevc: Fix concat input when running in MSYS2 shell



Hi,

would anybody be able to take a quick look at this patchset?

The third one has been confirmed by Zhao already and the first 
two are very short and simple as well.

This would allow me to change the Windows CI runners on Patchwork to
execute the full suite of FATE tests.

Thanks,
sw


_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

-e 's/_af_/_/' \
-e 's/_vf_/_/' \
-e 's/_avf_/_/' \
-e 's/_vaf_/_/' \

Choose a reason for hiding this comment

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

On the FFmpeg mailing list, Andreas Rheinhardt wrote (reply to this):

softworkz:
> From: softworkz <[email protected]>
> 
> ..to make it work when checked out with autocrlf=on,
> which is Git default on Windows.
> 
> Signed-off-by: softworkz <[email protected]>
> ---
>  tests/fate/source-check.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/fate/source-check.sh b/tests/fate/source-check.sh
> index 4d7e175784..99e869e869 100755
> --- a/tests/fate/source-check.sh
> +++ b/tests/fate/source-check.sh
> @@ -28,7 +28,7 @@ for f in `git ls-files | grep '\.h$'` ; do
>          -e 's/_vaf_/_/' \
>      | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`"
>  
> -    git grep -L "^#define $macro$" $f
> +    git grep -L "^#define $macro\>" $f

This makes the test less strict. Why don't we instead just specify that
the repo should be checked out with lf only? Would this break something?

>  done
>  
>  echo "Use of av_clip() where av_clip_uintp2() could be used:"

_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Choose a reason for hiding this comment

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

On the FFmpeg mailing list, "softworkz ." wrote (reply to this):



> -----Original Message-----
> From: ffmpeg-devel <[email protected]> On Behalf Of Andreas
> Rheinhardt
> Sent: Donnerstag, 22. Mai 2025 12:42
> To: [email protected]
> Subject: Re: [FFmpeg-devel] [PATCH v2 2/3] tests/source-check: Fix make
> inclusion-guard check EOL-agnostic
> 
> softworkz:
> > From: softworkz <[email protected]>
> >
> > ..to make it work when checked out with autocrlf=on,
> > which is Git default on Windows.
> >
> > Signed-off-by: softworkz <[email protected]>
> > ---
> >  tests/fate/source-check.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tests/fate/source-check.sh b/tests/fate/source-check.sh
> > index 4d7e175784..99e869e869 100755
> > --- a/tests/fate/source-check.sh
> > +++ b/tests/fate/source-check.sh
> > @@ -28,7 +28,7 @@ for f in `git ls-files | grep '\.h$'` ; do
> >          -e 's/_vaf_/_/' \
> >      | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`"
> >
> > -    git grep -L "^#define $macro$" $f
> > +    git grep -L "^#define $macro\>" $f
> 
> This makes the test less strict. 

Yea, that's correct, but does that defeat the intention of the test?
It might allow whitespace at the end of the but this is something
that can happen for any line in any file, not just the guard definitions
in header files. Eventually this is guarded against by the hooks of
the Git repo when pushing. 
It might also allow more text after some whitespace, but that would 
file compilation, I think.

Do you know some regex Kung-Fu to ignore EOL and still use an end 
marker? I had found a way but that requires switching to Perl matching
(-E), but from what I've read, we cannot assume this to be available
on all platforms.


> Why don't we instead just specify that
> the repo should be checked out with lf only? Would this break something?

From my experience it can cause a lot of trouble. The following 
discussions from last year may give you an idea of these pitfalls,
even though not everything might apply to FFmpeg:

https://github.com/ffmpeginteropx/FFmpegInteropX/pull/433
https://github.com/ffmpeginteropx/FFmpegInteropX/pull/431
https://github.com/ffmpeginteropx/FFmpegInteropX/pull/430

The risk is that it causes more trouble than the problems it might
solve.
What stands on the other side is that these two patches is all that
is needed to successfully run FATE tests on Windows.

When a new subtitle test is added, the entry in .gitattributes may
be forgotten, but with the new CI builds on Windows it would also
be discovered immediately.


Thanks a lot for looking at this,
sw





_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Choose a reason for hiding this comment

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

On the FFmpeg mailing list, "softworkz ." wrote (reply to this):



> -----Original Message-----
> From: ffmpeg-devel <[email protected]> On Behalf Of softworkz .
> Sent: Donnerstag, 22. Mai 2025 13:12
> To: FFmpeg development discussions and patches <[email protected]>
> Subject: Re: [FFmpeg-devel] [PATCH v2 2/3] tests/source-check: Fix make
> inclusion-guard check EOL-agnostic
> 
> 
> 
> > -----Original Message-----
> > From: ffmpeg-devel <[email protected]> On Behalf Of Andreas
> > Rheinhardt
> > Sent: Donnerstag, 22. Mai 2025 12:42
> > To: [email protected]
> > Subject: Re: [FFmpeg-devel] [PATCH v2 2/3] tests/source-check: Fix make
> > inclusion-guard check EOL-agnostic
> >
> > softworkz:
> > > From: softworkz <[email protected]>
> > >
> > > ..to make it work when checked out with autocrlf=on,
> > > which is Git default on Windows.
> > >
> > > Signed-off-by: softworkz <[email protected]>
> > > ---
> > >  tests/fate/source-check.sh | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/tests/fate/source-check.sh b/tests/fate/source-check.sh
> > > index 4d7e175784..99e869e869 100755
> > > --- a/tests/fate/source-check.sh
> > > +++ b/tests/fate/source-check.sh
> > > @@ -28,7 +28,7 @@ for f in `git ls-files | grep '\.h$'` ; do
> > >          -e 's/_vaf_/_/' \
> > >      | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`"
> > >
> > > -    git grep -L "^#define $macro$" $f
> > > +    git grep -L "^#define $macro\>" $f
> >
> > This makes the test less strict.
> 
> Yea, that's correct, but does that defeat the intention of the test?
> It might allow whitespace at the end of the but this is something
> that can happen for any line in any file, not just the guard definitions
> in header files. Eventually this is guarded against by the hooks of
> the Git repo when pushing.
> It might also allow more text after some whitespace, but that would
> file compilation, I think.
> 
> Do you know some regex Kung-Fu to ignore EOL and still use an end
> marker? I had found a way but that requires switching to Perl matching
> (-E), but from what I've read, we cannot assume this to be available
> on all platforms.
> 
> 
> > Why don't we instead just specify that
> > the repo should be checked out with lf only? Would this break something?
> 
> From my experience it can cause a lot of trouble. The following
> discussions from last year may give you an idea of these pitfalls,
> even though not everything might apply to FFmpeg:
> 
> https://github.com/ffmpeginteropx/FFmpegInteropX/pull/433
> https://github.com/ffmpeginteropx/FFmpegInteropX/pull/431
> https://github.com/ffmpeginteropx/FFmpegInteropX/pull/430
> 
> The risk is that it causes more trouble than the problems it might
> solve.
> What stands on the other side is that these two patches is all that
> is needed to successfully run FATE tests on Windows.
> 
> When a new subtitle test is added, the entry in .gitattributes may
> be forgotten, but with the new CI builds on Windows it would also
> be discovered immediately.
> _______________________________________________

Oh, and I totally forgot this: There are other tests which are 
failing when declaring EOL=LF in .gitattributes - even a few
subtitle tests, that's why I haven't added all of them.

sw


_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

@ffmpeg-codebot
Copy link

On the FFmpeg mailing list, Kacper Michajlow wrote (reply to this):

On Mon, 12 May 2025 at 12:00, ffmpegagent <[email protected]> wrote:
>
> When setting up the new Patchword builders I noticed some issues when
> running FATE tests on Windows. Initially I had them suppressed on the
> builders, but this patchset should finally fix it.
>
> softworkz (3):
>   tests/fate: Fix subtitle fate tests on Windows
>   tests/source-check: Fix make inclusion-guard check EOL-agnostic

I think ffmpeg repositories should always be checked out with LF line
endings, there is nothing that expects those sources to have CRLF. If
you like you can set attributes to all files to LF (not only subs),
but essentially this should already be done by the user when checking
the repository.

(autocrlf should be considered harmful, the was bad idea to make git
tooling smarter for its own good)

>   tests/hevc: Fix concat input when running in MSYS2 shell

This is more tricky, but frankly, I don't like injecting platform
specific workarounds into makefile files like that. Either maintain it
yourself or do it in a more generic way, not just in one hevc test,
because what if someone else adds a concat test? Do you expect them to
know that some MSYS2 specific handling is needed? It shouldn't be.

Also if you like to fix "fate paths", it should be done fully.
Currently only relative paths are working, because some tests are
doing things like "$(input)[bla]" which also trips patch conversion,
so full unix path doesn't work, because it won't get converted to
Windows one, Windows path doesn't work, because it would be mangled
because of not escaped `\`.

- Kacper
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

@ffmpeg-codebot
Copy link

On the FFmpeg mailing list, "softworkz ." wrote (reply to this):



> -----Original Message-----
> From: Kacper Michajlow <[email protected]>
> Sent: Tuesday, June 17, 2025 12:44 AM
> To: FFmpeg development discussions and patches <ffmpeg-
> [email protected]>
> Cc: softworkz <[email protected]>
> Subject: Re: [FFmpeg-devel] [PATCH 0/3] tests/fate: Improvements for
> running FATE on Windows/MSYS2
> 
> On Mon, 12 May 2025 at 12:00, ffmpegagent <[email protected]>
> wrote:
> >
> > When setting up the new Patchword builders I noticed some issues when
> > running FATE tests on Windows. Initially I had them suppressed on the
> > builders, but this patchset should finally fix it.
> >
> > softworkz (3):
> >   tests/fate: Fix subtitle fate tests on Windows
> >   tests/source-check: Fix make inclusion-guard check EOL-agnostic
> 
> I think ffmpeg repositories should always be checked out with LF line endings,
> there is nothing that expects those sources to have CRLF. If you like you can set
> attributes to all files to LF (not only subs)

FATE already fails when setting LF for all subtitle ref files.



>, but essentially this should already
> be done by the user when checking the repository.
> 
> (autocrlf should be considered harmful, the was bad idea to make git tooling
> smarter for its own good)

While this might be true, autocrlf is on by default and it's harmful to switch
It off globally as that would screw things in many other projects.

Checking out only FFmpeg with autocrlf=off is non-trivial. Nobody knows how
to do this properly and even less people will know how to properly change it
after checking out, in a way that all files get changed as well.

I do know both, but I work with FFmpeg, having autocrlf=oni (the default on 
Windows) for more than 10 years, and I think it's more than valid to expect
That FATE tests are running successfully also under these conditions.

> >   tests/hevc: Fix concat input when running in MSYS2 shell
> 
> This is more tricky, but frankly, I don't like injecting platform specific
> workarounds into makefile files like that. Either maintain it yourself or do it in a
> more generic way, not just in one hevc test, because what if someone else
> adds a concat test? Do you expect them to know that some MSYS2 specific
> handling is needed? It shouldn't be. 
> Also if you like to fix "fate paths", it should be done fully.
> Currently only relative paths are working, because some tests are doing things
> like "$(input)[bla]" which also trips patch conversion, so full unix path doesn't
> work, because it won't get converted to Windows one, Windows path doesn't
> work, because it would be mangled because of not escaped `\`.

The fix I'm proposing is in fact working with relative paths only. If you know a 
Better way, that works in all cases, please feel free to tell.

It's clearly just a "better-than-nothing" fix - but it's still better than nothing. 😊 

Best regards
softworkz

_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

@ffmpeg-codebot
Copy link

On the FFmpeg mailing list, Kacper Michajlow wrote (reply to this):

On Tue, 17 Jun 2025 at 01:05, softworkz . <[email protected]> wrote:
>
>
>
> > -----Original Message-----
> > From: Kacper Michajlow <[email protected]>
> > Sent: Tuesday, June 17, 2025 12:44 AM
> > To: FFmpeg development discussions and patches <ffmpeg-
> > [email protected]>
> > Cc: softworkz <[email protected]>
> > Subject: Re: [FFmpeg-devel] [PATCH 0/3] tests/fate: Improvements for
> > running FATE on Windows/MSYS2
> >
> > On Mon, 12 May 2025 at 12:00, ffmpegagent <[email protected]>
> > wrote:
> > >
> > > When setting up the new Patchword builders I noticed some issues when
> > > running FATE tests on Windows. Initially I had them suppressed on the
> > > builders, but this patchset should finally fix it.
> > >
> > > softworkz (3):
> > >   tests/fate: Fix subtitle fate tests on Windows
> > >   tests/source-check: Fix make inclusion-guard check EOL-agnostic
> >
> > I think ffmpeg repositories should always be checked out with LF line endings,
> > there is nothing that expects those sources to have CRLF. If you like you can set
> > attributes to all files to LF (not only subs)
>
> FATE already fails when setting LF for all subtitle ref files.
>

What do you mean? Everything is LF based. I don't see any failures.

>
> >, but essentially this should already
> > be done by the user when checking the repository.
> >
> > (autocrlf should be considered harmful, the was bad idea to make git tooling
> > smarter for its own good)
>
> While this might be true, autocrlf is on by default and it's harmful to switch
> It off globally as that would screw things in many other projects.
>
> Checking out only FFmpeg with autocrlf=off is non-trivial. Nobody knows how
> to do this properly and even less people will know how to properly change it
> after checking out, in a way that all files get changed as well.
>
> I do know both, but I work with FFmpeg, having autocrlf=oni (the default on
> Windows) for more than 10 years, and I think it's more than valid to expect
> That FATE tests are running successfully also under these conditions.
>
> > >   tests/hevc: Fix concat input when running in MSYS2 shell
> >
> > This is more tricky, but frankly, I don't like injecting platform specific
> > workarounds into makefile files like that. Either maintain it yourself or do it in a
> > more generic way, not just in one hevc test, because what if someone else
> > adds a concat test? Do you expect them to know that some MSYS2 specific
> > handling is needed? It shouldn't be.
> > Also if you like to fix "fate paths", it should be done fully.
> > Currently only relative paths are working, because some tests are doing things
> > like "$(input)[bla]" which also trips patch conversion, so full unix path doesn't
> > work, because it won't get converted to Windows one, Windows path doesn't
> > work, because it would be mangled because of not escaped `\`.
>
> The fix I'm proposing is in fact working with relative paths only. If you know a
> Better way, that works in all cases, please feel free to tell.
>
> It's clearly just a "better-than-nothing" fix - but it's still better than nothing. 😊

I'm confused though, because concat tests input is not converted. What
exactly are we fixing here?

2025-06-16T23:27:19.8284085Z TEST    hevc-mv-switch
2025-06-16T23:27:19.8286651Z /c/a/FFmpeg/FFmpeg/tests/fate-run.sh
fate-hevc-mv-switch "../samples" ""
"/c/a/FFmpeg/FFmpeg/.github/fate/build" 'framecrc -i
"concat:../samples/hevc-conformance/LS_A_Orange_2.bit|../samples/hevc/mv_nuh_layer_id.bit|../samples/hevc-conformance/NoOutPrior_B_Qualcomm_1.bit|../samples/hevc-conformance/MVHEVCS_A.bit"
-fps_mode passthrough -map 0:vidx:0 -map 0:vidx:1 -sws_flags
+accurate_rnd+bitexact' '' '' '' '1' '' '' '' '' '' '' '' '' '' ''

It works fine as is, MSYS2 won't convert this because it's separated with |.

- Kacper

- Kacper
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

@ffmpeg-codebot
Copy link

On the FFmpeg mailing list, "softworkz ." wrote (reply to this):



> -----Original Message-----
> From: Kacper Michajlow <[email protected]>
> Sent: Tuesday, June 17, 2025 3:00 AM
> To: softworkz . <[email protected]>
> Cc: FFmpeg development discussions and patches <ffmpeg-
> [email protected]>
> Subject: Re: [FFmpeg-devel] [PATCH 0/3] tests/fate: Improvements for running
> FATE on Windows/MSYS2
> 
> On Tue, 17 Jun 2025 at 01:05, softworkz . <[email protected]> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Kacper Michajlow <[email protected]>
> > > Sent: Tuesday, June 17, 2025 12:44 AM
> > > To: FFmpeg development discussions and patches <ffmpeg-
> > > [email protected]>
> > > Cc: softworkz <[email protected]>
> > > Subject: Re: [FFmpeg-devel] [PATCH 0/3] tests/fate: Improvements for
> > > running FATE on Windows/MSYS2
> > >
> > > On Mon, 12 May 2025 at 12:00, ffmpegagent <[email protected]>
> > > wrote:
> > > >
> > > > When setting up the new Patchword builders I noticed some issues
> > > > when running FATE tests on Windows. Initially I had them
> > > > suppressed on the builders, but this patchset should finally fix it.
> > > >
> > > > softworkz (3):
> > > >   tests/fate: Fix subtitle fate tests on Windows
> > > >   tests/source-check: Fix make inclusion-guard check EOL-agnostic
> > >
> > > I think ffmpeg repositories should always be checked out with LF
> > > line endings, there is nothing that expects those sources to have
> > > CRLF. If you like you can set attributes to all files to LF (not
> > > only subs)
> >
> > FATE already fails when setting LF for all subtitle ref files.
> >
> 
> What do you mean? Everything is LF based. I don't see any failures.

Hi Kasper,

A common misconception is that autocrlf=off would mean that you are
dealing just with LF line endings in Git - but that's not the case, even 
the opposite is true: Disabling autocrlf is what actually enables check-in
of files with CRLF - often accidentally. But it's not always accidental. Some
of the FATE reference files for subtitle tests actually _do_ have CRLF line
endings. By specifying LF in .gitattributes, CRLF would get replaced by LF
and the tests will fail.
Setting LF in .gitattributes is something totally different from autocrlf=off.
The latter means "do not change line endings back-and-forth when checking
In and out", but what you set in .gitattributes trumps autocrlf - i.e. autocrlf
doesn't act on files with a .gitattributes entry about line endings.

The patch may look like as if I had forgotten some of the subtitle ref files, 
but no: I had to carefully choose the ones who need it and which must not
be changed.

> >
> > >, but essentially this should already  be done by the user when
> > >checking the repository.
> > >
> > > (autocrlf should be considered harmful, the was bad idea to make git
> > > tooling smarter for its own good)
> >
> > While this might be true, autocrlf is on by default and it's harmful
> > to switch It off globally as that would screw things in many other projects.
> >
> > Checking out only FFmpeg with autocrlf=off is non-trivial. Nobody
> > knows how to do this properly and even less people will know how to
> > properly change it after checking out, in a way that all files get changed as
> well.
> >
> > I do know both, but I work with FFmpeg, having autocrlf=oni (the
> > default on
> > Windows) for more than 10 years, and I think it's more than valid to
> > expect That FATE tests are running successfully also under these conditions.
> >
> > > >   tests/hevc: Fix concat input when running in MSYS2 shell
> > >
> > > This is more tricky, but frankly, I don't like injecting platform
> > > specific workarounds into makefile files like that. Either maintain
> > > it yourself or do it in a more generic way, not just in one hevc
> > > test, because what if someone else adds a concat test? Do you expect
> > > them to know that some MSYS2 specific handling is needed? It shouldn't
> be.
> > > Also if you like to fix "fate paths", it should be done fully.
> > > Currently only relative paths are working, because some tests are
> > > doing things like "$(input)[bla]" which also trips patch conversion,
> > > so full unix path doesn't work, because it won't get converted to
> > > Windows one, Windows path doesn't work, because it would be mangled
> because of not escaped `\`.
> >
> > The fix I'm proposing is in fact working with relative paths only. If
> > you know a Better way, that works in all cases, please feel free to tell.
> >
> > It's clearly just a "better-than-nothing" fix - but it's still better
> > than nothing. 😊
> 
> I'm confused though, because concat tests input is not converted. What
> exactly are we fixing here?

Please see here for background:

https://patchwork.ffmpeg.org/project/ffmpeg/patch/520f9af365f550aefc3e9abfacab83cfc8817b8e.1747043988.git.ffmpegagent@gmail.com/

https://patchwork.ffmpeg.org/project/ffmpeg/patch/c9e21574c0c8be252b3ff83133a004e3eef6803c.1747146207.git.ffmpegagent@gmail.com/

Zhao had reported this issue before and while I tried to get FATE tests working on MSYS2 I found a solution. Unfortunately, it only works when the FATE samples path is specified relative to the FFmpeg dir, but at least it opens up one way where it is working, after there wasn't any way before. It's the best I could find, unfortunately.



> 2025-06-16T23:27:19.8284085Z TEST    hevc-mv-switch
> 2025-06-16T23:27:19.8286651Z /c/a/FFmpeg/FFmpeg/tests/fate-run.sh
> fate-hevc-mv-switch "../samples" ""
> "/c/a/FFmpeg/FFmpeg/.github/fate/build" 'framecrc -i
> "concat:../samples/hevc-
> conformance/LS_A_Orange_2.bit|../samples/hevc/mv_nuh_layer_id.bit|../sa
> mples/hevc-conformance/NoOutPrior_B_Qualcomm_1.bit|../samples/hevc-
> conformance/MVHEVCS_A.bit"
> -fps_mode passthrough -map 0:vidx:0 -map 0:vidx:1 -sws_flags
> +accurate_rnd+bitexact' '' '' '' '1' '' '' '' '' '' '' '' '' '' ''
> 
> It works fine as is, MSYS2 won't convert this because it's separated with |.

The fix is only needed when you are running make fate interactively from a 
command line in an MSYS2 shell. 

Best regards,
softworkz
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

@ffmpeg-codebot
Copy link

On the FFmpeg mailing list, Kacper Michajlow wrote (reply to this):

On Tue, 17 Jun 2025 at 03:46, softworkz . <[email protected]> wrote:
>
>
>
> > -----Original Message-----
> > From: Kacper Michajlow <[email protected]>
> > Sent: Tuesday, June 17, 2025 3:00 AM
> > To: softworkz . <[email protected]>
> > Cc: FFmpeg development discussions and patches <ffmpeg-
> > [email protected]>
> > Subject: Re: [FFmpeg-devel] [PATCH 0/3] tests/fate: Improvements for running
> > FATE on Windows/MSYS2
> >
> > On Tue, 17 Jun 2025 at 01:05, softworkz . <[email protected]> wrote:
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Kacper Michajlow <[email protected]>
> > > > Sent: Tuesday, June 17, 2025 12:44 AM
> > > > To: FFmpeg development discussions and patches <ffmpeg-
> > > > [email protected]>
> > > > Cc: softworkz <[email protected]>
> > > > Subject: Re: [FFmpeg-devel] [PATCH 0/3] tests/fate: Improvements for
> > > > running FATE on Windows/MSYS2
> > > >
> > > > On Mon, 12 May 2025 at 12:00, ffmpegagent <[email protected]>
> > > > wrote:
> > > > >
> > > > > When setting up the new Patchword builders I noticed some issues
> > > > > when running FATE tests on Windows. Initially I had them
> > > > > suppressed on the builders, but this patchset should finally fix it.
> > > > >
> > > > > softworkz (3):
> > > > >   tests/fate: Fix subtitle fate tests on Windows
> > > > >   tests/source-check: Fix make inclusion-guard check EOL-agnostic
> > > >
> > > > I think ffmpeg repositories should always be checked out with LF
> > > > line endings, there is nothing that expects those sources to have
> > > > CRLF. If you like you can set attributes to all files to LF (not
> > > > only subs)
> > >
> > > FATE already fails when setting LF for all subtitle ref files.
> > >
> >
> > What do you mean? Everything is LF based. I don't see any failures.
>
> Hi Kasper,
>
> A common misconception is that autocrlf=off would mean that you are
> dealing just with LF line endings in Git - but that's not the case, even
> the opposite is true: Disabling autocrlf is what actually enables check-in
> of files with CRLF - often accidentally. But it's not always accidental. Some
> of the FATE reference files for subtitle tests actually _do_ have CRLF line
> endings. By specifying LF in .gitattributes, CRLF would get replaced by LF
> and the tests will fail.
> Setting LF in .gitattributes is something totally different from autocrlf=off.
> The latter means "do not change line endings back-and-forth when checking
> In and out", but what you set in .gitattributes trumps autocrlf - i.e. autocrlf
> doesn't act on files with a .gitattributes entry about line endings.

I know how autocrlf works. I only said that imposing default logic
that "Windows always must use CRLF" and git implicitly will break your
committed line endings by default was a short sighted design decision.
It's good to have options to do the conversion IF the user wants that
or is configured as needed for a certain repository/platform.

> The patch may look like as if I had forgotten some of the subtitle ref files,
> but no: I had to carefully choose the ones who need it and which must not
> be changed.

Could you be more specific? Which ones? I think rcombs and astiob
changed all remaining CRLF sometime in last year or even earlier.

Either way, files are committed in the proper way in the repository,
so just make your git client not break that on checkout.

> > >
> > > >, but essentially this should already  be done by the user when
> > > >checking the repository.
> > > >
> > > > (autocrlf should be considered harmful, the was bad idea to make git
> > > > tooling smarter for its own good)
> > >
> > > While this might be true, autocrlf is on by default and it's harmful
> > > to switch It off globally as that would screw things in many other projects.
> > >
> > > Checking out only FFmpeg with autocrlf=off is non-trivial. Nobody
> > > knows how to do this properly and even less people will know how to
> > > properly change it after checking out, in a way that all files get changed as
> > well.
> > >
> > > I do know both, but I work with FFmpeg, having autocrlf=oni (the
> > > default on
> > > Windows) for more than 10 years, and I think it's more than valid to
> > > expect That FATE tests are running successfully also under these conditions.
> > >
> > > > >   tests/hevc: Fix concat input when running in MSYS2 shell
> > > >
> > > > This is more tricky, but frankly, I don't like injecting platform
> > > > specific workarounds into makefile files like that. Either maintain
> > > > it yourself or do it in a more generic way, not just in one hevc
> > > > test, because what if someone else adds a concat test? Do you expect
> > > > them to know that some MSYS2 specific handling is needed? It shouldn't
> > be.
> > > > Also if you like to fix "fate paths", it should be done fully.
> > > > Currently only relative paths are working, because some tests are
> > > > doing things like "$(input)[bla]" which also trips patch conversion,
> > > > so full unix path doesn't work, because it won't get converted to
> > > > Windows one, Windows path doesn't work, because it would be mangled
> > because of not escaped `\`.
> > >
> > > The fix I'm proposing is in fact working with relative paths only. If
> > > you know a Better way, that works in all cases, please feel free to tell.
> > >
> > > It's clearly just a "better-than-nothing" fix - but it's still better
> > > than nothing. 😊
> >
> > I'm confused though, because concat tests input is not converted. What
> > exactly are we fixing here?
>
> Please see here for background:
>
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/520f9af365f550aefc3e9abfacab83cfc8817b8e.1747043988.git.ffmpegagent@gmail.com/
>
> https://patchwork.ffmpeg.org/project/ffmpeg/patch/c9e21574c0c8be252b3ff83133a004e3eef6803c.1747146207.git.ffmpegagent@gmail.com/
>
> Zhao had reported this issue before and while I tried to get FATE tests working on MSYS2 I found a solution. Unfortunately, it only works when the FATE samples path is specified relative to the FFmpeg dir, but at least it opens up one way where it is working, after there wasn't any way before. It's the best I could find, unfortunately.
>
>
>
> > 2025-06-16T23:27:19.8284085Z TEST    hevc-mv-switch
> > 2025-06-16T23:27:19.8286651Z /c/a/FFmpeg/FFmpeg/tests/fate-run.sh
> > fate-hevc-mv-switch "../samples" ""
> > "/c/a/FFmpeg/FFmpeg/.github/fate/build" 'framecrc -i
> > "concat:../samples/hevc-
> > conformance/LS_A_Orange_2.bit|../samples/hevc/mv_nuh_layer_id.bit|../sa
> > mples/hevc-conformance/NoOutPrior_B_Qualcomm_1.bit|../samples/hevc-
> > conformance/MVHEVCS_A.bit"
> > -fps_mode passthrough -map 0:vidx:0 -map 0:vidx:1 -sws_flags
> > +accurate_rnd+bitexact' '' '' '' '1' '' '' '' '' '' '' '' '' '' ''
> >
> > It works fine as is, MSYS2 won't convert this because it's separated with |.
>
> The fix is only needed when you are running make fate interactively from a
> command line in an MSYS2 shell.

Hmm, I see.

- Kacper
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

@ffmpeg-codebot
Copy link

On the FFmpeg mailing list, "softworkz ." wrote (reply to this):



> -----Original Message-----
> From: Kacper Michajlow <[email protected]>
> Sent: Tuesday, June 17, 2025 3:18 PM
> To: softworkz . <[email protected]>
> Cc: FFmpeg development discussions and patches <ffmpeg-
> [email protected]>
> Subject: Re: [FFmpeg-devel] [PATCH 0/3] tests/fate: Improvements for running
> FATE on Windows/MSYS2
> 
> On Tue, 17 Jun 2025 at 03:46, softworkz . <[email protected]> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Kacper Michajlow <[email protected]>
> > > Sent: Tuesday, June 17, 2025 3:00 AM
> > > To: softworkz . <[email protected]>
> > > Cc: FFmpeg development discussions and patches <ffmpeg-
> > > [email protected]>
> > > Subject: Re: [FFmpeg-devel] [PATCH 0/3] tests/fate: Improvements for
> > > running FATE on Windows/MSYS2
> > >
> > > On Tue, 17 Jun 2025 at 01:05, softworkz . <[email protected]>
> wrote:
> > > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Kacper Michajlow <[email protected]>
> > > > > Sent: Tuesday, June 17, 2025 12:44 AM
> > > > > To: FFmpeg development discussions and patches <ffmpeg-
> > > > > [email protected]>
> > > > > Cc: softworkz <[email protected]>
> > > > > Subject: Re: [FFmpeg-devel] [PATCH 0/3] tests/fate: Improvements
> > > > > for running FATE on Windows/MSYS2
> > > > >
> > > > > On Mon, 12 May 2025 at 12:00, ffmpegagent
> > > > > <[email protected]>
> > > > > wrote:
> > > > > >
> > > > > > When setting up the new Patchword builders I noticed some
> > > > > > issues when running FATE tests on Windows. Initially I had
> > > > > > them suppressed on the builders, but this patchset should finally fix
> it.
> > > > > >
> > > > > > softworkz (3):
> > > > > >   tests/fate: Fix subtitle fate tests on Windows
> > > > > >   tests/source-check: Fix make inclusion-guard check
> > > > > > EOL-agnostic
> > > > >
> > > > > I think ffmpeg repositories should always be checked out with LF
> > > > > line endings, there is nothing that expects those sources to
> > > > > have CRLF. If you like you can set attributes to all files to LF
> > > > > (not only subs)
> > > >
> > > > FATE already fails when setting LF for all subtitle ref files.
> > > >
> > >
> > > What do you mean? Everything is LF based. I don't see any failures.
> >
> > Hi Kasper,
> >
> > A common misconception is that autocrlf=off would mean that you are
> > dealing just with LF line endings in Git - but that's not the case,
> > even the opposite is true: Disabling autocrlf is what actually enables
> > check-in of files with CRLF - often accidentally. But it's not always
> > accidental. Some of the FATE reference files for subtitle tests
> > actually _do_ have CRLF line endings. By specifying LF in
> > .gitattributes, CRLF would get replaced by LF and the tests will fail.
> > Setting LF in .gitattributes is something totally different from autocrlf=off.
> > The latter means "do not change line endings back-and-forth when
> > checking In and out", but what you set in .gitattributes trumps
> > autocrlf - i.e. autocrlf doesn't act on files with a .gitattributes entry about
> line endings.
> 
> I know how autocrlf works. I only said that imposing default logic that
> "Windows always must use CRLF" and git implicitly will break your committed
> line endings by default was a short sighted design decision.

I believe the original intention was simply to avoid that Windows users would
make commits with CRLF. I see it having both advantages as well as 
disadvantages. I never had major trouble with it, but I've experienced trouble
in several cases in the past, when Windows users had set autocrlf to off
(different projects, not FFmpeg).

> It's good to have options to do the conversion IF the user wants that or is
> configured as needed for a certain repository/platform.

Absolutely, yes!

> 
> > The patch may look like as if I had forgotten some of the subtitle ref
> > files, but no: I had to carefully choose the ones who need it and
> > which must not be changed.
> 
> Could you be more specific? Which ones? I think rcombs and astiob changed
> all remaining CRLF sometime in last year or even earlier.

I know, but that was about ASS primarily. 
Which ones? All the subtitle refs that I've not included in the patch in the
.gitattributes files. You can easily try be adding the remaining ones in the 
same way and running FATE.

> Either way, files are committed in the proper way in the repository, so just
> make your git client not break that on checkout.

It's not about myself.

It's that autocrlf is on by default on Windows and we cannot change that.
In this regard, I also do not accept the narrative that this would be an 
"improper" way. It is not - it is a common work pattern on Windows and
nothing is wrong about it. It's working fine and only those few FATE tests
are causing errors. It is in our best interest that people are running 
FATE before submitting patches and when FATE is failing already even 
without any changes, then it discourages people to even deal with FATE.

The fix for this is easy and simple, that's why I don't think it makes sense
to argue about what people should do and how they should work when
the reality is different. Especially, when people are getting to the point 
when they see FATE failing, it's already too late because they already
have their working setup.

> > > It works fine as is, MSYS2 won't convert this because it's separated with |.
> >
> > The fix is only needed when you are running make fate interactively
> > from a command line in an MSYS2 shell.
> 
> Hmm, I see.

Normally, I don't run FATE on MSYS2 like this myself. I came across that
issue when preparing the CI builds where I tested the script commands
locally.  It's safe in a way that it doesn't affect any other environments.

Thanks and best regards,
sw


_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant