Follow

more progress towards packaging, because i'm tired of unsafe uninstall rules in mkfiles
git.sr.ht/~raingloom/package

· brutaldon · 3 · 1 · 0

doesn't work as intended just yet, but you can see how it's put together
look at the package.tar rule in the mkfile for a usage example

it really is dirt simple:
auth/none: build as a user who has no access rights
ramfs: create a /tmp we can access
divergefs /: analogous to Linux's overlayfs, catches all modifications in /tmp/files
create an archive of /tmp/files and print it to stdout
bam, packaged.

caveat emptor: /env and all temporary build files are packaged too. working on a fix.

Show thread

gonna switch it to use nar once i have a way of opening nar files, or i could try to create the tar file deterministically with some hacks? but ye, once it's working i'll try to write some build scripts for /sys/src/cmd.

this is _not_ going to handle dependencies, that's going into the Nix port.

Show thread

oh, and i need a way to dynamically enable and disable packages.
bind won't be enough.
divergefs might work but a custom file system might perform better. it might also be a good idea to support compressing package archives, since they won't be modified anyways.

Show thread

@Shamar Nix the package manager.
bind doesn't do proper overlays by itself, it's the whole reason divergefs exists.
multiple binds would become ugly very quickly.

@Shamar nah, it's quite old. I stumbled upon it while looking for an overlayfs implementation. which it is.

@Shamar
original author: cs.cmu.edu/~412/history/2004S/

found it here: 9p.io/wiki/plan9/Contrib_index

divergefs-fix.tgz is the one that works

the way i actually found the sources was by grepping through /n/9pio/contrib

@Shamar I'm not sure what you mean by that example, or by "mount rock"?

@Shamar @ekaitz_zarraga not sure how it's implemented in the kernel, but i'm pretty sure file lookup is O(n) in the number of binds/mounts. the kernel doesn't know that the packages are immutable, i wanna create a file system that builds a lookup table of the packages.

@Shamar @ekaitz_zarraga
Lookup tables. That's it really. It shouldn't be too hard to implement and it would make the namespace cleaner.

@Shamar @ekaitz_zarraga Yup. Kinda like what Guix does with profiles.
This also has the side effect of catching conflicting packages.

@Shamar @ekaitz_zarraga Like, all it does it store which file is in which package directory. Put all that in a hash map or something and lookup becomes O(log(n)).

@Shamar @ekaitz_zarraga Hmmm. Good point. I guess I'll try using plain binds first.

@grainloom I saw your name of sr.ht, and thought to myself “Did I misread their name all this time?”. I look up, and no. I didn't.

That begs the question, which is your official name?

@grainloom interesting! this is intended to replace the ports framework stuff?

@qbit yup! ports (at least the one i use from 9front) is not very reliable, so i'm making my own

Sign in to participate in the conversation
Cybrespace

Cybrespace is an instance of Mastodon, a social network based on open web protocols and free, open-source software. It is decentralized like e-mail.