History log of /haiku/src/build/libroot/fs_attr.cpp
Revision Date Author Comments
# 03544bf0 30-Dec-2017 Augustin Cavalier <waddlesplash@gmail.com>

libroot_build: Full passthrough to system attributes.

As it turns out, using the xattr emulation layer plus "libgnu"
causes some strange mixups at package build time, and so packages
built with it were winding up with no attributes at all.

So I've just bitten the bullet and written a full passthrough layer
to the system attributes. Verified using a full build of haiku.hpkg
this time ... after a lot of painful debugging of symlink mixups.

Hopefully I am finally rid of this plague...


# 699b4bba 29-Dec-2017 Augustin Cavalier <waddlesplash@gmail.com>

libroot_build: *Actually* fix attribute usage on Haiku.

To quote jscipione (from 95e8362c52af35a4012ca4d0facd62fb9856b619),
"Let me tell you a story about a bug" -- though this tale spans a much
lesser time than that one did.

In 5e19679ea35a79a26477c6215c7abba9bb7c4d00, I enabled libroot_build for
Haiku, instead of using the system libroot as we had before. There were
a number of bugs introduced along with this that I hadn't fixed (and there
may be more after this), but most of the obvious ones (crashes on x86_64...)
were fixed shortly enough.

Attribute usage, though, was a different story. Unlike most of the POSIX
calls in libroot, which were aliasing system functions no matter what the
platform, the attribute calls were not, as they are specific to Haiku.

Initially I had completely forgot about them, and it wasn't until a few days
later when I noticed that I had an "attributes" directory in my generated
that I realized that the "generic" attribute layer was being used on Haiku.
I attempted a fix for this in 5e19679ea35a79a26477c6215c7abba9bb7c4d00,
thinking that would clear the problem up, but I didn't actually run a test
beyond seeing that my BuildConfig had been updated properly. In fact,
BuildSetup was hard-wired to not even pass that definition through on
Haiku, and so that commit had in effect caused nothing.

My initial "fix" of just changing BuildSetup then caused a build failure,
as while libroot_build itself compiled, it ran into errors whenever attributes
were used, because in letting the real libroot's attribute calls shine
through, I had bypassed libroot_build's FD emulation/shim layer.

Then I tried and failed at three separate attempts to solve this with code:
- a version of the "fs_attr_...h" interface for Haiku. This proved possible
in theory, but in practice I would need to reimplement a lot of attribute
handling code in it, because all I had access to from there was syscalls.

- a version of "fs_attr_untyped" that bypassed its reimplementations of
the "fs*attr" functions for the libroot ones, only using the FD shim layer.
This proved possibly not even theoretically possible because it would have
caused preprocessor hell in some of the build headers, and also assumptions
about how attributes are read were totally different.

- a completely new "fs_attr_haiku" that was a completely new interface to
the fs*attr functions. This proved practically impossible because of the
need to include structures from the system libroot to call out to readdir,
etc. that attempts to solve would also have caused preprocessor hell.

Then I realized that the Linux xattr emulation library, which I'd used
as a reference when attempting the first solution, was shipped by default
as a system library in all builds of Haiku ... and so I could just tell
fs_attr_untyped to use the Linux xattr handler, and then link against libgnu.

So that is how I arrived at this strange and decidedly unorthodox solution
to a problem of my own creation.


# 503ef6d4 14-Dec-2017 Augustin Cavalier <waddlesplash@gmail.com>

build: Correct libroot_build's usage of xattrs on a Haiku host.

Implemented by just not defining the functions at all and letting
the Haiku ones shine through. In the future, though, we should wrap
them properly.

(Between the switch to libroot_build and this commit, libroot_build
was using the generic attribute emulation layer on Haiku ... whoops.)


# b360cc7f 06-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Refactored the BeOS attribute emulation using xattr a bit:
* Renamed fs_attr_xattr.cpp to libroot/fs_attr_untyped.cpp.
* Pulled the xattr specifics into a separate fs_attr_xattr.h.
* Added fs_attr_extattr.h, interfacing with FreeBSD's extattr support.
Totally untested yet. Might not even compile.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27350 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4f4e5272 07-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Under Linux it is now possible to emulate the BeOS attribute support via
xattrs. It can be enabled with the configure switch "--use-xattr". Note
that the amount of data stored in attributes may be limited by the used
file system -- e.g. AFAIK ext3 has a limit of one block (usually 4 KB)
for all attributes of a file, which might not suffice. XFS should be
fine, as should ReiserFS 3.6 (or any FS which stores attributes in
hidden files).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20609 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a9bf6ecb 07-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

libroot_build.so:
* Reorganized sources a bit:
- The descriptor support is in a separate file now.
- Disentangled the attribute support from the other stuff.
* Removed broken xattr use for attribute support.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20606 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1621d994 03-Feb-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Tried to improve the attribute support under non-BeOS compatible
build platforms a bit. Generally extended attributes seem to be
supported up to a very limited size per node, thus a one-to-one
mapping isn't a good idea, but I figured, they could at least
help to recognize when and attribute directory doesn't belong to
a node (in case the original node had been removed and the a new
one created with the same node ID).
The implementation should ensure that, but I can't really test
it, since ReiserFS 3.6 under my SuSE Linux 9.2 installation
apparently doesn't support extended attributes. So it's disabled
for the time being.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16228 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 677aaae1 07-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

HaikuBuildCompatibility.h has been renamed to BeOSBuildCompatibility.h.
Should fix the build under Linux.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14763 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 338b8dc3 29-Oct-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged changes from branch build_system_redesign at revision 14573.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14574 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b360cc7f0003ab716c974ee4bca3113d08054ed5 06-Sep-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Refactored the BeOS attribute emulation using xattr a bit:
* Renamed fs_attr_xattr.cpp to libroot/fs_attr_untyped.cpp.
* Pulled the xattr specifics into a separate fs_attr_xattr.h.
* Added fs_attr_extattr.h, interfacing with FreeBSD's extattr support.
Totally untested yet. Might not even compile.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27350 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 4f4e5272fc99dc6b2c6004c2c4f5dcff565ff6a4 07-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

Under Linux it is now possible to emulate the BeOS attribute support via
xattrs. It can be enabled with the configure switch "--use-xattr". Note
that the amount of data stored in attributes may be limited by the used
file system -- e.g. AFAIK ext3 has a limit of one block (usually 4 KB)
for all attributes of a file, which might not suffice. XFS should be
fine, as should ReiserFS 3.6 (or any FS which stores attributes in
hidden files).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20609 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a9bf6ecbab36fad5bf0abe29043a40b8b220662e 07-Apr-2007 Ingo Weinhold <ingo_weinhold@gmx.de>

libroot_build.so:
* Reorganized sources a bit:
- The descriptor support is in a separate file now.
- Disentangled the attribute support from the other stuff.
* Removed broken xattr use for attribute support.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20606 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1621d9945f401a08d3eeed9bc3baf472111393f0 03-Feb-2006 Ingo Weinhold <ingo_weinhold@gmx.de>

Tried to improve the attribute support under non-BeOS compatible
build platforms a bit. Generally extended attributes seem to be
supported up to a very limited size per node, thus a one-to-one
mapping isn't a good idea, but I figured, they could at least
help to recognize when and attribute directory doesn't belong to
a node (in case the original node had been removed and the a new
one created with the same node ID).
The implementation should ensure that, but I can't really test
it, since ReiserFS 3.6 under my SuSE Linux 9.2 installation
apparently doesn't support extended attributes. So it's disabled
for the time being.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16228 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 677aaae1873ffbe00493ecc193264e07bd7e4bf0 07-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

HaikuBuildCompatibility.h has been renamed to BeOSBuildCompatibility.h.
Should fix the build under Linux.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14763 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 338b8dc301721b1f472e8297a898d4eaa2f2ee3a 29-Oct-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged changes from branch build_system_redesign at revision 14573.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14574 a95241bf-73f2-0310-859d-f6bbb57e9c96