Discussion:
Fork of current version of »hfs« package
(too old to reply)
John Paul Adrian Glaubitz
2023-05-30 11:30:01 UTC
Permalink
Hello!

I have started working on an updated »hfsprogs« packages based on the
split-out version of the HFS(+) code in the »hfs« package. For this,
I have forked Apple's original »hfs« package on Github [1].

Feel free to start contributing. It's currently work-in-progress as
»fsck_hfs« does not compile yet and the code needs further clean-up
which I will be doing later this week.

Adrian
[1] https://github.com/glaubitz/hfs/tree/linux
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
John Paul Adrian Glaubitz
2023-05-30 20:50:01 UTC
Permalink
Hi Lennart!
I had a poke at it, dealt with a couple of compile issues, then
encountered Blocks and went WTF did Apple invent here? I don't even
understand the description of their proprietary extension to C/C++/ObjC.
I had never seen code with ^ prefixed to things in this way and since I
don't understand what Blocks are supposed to accomplish I have no idea
how to remove them from the code.
The BlocksRuntime library is already partially patched out on my »linux« branch
https://github.com/glaubitz/hfs/commit/d6ea3fe324a6b018ebe7934b9f95a624b047dc2d
https://src.fedoraproject.org/rpms/hfsplus-tools/blob/rawhide/f/hfsplus-tools-no-blocks.patch
Additional occurrences should be patched out in a similar way.

Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Ken Cunningham
2023-05-30 21:00:02 UTC
Permalink
The blocksruntime library is easy to build and available broadly, in case just including it becomes the easier path.

http://ftp.debian.org/debian/pool/main/libb/libblocksruntime/libblocksruntime_0.4.1.orig.tar.gz

Ken
Post by John Paul Adrian Glaubitz
Hi Lennart!
I had a poke at it, dealt with a couple of compile issues, then
encountered Blocks and went WTF did Apple invent here? I don't even
understand the description of their proprietary extension to C/C++/ObjC.
I had never seen code with ^ prefixed to things in this way and since I
don't understand what Blocks are supposed to accomplish I have no idea
how to remove them from the code.
The BlocksRuntime library is already partially patched out on my »linux« branch
https://github.com/glaubitz/hfs/commit/d6ea3fe324a6b018ebe7934b9f95a624b047dc2d
https://src.fedoraproject.org/rpms/hfsplus-tools/blob/rawhide/f/hfsplus-tools-no-blocks.patch
Additional occurrences should be patched out in a similar way.
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
John Paul Adrian Glaubitz
2023-05-30 21:40:01 UTC
Permalink
Post by Ken Cunningham
The blocksruntime library is easy to build and available broadly,
in case just including it becomes the easier path.
http://ftp.debian.org/debian/pool/main/libb/libblocksruntime/libblocksruntime_0.4.1.orig.tar.gz
The library has clang has a hard requirement which I don't consider
Post by Ken Cunningham
https://buildd.debian.org/status/package.php?p=libblocksruntime&suite=sid
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Ken Cunningham
2023-05-30 23:10:01 UTC
Permalink
Yes, Iain Sandoe has had the blocks patches in his gcc repos for many years now (2016 at least) but has not yet had them polished up enough to push them to gcc mainline.

If gcc is a hard requirement for you then no option. Just trying to make this as easy as possible...

K
Post by John Paul Adrian Glaubitz
Post by Ken Cunningham
The blocksruntime library is easy to build and available broadly,
in case just including it becomes the easier path.
http://ftp.debian.org/debian/pool/main/libb/libblocksruntime/libblocksruntime_0.4.1.orig.tar.gz
The library has clang has a hard requirement which I don't consider
Post by Ken Cunningham
https://buildd.debian.org/status/package.php?p=libblocksruntime&suite=sid
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
John Paul Adrian Glaubitz
2023-05-30 23:40:01 UTC
Permalink
Post by Ken Cunningham
Yes, Iain Sandoe has had the blocks patches in his gcc repos for many years now (2016 at least) but has not yet had them polished up enough to push them to gcc mainline.
If gcc is a hard requirement for you then no option. Just trying to make this as easy as possible...
I don’t have a hard requirement on gcc, but
hfs currently has a hard requirement on
clang which isn’t available on all Debian
targets.

Adrian
Lennart Sorensen
2023-05-30 20:50:01 UTC
Permalink
Post by John Paul Adrian Glaubitz
Hello!
I have started working on an updated »hfsprogs« packages based on the
split-out version of the HFS(+) code in the »hfs« package. For this,
I have forked Apple's original »hfs« package on Github [1].
Feel free to start contributing. It's currently work-in-progress as
»fsck_hfs« does not compile yet and the code needs further clean-up
which I will be doing later this week.
Adrian
[1] https://github.com/glaubitz/hfs/tree/linux
I had a poke at it, dealt with a couple of compile issues, then
encountered Blocks and went WTF did Apple invent here? I don't even
understand the description of their proprietary extension to C/C++/ObjC.

I had never seen code with ^ prefixed to things in this way and since I
don't understand what Blocks are supposed to accomplish I have no idea
how to remove them from the code.
--
Len Sorensen
Riccardo Mottola
2023-05-30 21:50:01 UTC
Permalink
Hi Lennart,
I had a poke at it, dealt with a couple of compile issues, then
encountered Blocks and went WTF did Apple invent here? I don't even
understand the description of their proprietary extension to C/C++/ObjC.
I had never seen code with ^ prefixed to things in this way and since I
don't understand what Blocks are supposed to accomplish I have no idea
how to remove them from the code.
hateful language extensions, I too miss to find the complex, while the
concept should be simple. A matter of habits perhaps.
Anyway, often, they are just used where in classic code "callback
functions" were used. Maybe that's your case too.

Riccardo
Jeffrey Walton
2023-05-31 01:30:01 UTC
Permalink
On Tue, May 30, 2023 at 4:40 PM Lennart Sorensen
Post by John Paul Adrian Glaubitz
I have started working on an updated »hfsprogs« packages based on the
split-out version of the HFS(+) code in the »hfs« package. For this,
I have forked Apple's original »hfs« package on Github [1].
Feel free to start contributing. It's currently work-in-progress as
»fsck_hfs« does not compile yet and the code needs further clean-up
which I will be doing later this week.
[1] https://github.com/glaubitz/hfs/tree/linux
I had a poke at it, dealt with a couple of compile issues, then
encountered Blocks and went WTF did Apple invent here? I don't even
understand the description of their proprietary extension to C/C++/ObjC.
Blocks are like C++ lamda's. ObjC folks like to use them to ensure
cleanup in a function, like releasing a handle or free'ing memory.
I had never seen code with ^ prefixed to things in this way and since I
don't understand what Blocks are supposed to accomplish I have no idea
how to remove them from the code.
Jeff
Lennart Sorensen
2023-05-31 03:20:01 UTC
Permalink
Post by Jeffrey Walton
Blocks are like C++ lamda's. ObjC folks like to use them to ensure
cleanup in a function, like releasing a handle or free'ing memory.
Funny how the high level description of them couldn't even bother so
explain that. That does make some sense.
--
Len Sorensen
Jeffrey Walton
2023-05-31 04:20:01 UTC
Permalink
On Tue, May 30, 2023 at 11:12 PM Lennart Sorensen
Post by Lennart Sorensen
Post by Jeffrey Walton
Blocks are like C++ lamda's. ObjC folks like to use them to ensure
cleanup in a function, like releasing a handle or free'ing memory.
Funny how the high level description of them couldn't even bother so
explain that. That does make some sense.
Yeah, I remember NSBlock from ObjC programming back in the day. Then
blocks started showing up on other platforms due to Clang providing
them. For example, Asterisk PBX software uses them to tame their
memory leaks. Asterisk used to leak like a sieve. Asterisk only builds
with Clang because of them.

Jeff
Mark Cave-Ayland
2023-05-31 13:20:01 UTC
Permalink
Post by John Paul Adrian Glaubitz
Hello!
I have started working on an updated »hfsprogs« packages based on the
split-out version of the HFS(+) code in the »hfs« package. For this,
I have forked Apple's original »hfs« package on Github [1].
Feel free to start contributing. It's currently work-in-progress as
»fsck_hfs« does not compile yet and the code needs further clean-up
which I will be doing later this week.
Adrian
[1] https://github.com/glaubitz/hfs/tree/linux
Hi Adrian,

Presumably this still can't be used for the Debian installer because of the license?
Or has there been an update from Apple on this?


ATB,

Mark.
John Paul Adrian Glaubitz
2023-05-31 13:30:01 UTC
Permalink
Hi Mark!
Post by Mark Cave-Ayland
Presumably this still can't be used for the Debian installer because of the license?
Or has there been an update from Apple on this?
I have not heard back from Apple yet, so there is no change in license yet.

My idea was to start working on the split-out »hfs« package anyway since I am
eventually going to update the »hfsprogs« package in Debian unstable anyway.

Currently, »hfsprogs« in Debian is based on »diskdev_cmds«. After version 557.x,
Apple decided to split out the HFS(+) filesystem code into a separate package
called »hfs« and my hope is that this fact might lower the barrier for them to
change the license from APSL to MIT or BSD.

Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Loading...