[FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC

Julio C. Rocha dev at rocha.red
Mon Oct 3 11:05:09 EEST 2022


On Sun, Oct 2, 2022 at 5:14 PM Timo Rothenpieler <timo at rothenpieler.org>
wrote:

> On 03.10.2022 01:47, Julio C. Rocha wrote:
> > ---
> >   configure | 7 ++++++-
> >   1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/configure b/configure
> > index 6712d045d9..f5f5eb29dd 100755
> > --- a/configure
> > +++ b/configure
> > @@ -4847,7 +4847,12 @@ probe_cc(){
> >           else
> >               _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d
> '\r')
> >           fi
> > -        _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 |
> awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if
> (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
> > +        if [ "$(grep -i Microsoft /proc/version)" ]; then
>
> Not convinced that this is a good check.
> I can think of a few other situations where Microsoft might appear in
> there. Like, for example on one of their servers, Azure Cloud, Github
> Actions and so on.
>
This was recommended at the WSL discussion forum.
https://github.com/microsoft/WSL/issues/4071#issuecomment-496737093

Moreover, those situations do not apply.
Microsoft infrastructure images use the "azure" denomination, and not
"Microsoft".

Here is a sample from an Azure Cloud Ubuntu image's /proc/version content:
Linux version 5.15.0-1020-azure (buildd at lcy02-amd64-081) (gcc (Ubuntu
9.4.0-1ubuntu1~20.04.1) 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34)
#25~20.04.1-Ubuntu SMP Thu Sep 1 19:20:56 UTC 2022


> > +            # Windows Subsystem for Linux
> > +            _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $<
> 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if
> (!match($$0, / /)) { cmd="/usr/bin/wslpath \x27" $$0 "\x27"; cmd |& getline
> pth; print "$@:", pth } }'\'' > $(@:.o=.d)'
> > +        else
> > +            _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $<
> 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if
> (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
> > +        fi
> >           _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
> >           _cflags_speed="-O2"
> >           _cflags_size="-O1"
>
>
> What actual issue is this solving?
> I've been building in WSL for years, including MSVC builds, and never
> encountered any problems.
>
As of the latest commit in the master branch, the following does not work
for me out of the box:

   1. Open WSL
   2. Change directory to the ffmpeg clone.
   3. ./configure --toolchain=msvc
   Succeeds
   4. make
   Succeeds
   5. make install
   Fails due to the ".d" generated files containing paths such as
   'C:/path/to/header.h', which are accepted by CYGWIN, but not by WSL, which
   expects actual UNIX paths.
   This also breaks `make clean`.

Has the procedure above worked for you for years?


More information about the ffmpeg-devel mailing list