From: Donald Buczek <buczek@molgen.mpg.de>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [QUESTION] zig build systems fails on XFS V4 volumes
Date: Tue, 6 Feb 2024 07:45:22 +0100 [thread overview]
Message-ID: <c171c058-fc69-4e47-aca1-c1a35a774038@molgen.mpg.de> (raw)
In-Reply-To: <ZcFPf8R8geZwBgIV@dread.disaster.area>
On 2/5/24 22:13, Dave Chinner wrote:
> On Mon, Feb 05, 2024 at 02:12:43PM +0100, Donald Buczek wrote:
>> On 2/4/24 22:56, Dave Chinner wrote:
>>> On Sat, Feb 03, 2024 at 06:50:31PM +0100, Donald Buczek wrote:
>>>> Dear Experts,
>>>>
>>>> I'm encountering consistent build failures with the Zig
>>>> language from source on certain systems, and I'm seeking
>>>> insights into the issue.
>>>>
> The reason for this difference seems obvious: there's a distinct
> lack of stat() calls in the ftype=0 (bad) case. dirent->d_type in
> this situation will be reporting DT_UNKNOWN for all entries except
> '.' and '..'. It is the application's responsibility to handle this,
> as the only way to determine if a DT_UNKNOWN entry is a directory is
> to stat() the pathname and look at the st_mode returned.
You've nailed it. [1][2]
I'll take this over to the zig community.
Thanks!
Donald
[1]: https://github.com/ziglang/zig/blob/39ec3d311673716e145957d6d81f9d4ec7848471/lib/std/fs/Dir.zig#L372
[2]: https://github.com/ziglang/zig/blob/39ec3d311673716e145957d6d81f9d4ec7848471/lib/std/fs/Dir.zig#L669
>
> The code is clearly not doing this, and so I'm guessing that the zig
> people have rolled their own nftw() function and didn't pay
> attention to the getdents() man page:
>
> Currently, only some filesystems (among them: Btrfs, ext2,
> ext3, and ext4) have full support for returning the file
> type in d_type. All applications must properly handle a
> return of DT_UNKNOWN.
>
> So, yeah, looks like someone didn't read the getdents man page
> completely and it's not a filesystem issue.
>
> -Dave.
--
Donald Buczek
buczek@molgen.mpg.de
Tel: +49 30 8413 1433
prev parent reply other threads:[~2024-02-06 6:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-03 17:50 [QUESTION] zig build systems fails on XFS V4 volumes Donald Buczek
2024-02-04 21:56 ` Dave Chinner
2024-02-05 13:12 ` Donald Buczek
2024-02-05 21:13 ` Dave Chinner
2024-02-06 6:45 ` Donald Buczek [this message]
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=c171c058-fc69-4e47-aca1-c1a35a774038@molgen.mpg.de \
--to=buczek@molgen.mpg.de \
--cc=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).