-
Notifications
You must be signed in to change notification settings - Fork 0
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
Other architectures? #2
Comments
Well for right now I can't seem to get the static libraries to work properly anyway. I've gotten GoAppImage to build, but once I use it in another project (namely LinuxPA), it doesn't want to compile. For the short term I'll probably switch it back to being based on go-appimage if I don't make any progress in the next 24~48 hours. If I can get the static library to work though, it shouldn't be too difficult to account for other architectures as cgo allows you to specify the flags used on each architecture, so in theory I should be able to include the libraries for each platform and have it selectively pick the version needed. |
Right now I think my main limiting factor is my general lack of knowledge of C and C compilation. |
From my experience, many of the beautiful, easy aspects of Go disappear as soon as you start using C. We should strive for a 100% Go native implementation. https://github.com/distr1/distri/blob/master/internal/squashfs/reader.go |
Very true, cgo is a butt, especially when you don't know much C. |
Maybe you can figure out how to implement the missing compression pieces in distr1/distri#48 - then we'd have a squashfs go library and everyone would be very happy 👍 I'd use it immediately for probonopd/go-appimage#1 |
I'll try, but it's honestly nothing like I've ever worked with, so I'll have to do a lot of reading. |
So looking into it, it seems distri's squashfs, it doesn't look like it has ANY compression implemented (at very least for reading) which means it can't read the basically anything from a compressed squashfs, including the inode table. When I would use it on a squashfs from an AppImage, or a squashfs I made with I need to look into diskfs a bit more, but from my cursory look, it seems a bit more promising, though, again, there doesn't seem to be any references to decompression. Then again I've never dealt with squashfs and I could be barking up the wrong tree as to what's wrong. I did, at the very least, write some code to strip the ELF header off an AppImage so I can work on a raw, real world squashfs, which can be found here. |
Correct. But distr1/distri#48 (comment) has code for the beginnings of it. |
My squashfs library is now semi functional. It's a bit rough at the moment, I've made basically all functions public, though most of them shouldn't be. Right now it can simply read a squashfs, list the files within, and give you an io.Reader for files (so you can extract them). It has full support for fragments and compression (though only gzip right now) and it's a simple extract, it doesn't set permissions or anything, but it's operational enough where I can start working on a stable API. |
Alright, the library is now officially at v0.1.0. It provides very basic functionality, but it works! If you want to use it with AppImages, you can just wrap the os.File with a io.SectionReader with the offset set to the size of the ELF header. I want to get GoSquashfs a bit more mature, but then I'll integrate it into this library. |
Hello @CalebQ42 I see you are now calling a static version of libappimage. How does this work for other architectures such as ARM? Does it break Go cross-compile abilities?
The text was updated successfully, but these errors were encountered: