Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 0/1] Enable building in Windows Subsystem for Linux and MSVC compilers
@ 2022-10-02 23:47 Julio C. Rocha
  2022-10-02 23:47 ` [FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC Julio C. Rocha
  0 siblings, 1 reply; 11+ messages in thread
From: Julio C. Rocha @ 2022-10-02 23:47 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Julio C. Rocha

When building on Windows (CYGWIN or WSL), generated .d files contain the
MSYS2/CYGWIN path format (i.e. C:/MyRepos/ffmpeg).
This causes make commands such as clean an install to fail when running on WSL.

This patch detects whether WSL is being used and converts the paths to standard
UNIX paths (i.e /mnt/c/MyRepos/ffmpeg).

Julio C. Rocha (1):
  Enable building with WSL and MSVC

 configure | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

-- 
2.37.0 (Apple Git-136)

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC
  2022-10-02 23:47 [FFmpeg-devel] [PATCH 0/1] Enable building in Windows Subsystem for Linux and MSVC compilers Julio C. Rocha
@ 2022-10-02 23:47 ` Julio C. Rocha
  2022-10-03  0:14   ` Timo Rothenpieler
  2022-10-08  8:39   ` Julio C. Rocha
  0 siblings, 2 replies; 11+ messages in thread
From: Julio C. Rocha @ 2022-10-02 23:47 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: Julio C. Rocha

---
 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
+            # 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"
-- 
2.37.0 (Apple Git-136)

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC
  2022-10-02 23:47 ` [FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC Julio C. Rocha
@ 2022-10-03  0:14   ` Timo Rothenpieler
  2022-10-03  0:19     ` Pierre-Anthony Lemieux
  2022-10-03  8:05     ` Julio C. Rocha
  2022-10-08  8:39   ` Julio C. Rocha
  1 sibling, 2 replies; 11+ messages in thread
From: Timo Rothenpieler @ 2022-10-03  0:14 UTC (permalink / raw)
  To: ffmpeg-devel

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.

> +            # 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.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC
  2022-10-03  0:14   ` Timo Rothenpieler
@ 2022-10-03  0:19     ` Pierre-Anthony Lemieux
  2022-10-03  8:10       ` Julio C. Rocha
  2022-10-03  8:05     ` Julio C. Rocha
  1 sibling, 1 reply; 11+ messages in thread
From: Pierre-Anthony Lemieux @ 2022-10-03  0:19 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Sun, Oct 2, 2022 at 5:14 PM Timo Rothenpieler <timo@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.
>
> > +            # 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.

FWIW. I am currently building on WSL:

$ uname -a
Linux pal-xxxxx 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2
00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.4 LTS
Release:        20.04
Codename:       focal

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC
  2022-10-03  0:14   ` Timo Rothenpieler
  2022-10-03  0:19     ` Pierre-Anthony Lemieux
@ 2022-10-03  8:05     ` Julio C. Rocha
  1 sibling, 0 replies; 11+ messages in thread
From: Julio C. Rocha @ 2022-10-03  8:05 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Sun, Oct 2, 2022 at 5:14 PM Timo Rothenpieler <timo@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@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?
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC
  2022-10-03  0:19     ` Pierre-Anthony Lemieux
@ 2022-10-03  8:10       ` Julio C. Rocha
  2022-10-03 15:20         ` Pierre-Anthony Lemieux
  0 siblings, 1 reply; 11+ messages in thread
From: Julio C. Rocha @ 2022-10-03  8:10 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Sun, Oct 2, 2022 at 5:19 PM Pierre-Anthony Lemieux <pal@sandflow.com>
wrote:

> On Sun, Oct 2, 2022 at 5:14 PM Timo Rothenpieler <timo@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.
> >
> > > +            # 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.
>
> FWIW. I am currently building on WSL:
>
> $ uname -a
> Linux pal-xxxxx 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2
> 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
>
> $ lsb_release -a
> No LSB modules are available.
> Distributor ID: Ubuntu
> Description:    Ubuntu 20.04.4 LTS
> Release:        20.04
> Codename:       focal
>

Noted, Pierre.
Are you able to build using the Visual Studio compilers (MSVC) without any
further hacking?

Example workflow:
cd /path/to/ffmpeg-clone
./configure --toolchain=msvc
make
make install

Thanks.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC
  2022-10-03  8:10       ` Julio C. Rocha
@ 2022-10-03 15:20         ` Pierre-Anthony Lemieux
  2022-10-04  0:28           ` Julio C. Rocha
  0 siblings, 1 reply; 11+ messages in thread
From: Pierre-Anthony Lemieux @ 2022-10-03 15:20 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Mon, Oct 3, 2022 at 1:11 AM Julio C. Rocha <dev@rocha.red> wrote:
>
> On Sun, Oct 2, 2022 at 5:19 PM Pierre-Anthony Lemieux <pal@sandflow.com>
> wrote:
>
> > On Sun, Oct 2, 2022 at 5:14 PM Timo Rothenpieler <timo@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.
> > >
> > > > +            # 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.
> >
> > FWIW. I am currently building on WSL:
> >
> > $ uname -a
> > Linux pal-xxxxx 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2
> > 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
> >
> > $ lsb_release -a
> > No LSB modules are available.
> > Distributor ID: Ubuntu
> > Description:    Ubuntu 20.04.4 LTS
> > Release:        20.04
> > Codename:       focal
> >
>
> Noted, Pierre.
> Are you able to build using the Visual Studio compilers (MSVC) without any
> further hacking?

I had never tried it. Quick attempt results in:

$ ./configure --toolchain=msvc
cl.exe is unable to create an executable file.
If cl.exe is a cross-compiler, use the --enable-cross-compile option.

>
> Example workflow:
> cd /path/to/ffmpeg-clone
> ./configure --toolchain=msvc
> make
> make install
>
> Thanks.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC
  2022-10-03 15:20         ` Pierre-Anthony Lemieux
@ 2022-10-04  0:28           ` Julio C. Rocha
  0 siblings, 0 replies; 11+ messages in thread
From: Julio C. Rocha @ 2022-10-04  0:28 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Mon, Oct 3, 2022 at 8:21 AM Pierre-Anthony Lemieux <pal@sandflow.com>
wrote:

> On Mon, Oct 3, 2022 at 1:11 AM Julio C. Rocha <dev@rocha.red> wrote:
> >
> > On Sun, Oct 2, 2022 at 5:19 PM Pierre-Anthony Lemieux <pal@sandflow.com>
> > wrote:
> >
> > > On Sun, Oct 2, 2022 at 5:14 PM Timo Rothenpieler <
> timo@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.
> > > >
> > > > > +            # 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.
> > >
> > > FWIW. I am currently building on WSL:
> > >
> > > $ uname -a
> > > Linux pal-xxxxx 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2
> > > 00:30:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
> > >
> > > $ lsb_release -a
> > > No LSB modules are available.
> > > Distributor ID: Ubuntu
> > > Description:    Ubuntu 20.04.4 LTS
> > > Release:        20.04
> > > Codename:       focal
> > >
> >
> > Noted, Pierre.
> > Are you able to build using the Visual Studio compilers (MSVC) without
> any
> > further hacking?
>
> I had never tried it. Quick attempt results in:
>
> $ ./configure --toolchain=msvc
> cl.exe is unable to create an executable file.
> If cl.exe is a cross-compiler, use the --enable-cross-compile option.
>

There are a couple of missing steps:

   1. Enter the Visual Studio Developer Command Prompt (or Native Tools
   Command Prompt).
   See
   https://learn.microsoft.com/en-us/visualstudio/ide/reference/command-prompt-powershell?view=vs-2022
   2. Add the following entries to the `WSLENV` environment variable (so
   the necessary paths are passed to the wsl instance):
   CommandPromptType
   DevEnvDir
   ExtensionSdkDir
   EXTERNAL_INCLUDE
   INCLUDE
   LIB
   LIBPATH
   UCRTVersion
   UniversalCRTSdkDir
   VCIDEInstallDir
   VCINSTALLDIR
   VCToolsInstallDir
   VCToolsRedistDir
   VCToolsVersion
   VisualStudioVersion
   VS170COMNTOOLS
   VSCMD_ARG_app_plat
   VSCMD_ARG_HOST_ARCH
   VSCMD_ARG_TGT_ARCH
   VSCMD_ARG_VCVARS_VER
   VSCMD_ARG_winsdk
   VSCMD_VER
   VSINSTALLDIR
   VSSDK150INSTALL
   VSSDKINSTALL
   WindowsLibPath
   WindowsSDK_ExecutablePath_x64
   WindowsSDK_ExecutablePath_x86
   WindowsSdkBinPath
   WindowsSdkDir
   WindowsSDKLibVersion
   WindowsSdkVerBinPath
   WindowsSDKVersion
   3. Start WSL from that command prompt.
   4. Go to the ffmpeg clone.
   5. ./configure  --toolchain=msvc
   6. make
   Succeeds, because it only generates the .d files without using them this
   first time around.
   7. make install
   Or clean, or pretty much any other subsequent make target.
   Will fail with the following message:
   doc/print_options.d:1: *** target pattern contains no '%'.  Stop.

Looking into doc/print_options.d (or any other generated .d file), contents
are like this:
doc/print_options.o: D:/Extra/ffmpeg/wsl/libavutil/attributes.h
...

Such paths work fine with CYGWIN, but not with a real Linux userland (such
as WSL).
Running ./configure with this proposed patch fixes the issue, generating .d
files with content like this:
doc/print_options.o: /mnt/d/Extra/ffmpeg/wsl/libavutil/attributes.h
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC
  2022-10-02 23:47 ` [FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC Julio C. Rocha
  2022-10-03  0:14   ` Timo Rothenpieler
@ 2022-10-08  8:39   ` Julio C. Rocha
  2022-10-08 23:30     ` Carl Eugen Hoyos
  1 sibling, 1 reply; 11+ messages in thread
From: Julio C. Rocha @ 2022-10-08  8:39 UTC (permalink / raw)
  To: ffmpeg-devel

On Sun, Oct 2, 2022 at 4:48 PM Julio C. Rocha <dev@rocha.red> 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
> +            # 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"
> --
> 2.37.0 (Apple Git-136)
>
>
Hi! I'd like to re-request feedback for this patch.

To clarify, it allows building FFmpeg using MSVC over WSL, without any
dependency on MinGW or MSYS.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC
  2022-10-08  8:39   ` Julio C. Rocha
@ 2022-10-08 23:30     ` Carl Eugen Hoyos
  2022-10-10  8:02       ` Julio C. Rocha
  0 siblings, 1 reply; 11+ messages in thread
From: Carl Eugen Hoyos @ 2022-10-08 23:30 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

Am Sa., 8. Okt. 2022 um 10:39 Uhr schrieb Julio C. Rocha <dev@rocha.red>:
>
> On Sun, Oct 2, 2022 at 4:48 PM Julio C. Rocha <dev@rocha.red> 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
> > +            # 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"
> > --
> > 2.37.0 (Apple Git-136)
> >
> >
> Hi! I'd like to re-request feedback for this patch.
>
> To clarify, it allows building FFmpeg using MSVC over WSL, without any
> dependency on MinGW or MSYS.

You write in your own explanations "Succeeds" - this and what the patch
is meant to fix are missing from your commit message.

Your patch would not work here - sadly, cl.exe does not print "including"
for all installations.

I build FFmpeg regularly with wsl and msvc and others do as well.
Dependency files are simply empty here (because cl.exe prints
"Einlesen der Datei" here).

Dependency generation works for me with --dep-cc=clang-cl.exe but
I normally just build without it.

Carl Eugen
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC
  2022-10-08 23:30     ` Carl Eugen Hoyos
@ 2022-10-10  8:02       ` Julio C. Rocha
  0 siblings, 0 replies; 11+ messages in thread
From: Julio C. Rocha @ 2022-10-10  8:02 UTC (permalink / raw)
  To: FFmpeg development discussions and patches

On Sat, Oct 8, 2022 at 4:37 PM Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:

> Am Sa., 8. Okt. 2022 um 10:39 Uhr schrieb Julio C. Rocha <dev@rocha.red>:
> >
> > On Sun, Oct 2, 2022 at 4:48 PM Julio C. Rocha <dev@rocha.red> 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
> > > +            # 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"
> > > --
> > > 2.37.0 (Apple Git-136)
> > >
> > >
> > Hi! I'd like to re-request feedback for this patch.
> >
> > To clarify, it allows building FFmpeg using MSVC over WSL, without any
> > dependency on MinGW or MSYS.
>
> Hi Carl.
I'm new to building FFmpeg, so need to make some follow-up questions.


> You write in your own explanations "Succeeds" - this and what the patch
> is meant to fix are missing from your commit message.
>
Should I resubmit the patch from scratch with an improved commit message?


> Your patch would not work here - sadly, cl.exe does not print "including"
> for all installations.
>
Can you please elaborate?
If I understand correctly, you are saying older versions of CL.EXE would
not print "including".
Wouldn't that also be an issue for the non-WSL case currently existing in
the configure script?:
else
            _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 |
awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if
(!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'

To finish this point, what sort of installations would fail with the
proposed patch?


> I build FFmpeg regularly with wsl and msvc and others do as well.
> Dependency files are simply empty here (because cl.exe prints
> "Einlesen der Datei" here).

Do you still rely on msys/mingw packages?
This patch tries to address this by removing such dependency.
How can I configure FFmpeg to ignore/leave empty the dependency files?


> Dependency generation works for me with --dep-cc=clang-cl.exe but
> I normally just build without it.
>
> Using clang-cl may not be an option when the software to be integrated
with a specific FFmpeg build expects binary compatibility with plain MSVC.

Looking forward to applying the suggestions once clarified.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-10-10  8:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-02 23:47 [FFmpeg-devel] [PATCH 0/1] Enable building in Windows Subsystem for Linux and MSVC compilers Julio C. Rocha
2022-10-02 23:47 ` [FFmpeg-devel] [PATCH 1/1] Enable building with WSL and MSVC Julio C. Rocha
2022-10-03  0:14   ` Timo Rothenpieler
2022-10-03  0:19     ` Pierre-Anthony Lemieux
2022-10-03  8:10       ` Julio C. Rocha
2022-10-03 15:20         ` Pierre-Anthony Lemieux
2022-10-04  0:28           ` Julio C. Rocha
2022-10-03  8:05     ` Julio C. Rocha
2022-10-08  8:39   ` Julio C. Rocha
2022-10-08 23:30     ` Carl Eugen Hoyos
2022-10-10  8:02       ` Julio C. Rocha

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git