From: Alyssa Ross <hi@alyssa.is>
To: "José Pekkarinen" <jose.pekkarinen@unikie.com>
Cc: devel@spectrum-os.org
Subject: Re: [PATCH] Add image configuration option
Date: Thu, 15 Sep 2022 11:31:31 +0000 [thread overview]
Message-ID: <87h718yiuk.fsf@alyssa.is> (raw)
In-Reply-To: <CAJPV9MrMCvhfUW9Ooo_QnzcM_DLK6U-xvHahRmzrhtjgkPqkdw@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 6801 bytes --]
José Pekkarinen <jose.pekkarinen@unikie.com> writes:
> On Thu, Sep 15, 2022 at 11:21 AM Alyssa Ross <hi@alyssa.is> wrote:
>
>> José Pekkarinen <jose.pekkarinen@unikie.com> writes:
>>
>> > The following patch proposes to host nix configuration
>> > files under nix folder that offers default configuration
>> > for an image, defaulting to a release image, which would
>> > be plain spectrum. A hardened default configuration will
>> > be proposed in the near future. In case of configuration
>> > collision between the default configuration and config.nix,
>> > the latter will be taken into account.
>> >
>> > Signed-off-by: José Pekkarinen <jose.pekkarinen@unikie.com>
>> > ---
>> > nix/eval-config.nix | 3 ++-
>> > 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> Hi José, thanks for the patch!
>>
>> It looks like the correct way to implement such a feature, but I'm not
>> sure about the feature itself.
>>
>> Currently we only have a single configuration option, pkgs. So it
>> doesn't make sense to be able to split build configuration across two or
>> more files, because only one of them would be able to set the one
>> configuration option that exists so far.
>>
>> We could end up with more configuration options, of course, but I'd
>> really like to avoid the situation where a Spectrum build configuration
>> is so complicated it needs to be expressed across multiple files in this
>> way. Sometimes configuration is unavoidable, like how we have to give
>> people a way to use a vendor kernel if required, because we can't
>> possibly bundle every vendor kernel we might want to use into the same
>> image, but using build configuration should really be a last resort.
>>
>> I'd expect very few Spectrum users overall to be building their own
>> images, so the most important thing is for the default configuration to
>> be as good as possible. Hardening falls under that — if we can do
>> something to harden the Spectrum system, we should probably be doing it
>> by default! Or if it's something that doesn't make sense to do by
>> default, can we make it configurable at runtime so that users don't have
>> to build their own images if they want to use it? (I'm hoping the
>> proposed developer mode could work this way, for example. I haven't
>> thought about it enough to know if it's practical, but Chrome OS can do
>> it.)
>>
>> If we ever do end up with lots of configuration options to the point
>> where they're getting difficult to manage, we can re-evaluate something
>> like this (or at that point it might just be worth it to give in and
>> reuse the NixOS module system), but I don't think we're at that point
>> yet.
>>
>> What do you think?
>>
>
> Hi,
>
> In my humble opinion, considering that we are working at
> an operative system level, the idea of having a default configuration,
> and a debug configuration, preferably that we can activate at runtime,
> was outnumbered, but not today, twenty years ago. Only thinking in
> our current workflows, we can easily spot variables enough to show
> that 2 configurations are not sufficient, you already gave a good
> example with the vendor kernels, I can give some more, like building
> for a vm, or a host, of arch x86_64 or arm, natively built, or cross
> compiled, hardened or not, with debugging tools and symbols or
> without them, with extra vms to run application X, without wayland
> and graphics applications because our target machine doesn't have
> a display. Several of these cases can be combined, and multiple
> of them requires changes at build time not giving the option to
> enable them at runtime, so eventually not only you'll have a big
> set of configuration files, but you'll also want to combine them in
> a smart way so that the complexity is bearable and your user
> base doesn't get upset because it is very hard to handle.
Okay, thanks for the explanation. I think we can group some of these
together:
• Stuff that's already Nixpkgs configuration options or can be
expressed through an overlay. Whether to cross compile, what
architecture to build for, whether to use a vendor kernel, etc. This
can already be handled through the existing configuration mechanism.
• VM customisation, including extra VMs, disabling Wayland, etc. In my
mind there are still some open questions around how this should be
implemented exactly, but this is definitely something that needs to
be more configurable.
• Whether to install extra stuff on the host system. This covers
things like debugging symbols and tools.
Does that sound right to you? Are there more that you can think of?
I'd like to understand the requirements here better, to help think about
what sort of configuration mechanisms might be required.
> Now, I have to fully disagree that we are not in the
> point were we need to re-evaluate things, we are, and you were
> before we joined you, you only need to take a look at the contribution
> level of your project in time, since the effect of not implementing
> flexibility to developers to make their own Spectrum OS for their
> needs, is that you will end up with a big base of user that forks
> Spectrum with a feature that is divergent enough that proposing
> it back to the upstream is unlikely, or even more dangerous, that
> the developer in question doesn't even know how to implement
> the feature they are required, and they don't even try to hack
> the system, loosing the contribution since the beginning. Needless
> to mention, you can easily find examples of these 2 scenarios
> inside Unikie, no need to look further. Examples in how this
> flexibility can be implemented in multiple ways, and it is a
> requirement to guarantee a bigger volume of contributions can
> be found in communities like buildroot, yocto, or even Nix.
You're right — it's generally a bad thing if people have to patch
Spectrum to make it fit their needs. I want to avoid that. But most of
the things we've talked about so far don't feel to me like they're going
to lead to massive configuration files. The exception is all the stuff
that's either Nixpkgs configuration or overlays, but the mechanism you
proposed here wouldn't help with that, because only a single
configuration file would be able to change anything in "pkgs", due to
the configuration files being merged using the non-recursive //
operator. That's exactly why it's important to understand what the
needs are before we consider specific configuration mechanisms. It's
difficult to figure out if an idea will actually make things easier
without seeing an example of the problem, and what difference to it the
proposed solution would make.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2022-09-15 11:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 7:35 [PATCH] Add image configuration option José Pekkarinen
2022-09-15 8:21 ` Alyssa Ross
2022-09-15 10:42 ` José Pekkarinen
2022-09-15 11:31 ` Alyssa Ross [this message]
2022-09-15 12:31 ` José Pekkarinen
2022-09-15 13:22 ` Alyssa Ross
2022-09-15 13:48 ` Ville Ilvonen
2022-09-15 14:00 ` Alyssa Ross
2022-09-15 14:09 ` Ville Ilvonen
2022-09-15 14:47 ` Integrating Spectrum and platform firmware Alyssa Ross
2022-09-16 5:29 ` Ville Ilvonen
2022-09-16 4:59 ` [PATCH] Add image configuration option José Pekkarinen
2022-09-16 7:25 ` Alyssa Ross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h718yiuk.fsf@alyssa.is \
--to=hi@alyssa.is \
--cc=devel@spectrum-os.org \
--cc=jose.pekkarinen@unikie.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://spectrum-os.org/git/crosvm
https://spectrum-os.org/git/doc
https://spectrum-os.org/git/mktuntap
https://spectrum-os.org/git/nixpkgs
https://spectrum-os.org/git/spectrum
https://spectrum-os.org/git/ucspi-vsock
https://spectrum-os.org/git/www
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).