-
-
Notifications
You must be signed in to change notification settings - Fork 762
borg on haiku #4117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi, I didn't try Borg yet, but I've head quite good stuff about it. I don't have much time now to try as I already have a long list of things to port, but I can give some hints. Attributes… well, first, Haiku's concept of xattrs (inherited from BeOS) is a bit different than the (already numerous) variants is found in *nix. First, they aren't just name/value pairs, but triplets, since they also have a type (a 32bit 4CC). This allows many interesting things like indexing them properly, storing int and float values faster than having to parse strings, and knowing how to display them properly in the GUI (with more help from the MIME database). They aren't limited in size, as they can be allocated just like regular files, although usually very small (but when cross-building Haiku on Linux we did hit the ext2 limit of 2k/inode for some apps so we added wrappers around that). Also, we make extensive use of xattrs (MIME type, preferred app, even icons…). In fact, some files, like People files (contacts) are empty files with many xattrs. So for a backup software to actually be useful on Haiku it really must support them properly. There are dir-like functions to list a file's xattrs (fs_open_attr_dir) and read them. Then BFS itself has indices (B+Trees based hidden directories) for the attributes we ask it to maintain. the kernel has entry points to open index as dirs, and also run queries to find files matching formulas on attributes. I don't think indices really need backuping since they are just shadow view of the fs (except maybe the actual list of indices themselves). You'll find more infos about attributes in Storage Kit in the BeBook (oddly we don't mention the attr functions in our API Guide), Programming guides, the book describing the BFS : Practical Filesystem Design. We do have some libattr schim around, but it's not complete IIRC. At least I recall not finding the mangling scheme very correct. Btw, it's not a Haiku-only issue, NTFS implementations on Linux also differ in their mangling schemes and screw up. I wrote a paper about properly storing xattrs on various systems for DC2011, but it seems nobody reads papers. And sadly they are always left of things like NextCloud and other things. I'm not even sure our rsync port handles them correctly. I guess I'll have to fix that myself. Now, we don't have any concept of ACL at the moment, and no port of libacl (which was the only reason for the xattrs to ever exist before they were withdrawn from POSIX IIRC). Historically BFS had a (not really used) SYS:* namespace reserved for system stuff (similar to the kernel.* on ext2), which we reused for packagefs, which has SYS:PACKAGE which returns which package a file comes from. The rest of the fs should be visible through the POSIX API. Our stat struct has some more fields like create time, that BFS maintains. Aside from live queries, we also support node monitoring (which BeOS had way before Linux ever had any of the inotify ancestors) with a different notification mechanism than signals though, but I don't know if it's used in Borg at all. I just wrote support for that in the owncloud client, I should publish that soon. About gcc, we use gcc2 for binary compatibility, but unless for libs required at core level it's fine to build with newer gcc. It's handled almost like 32/64bit on linux: separate directories for libs (and sometimes headers). I usually just Since we use I didn't find any libb2 in HaikuPorts, but I suppose the builtin is ok. Once you have something that builds, you'll want to try and write a HaikuPorter recipe. Don't hesitate to come and ask on IRC. |
@mmuman thanks for the detailled comment, guess it will be very helpful for whoever will do the port. Adding some comments from #haiku on irc.freenode.net:
|
borg 1.2.0a5 (alpha quality) released, with pkg-config support. |
borg 1.2.0 was released recently (see comment above) and there is bleeding edge stuff with some new requirements in master (see also #6458). |
No python expert here but wanted to see if it actually build, got past the openssl issue but then I face (not sure what's missing or how to fix atm):
|
@Begasus thanks for trying that out! If you 1.2-maint branch and master branch have quite different requirements, so it would be cool to try both. master "unbundled" a lot of stuff and requires some new libs. |
@ThomasWaldmann pkg-config is always around (I do quit some of the ports at haikuports (with recently a new addition to libdeflate)), I also do a check with pkg-config afterwords to see if --cflags and --libs yield the correct vallues, some are not providing .pc file so yes they need the export value (with the pointer you gave in the first comment here it was easy to set them). I'll be sure to try out 1.2 branch also, the one I did was from master. |
You had
|
But great that you did get master branch working! 1.2 should be easier even. |
Yay! |
Created a new recipe to build the python version for pkgconfig, when checking the master branch it detects, crypto, lz4, libdeflate and zstd, doesn't seem to find xxhash (although that has a .pc file included and points to the correct path.
|
I'll leave that part for you! :P |
@Begasus did you try letting it find xxhash without having BORG_LIBXXHASH_PREFIX set? if that is set, it will not try via pkgconfig. if so, check the .pc file (0.8.0 had bugs, iirc the version was not correctly set in there). |
Oh nice catch, I did try without (failing), but we do have 0.8.0 in our ports installed, maybe time for an update :) |
Fixed :) libb2 is now in haikuports, in the meantime also fixed our xxhash Build time dependencies are OK, runtime dependencies still not yet (having a hard time with argon2-cffi) (PS cffi also bumped and is now available for the major python versions) |
In case argon2-cffi becomes a bigger issue, you could also take borg 1.2.x (1.2-maint branch) for porting, which does not yet require that (1.2 also has quite some bundled code and differences in setup*.py though). |
No luck so far on argon2-cffi (did one for python-build that's probably needed for that, but no luck so far)
Still leaves argon2-cffi (just can't understand that build system) EDIT 2 pulled in the latest sources for |
Here are some additions to our It does not really work yet, issues:
If somebody who knows Haiku better could make this working, we'ld have a permanent testing platform for release testing:
|
Never used vagrant but checked (after install on Ubuntu where I run my VBox on Haiku), used the above suggesting in vagrantfile. |
@Begasus auth just worked for me (i have vagrant 2.2.9 with virtualbox, in case it makes a difference). it is normal that it does some retries while it works for the box to boot and sshd become ready, but in the end it should work. |
@ThomasWaldmann if I use |
I don't know how rsync works in this, one thing I could think of is that every thing related to system directories is read-only, tried changing the |
After running against these rsync issues, I just used |
Will write some stuff I encounter here to sum up what's been going on:
Shut down the virtual machine with
|
Looks like rsync on haiku is broken / buggy? |
Running a search on Google shows more OS's that dealt with this? Both Ubuntu and Haiku here are running 3.1.3, from what I read so far it should be fixed in a 3.2.* version? |
Hmm, I use vagrant a lot (see Vagrantfile) and usually rsync works. Sometimes vagrant had issues trying to install rsync if it is not already in the VM, but I usually avoid that just by having it in the VM beforehands. |
From the look of it it installs it when I launch haiku64 the first time:
|
PR for borg on Haiku up now: haikuports/haikuports#6921 👍 |
Did some checks as shown in the first movie, looks to be working fine 👍 |
OK, so I guess we can close this after the PR is merged? In case of issues or feature requests (which I guess are rather likely), we can just open new tickets. |
I thinks it's ok to close this one and the other one #6510 |
borgweb is a rather specialized application, not very general purpose. and it didn't get much love in recent years. way better for desktop users / GUI users are vorta and pika-backup, but i have no idea whether they could be ported to haiku. for people who don't want a GUI, but want to configure their backups in a config file, there is also borgmatic as a quite popular add-on. |
All done, thanks to @Begasus for porting / packaging! |
Guess the port will need some testing for upcoming borg 1.4 (see 1.4-maint branch, I'll also release a new beta soon), e.g. rather using pip than calling setup.py. |
Thanks on the reminder, I'll do some testing here. +1 |
@Begasus Thanks for checking! |
I was curious whether borg could work on haiku, so I tried borg 1.1.7 on Haiku OS R1/beta1 32bit:
borg seems to work.
I am not a haiku user, so I won't do the necessary changes to borg nor more extensive testing (nor packaging for haiku), but PRs are welcome.
Here are some notes about it for whoever wants to work on it:
I started with installing Haiku OS R1/beta1 from the ISO into VirtualBox - see their notes about installing into VirtualBox (esp. the hint about the Pro/1000 NIC card, to get a working network connection).
Then I installed some obviously needed stuff (see our docs):
python3
,pip3
Also installed
zstd
andlz4
(but guess this is not really needed as we bundle them).I didn't install
libacl
norlibattr
, haiku does not have them. Also nolibb2
(blake2) in haiku, but borg bundles it, so no problem.My first tries failed because it did not find the openssl headers (see code in our
setup.py
).There are 2 problems:
headers/
instead ofinclude/
in the path component after the prefix (which is hardcoded in currentsetup.py
)I hacked around them by creating a symbolic link in my home dir like
include --> /boot/.../headers/
and then pointedBORG_OPENSSL_PREFIX
to my home dir. :-)After that, it stumbled over the too old default gcc 2.95. The
setarch x86
command fixed that, then it compiled successfully with gcc 7.I did some quick manual tests, borg init, create, list seemed to work ok.
TODO:
The text was updated successfully, but these errors were encountered: