Mail archive

Re: [alpine-devel] Adélie on Alpine, two months later

From: A. Wilcox <>
Date: Thu, 27 Jul 2017 08:18:12 -0500

Hash: SHA256


On 27/07/17 04:46, Natanael Copa wrote:
> On Mon, 24 Jul 2017 06:57:52 -0500 "A. Wilcox"
> <> wrote:
>> This is a sort of status update and wish list after near two
>> months of attempting to base Adélie on Alpine Linux.
> Thank you for sharing your experiences.

I am glad to be a part of a community where sharing is acceptable. :)

>> 1. scripts/ cannot "fake" cross. Since Adélie uses
>> a slightly different GCC configuration from Alpine, I attempted
>> to run on x86_64, from my x86_64 system:
>> ERROR: unsatisfiable constraints: gcc-6.3.0-r4: conflicts:
>> gcc-x86_64-6.3.0-r4[]
> I wonder if it would make sense to add provides="$pkgname-$arch" to
> gcc. That way "gcc-x86_64" would be provided from "gcc" on x86_64.

That might be an interesting way around it. I will play with that
over this weekend and see how that works.

>> 2. The virtual system is pathetic. One of the very core tenets
>> of Adélie is giving the user power through choice. That choice
>> is almost impossible to provide using the current abuild/apk
>> framework. I keep hearing of a Debian-style alternatives
>> system, and supposedly it was specified somewhere, but I cannot
>> find the specification nor an implementation. If I could read
>> the specification I would be highly motivated to write an
>> implementation.
>> Red Hat has `alternatives`, Debian has `update-alternatives`, and
>> Gentoo has `eselect`. The Alpine system desperately needs
>> something like this and I would love to contribute to such.
> I think something like update-alternatives or eselect makes sense.
> For example, you may want select which java implementation you
> should use as the "system" java.
> But I think we can divide it in 2 different cases:
> 1) symlinks (eg /usr/bin/lua -> /usr/bin/lua$version and
> /usr/bin/php -> /usr/bin/php$version). Selecting system java also
> goes here.
> 2) provides and dependencies in apk
> I am not convinced we should let apk handle the
> select/alternatives and mix that into the dependency calculation.

apk doesn't necessarily need to be the tool used to select the
alternative, but I'm not sure how packages that depend on something
like PHP or Java or Lua would work if apk wasn't somewhat aware.
Something like Gentoo's slots may work for some of them but I don't
think that's something that needs to be added to the APK format.
There needs to be a way to depend on "php" and have apk accept that
there are multiple PHP interpreters (such as a virtual or file path).

>> Consider a few different use cases:
>> mta: any package that needs `sendmail` has to either hard-depend
>> on postfix, or disable mail services. This is unacceptable in my
>> opinion. Other distros let you select what package you want to
>> provide `sendmail`.
> It has been mentioned already, but I think for sendmail we want
> provides=/usr/sbin/sendmail in the different providers and the
> packages that needs it should do depends=/usr/sbin/sendmail. (we
> could do provides=file:/usr/sbin/sendmail too but i think that a
> leading '/' is enought to indicate that its a file)

So would that be manual (you put in the package provides= line that it
provides sendmail)? That would probably be fine.

>> awk: mawk vs gawk vs busybox awk. All have benefits and
>> drawbacks and the user should be able to choose which provides
>> /usr/bin/awk.
> Also mentioned before that awk is a part of the base system and is
> expected to be there. So adding depends=/usr/bin/awk to all
> packages needing it would be cumbersome. However, we could maybe
> do symlinks trick using alternatives/select functionality.

But then how would the dependency be satisfied? If a package requires
'awk', then how would APK know that 'mawk' or 'busybox' satisfies it?

I have noticed that in general there is a deep expectation in aports
that BusyBox will always be present. This really does not work too
well for Adélie, but I'm willing to take on the additional work of
fixing up aports if that work would be welcome.

If it wouldn't be welcome, the trees will likely diverge much more.
As I said in my opening email, Adélie wants the user to have the
maximum amount of freedom, and that includes the ability to choose
whether or not to use BusyBox.

[I will note here that "awk" in some form is required by POSIX; since
virtuals don't exist right now, 'mawk' is pulled in by adelie-base and
therefore the lack of explicit awk dependency does not break building
packages on Adélie. Still, implicit dependencies are always a bad
thing IMO.]

>> shell: /bin/sh as busybox is of course default, but some users
>> may want bash or another shell. I don't see any reason that
>> can't be supported.
> Same as awk.

My concern is for people to be able to choose what works for them.
Maybe they want to use sash+toybox+ubase or bash+coreutils or such,
instead of BusyBox. All packages with shell scripts have an explicit
dependency to BusyBox[1] so that package effectively cannot be
uninstalled on an Alpine system.

If there was a 'shell' provider in the index, this could be solved
quite easily.


Consider also a very very tiny run-from-RAM instance that only needed
an emergency shell and no other user interaction. If sash could
replace busybox there could be a size benefit as well. BusyBox is 900
kB installed and sash is 280 kB installed.

>> vi: busybox, vim, neovim, elvis, ... There are almost a dozen
>> providers of `vi` in Debian and more than a dozen on Gentoo. I
>> believe Alpine itself packages four of them.
> I don't know if I see the problem here. You can use the EDITOR env
> var to select any editor, even non-vi like nano.

Some programs do not obey EDITOR, but that is a good point. Still,
most distros do allow you to choose the provider of `vi` and if
everything else is being fixed up I don't see any reason to ignore vi.

>> I started to try and make 'v:mta' but I'm very concerned about
>> diverging so much from the Alpine aports tree. Also, apk doesn't
>> support an automatic choice for a virtual if the user hasn't
>> already installed one (something like replaces_priority but for
>> virtuals would be good here imo). That means that when I *do*
>> manage to get packages to depend on v:mta, the user now has to
>> read through an 'unsatisfiable constraints' error and pick a
>> package out of the list of providers.
> I don't think 'v:mta' makes much sense (mta with tcp port 25 does
> not even need to run on local host), but I think
> provides=/usr/sbin/sendmail makes sense.

Yes, if such a format is allowed, that would be the ideal solution.

> Currently you can have unversioned provides and have them
> installed in parallel, but then apk will not autoselect anything
> for you or you can have the provides versioned and apk will select
> one for you. But then you will not be able to have both installed
> at the same time.
> Maybe apk could, when the provides is unversioned and no provides
> installed, auto-select the provides with smallest size?

I feel like it could still output a message such as:

apk: selecting 'ssmtp' for provider of '/usr/sbin/sendmail'

That way the user knows what is happening and that they can select
another provider if they want.

> Then you atleast get something installed (for example ssmtp),
> which you can manually replace if you want.

Yes, that is the goal.

>> Additionally, changes made to abuild or apk-tools are currently
>> being sent via GitHub pull requests. However, none of us in
>> Adélie really want to use GitHub as it is a closed platform.
>> The aports mailing list exists for aports, but where could we
>> send abuild or apk-tools changes if we wanted an alternative to
>> GitHub?
> It is mentioned before that you can use alpine-devel for that. I'd
> also suggest that you use --subject-prefix="PATCH apk-tools" or
> "PATCH abuild" so its clear what project it belongs to.

Okay. I will do that in the future. Thanks for the guidance.

>> 4. We have managed to make a split function 'openrc' that takes
>> /etc/init.d and /etc/conf.d directories. It has
>> install_if="$pkgname openrc" so it is transparent when you have
>> OpenRC installed, and allows future migrations to a different
>> init system. I don't know if this is of any interest to Alpine.
> I like this. Just make sure that the pkgname is versioned. eg
> install_if="$pkgname-$pkgver-r$pkgrel openrc"
> Otherwise interesting things will happen if you have older
> versions of $pkgname in you local build repository. (older versions
> will see it and, "hey openrc and $pkgname is installed. i want be
> installed too!")

Yes, I did the same as the doc function which does the same :)

>> 5. After being annoyed by bugs in the PowerPC build of GNU tar,
>> we managed to swap out /usr/bin/tar for bsdtar provided by
>> libarchive in abuild. It needed a patch to output the format
>> apk expects by default, but otherwise it seems to work quite
>> well. This may be of interest to those who want to do a GNU-free
>> Alpine spin.
> libarchive seems a bit bigger that gnu tar, otherwise I don't have
> strong opinions. I would prefer to get the needed functionality
> added to busybox tar if possible.

That is understandable. I took a look at the BusyBox tar code and it
was a bit over my head. Perhaps someone else can add the requisite
functionality to it. As far as I can tell, that would be:

* write pax format
* full xattr support

Everything else seems to be supported.

- --arw

> -nc

- --
A. Wilcox (awilfox)
Project Lead, Adélie Linux
Version: GnuPG v2


Received on Thu Jul 27 2017 - 08:18:12 UTC