Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: nil-admirari@mailo.com
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH v11 1/6] libavutil/wchar_filename.h: Add whcartoutf8, wchartoansi and utf8toansi
Date: Thu,  5 May 2022 22:20:19 +0200 (CEST)
Message-ID: <ea-mime-62743183-33ea-6f8e3ba2@www-7.mailo.com> (raw)
In-Reply-To: <DM8P223MB03657446EB103B80211891A1BAFF9@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM>

> Yes, because there is no realistic case in which ffmpeg will need
> to load any dll from a long path.
> I've asked you multiple times to give an example.

Managed to find time to actually test: https://postimg.cc/F1C64nq1.
Windows 10 21H2 LTSC, long paths are enabled and 8.3 paths are disabled
via group policy.

CMD is capable of starting applications from long paths: test app prints get_module_filename().
As can be seen from the output, module path is an actual long path, not 8.3 short name.
Windows is clearly capable of running apps from long paths. Always was
via the first argument to CreateProcess, prefixed with your favourite \\?\.
This facility is no longer esoteric and is available to end users via CMD.

FFmpeg in its current form doesn't work when started from a long path,
even with these patches. It prints nothing and just returns a non-zero exit code.
That's a problem with FFmpeg. Something in FFmpeg startup breaks down
when running from a long path, though it's not clear exactly what.

You're talking about realistic use cases as if someone made a careful analysis
of use cases before putting the limit in place. No one did, the limit came from the OS.
OS no longer has this limit, so neither should FFmpeg.

> So, ffmpeg should implement something that doesn't work without a
> registry change in order to "pressure Microsoft" to change it at
> some point in the future?

Things are implemented in order to provide features, not to pressure someone.
You still have to abide by API's contract, however. Long paths are enabled
by a registry tweak, and that's how things are.

> I apologize when I have created the impression that ffmpeg should
> be left as is and users should continue adding the long path prefix
> themselves. I'm not opposed to adding support for long paths, I'm
> just opposed to the method.

As a matter of fact, you are. Your alternative method implies ploughing
through hundreds of C files normalising path handling across the entire application,
and then fixing numerous regressions introduced along the way. No one is doing that,
just too much work. Manifest is the only practically implementable solution,
and if it's not accepted, FFmpeg stays as it is and users are forced to continue
to manually prefix all paths.

Of course, if you think so strongly that \\?\ is the right way to go,
then how about writing the necessary patches yourself?

And even then I have some bad news for you. MAX_PATH-sized buffers simply do not work
with long paths, even the ones that start with \\?\. You will still have to replace
them with dynamically allocated buffers. And that's what the majority of this patch-set
is about, not about the manifest. Manifest is just a single patch.

> Implementing long path support by adding the prefix is not
> a "workaround". Those kinds of paths are part of OS functionality
> since Windows NT and will still work in Windows 20 or whatever
> may come.

It is and always was. \\?\ support none of the usual path handling
such as relative paths, slash-collapsing, removal of . from paths etc.

> Because with the first, you cannot rely that long paths are
> working, you would be stuck needing to continue prefixing paths
> manually "forever".
> (to also cover cases where it's not working)

No one is prefixing the paths. Neither end users, nor application writers.
If it doesn't work without a prefix, it doesn't work at all, and you end up
without any long path support whatsoever.

> IIRC this code is handling code paths relative to the executable path,
> and the executable doesn't run from a long path anyway.

Because it's broken in FFmpeg, not because you cannot run an app from a long path.
See above.

> > This patchset does not provide reliable behavior.
> ...
> You know what I meant: it's not activated by default.

Not active by default is not the same as not reliable.

> What is in the hands of ffmpeg though, is requiring a change which
> needs administrative privileges or not.

It doesn't require administrative rights. It requires a registry tweak.
If you don't have admin rights but still need the feature, you can ask
your system administrator.

> I don't want to argue about the term lottery.

You're perfectly willing to use it.

> What I'm saying is that a solution is preferable which doesn't have
> an "Otherwise it doesn't" part.

As Thomas Sowell has put it: "There are no solutions. There are only trade-offs."
Do not pretend that \\?\ is even practical, considering the scope of changes required
to implement it.



_______________________________________________
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".

  reply	other threads:[~2022-05-05 20:20 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-24 12:08 nil-admirari
2022-04-24 22:04 ` Soft Works
2022-04-25  9:03   ` nil-admirari
2022-04-25  9:31     ` Soft Works
2022-04-25  9:51       ` nil-admirari
2022-04-25 11:12         ` Soft Works
2022-04-25 12:51           ` Hendrik Leppkes
2022-04-25 13:02             ` Martin Storsjö
2022-04-25 13:36               ` Soft Works
2022-04-29 19:08                 ` nil-admirari
2022-04-25 13:17             ` Soft Works
2022-04-29 18:59               ` nil-admirari
2022-04-29 18:52           ` nil-admirari
2022-04-30 12:34             ` Soft Works
2022-05-05 20:20               ` nil-admirari [this message]
2022-05-05 22:38                 ` Soft Works
2022-05-06 16:07                   ` nil-admirari
2022-05-07  2:57                     ` Soft Works
2022-05-07 17:33                       ` nil-admirari
2022-05-07 17:59                         ` Soft Works
2022-05-10 21:22                           ` nil-admirari
2022-05-10 22:59                             ` Soft Works
2022-05-10 23:32                               ` Soft Works
2022-05-11  7:46                                 ` Tobias Rapp
2022-05-11  7:57                                   ` Soft Works
2022-05-11  8:08                                     ` Hendrik Leppkes
2022-05-11  9:03                                     ` nil-admirari
2022-05-11 13:32                                     ` Tobias Rapp
2022-05-11 20:50                                       ` Soft Works
2022-05-11  8:57                               ` nil-admirari
2022-05-14  0:42                                 ` Soft Works
2022-05-15 19:53                                   ` nil-admirari
2022-05-15 20:34                                     ` Soft Works
2022-05-16  8:49                                       ` nil-admirari
2022-05-08 19:48                       ` Martin Storsjö
2022-04-25 20:51     ` Stephen Hutchinson
2022-04-29 19:25       ` nil-admirari
  -- strict thread matches above, loose matches on Subject: below --
2022-04-23 20:56 Nil Admirari
2022-04-24  3:39 ` Soft Works
2022-05-07 17:57 ` Soft Works

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ea-mime-62743183-33ea-6f8e3ba2@www-7.mailo.com \
    --to=nil-admirari@mailo.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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