Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions rfcs/0046-platform-support-tiers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
---
feature: platform_support_tiers
start-date: 2019-04-28
author: Michael Raskin
Comment thread
7c6f434c marked this conversation as resolved.
co-authors:
related-issues:
---

# Summary
[summary]: #summary

Document the way to describe the level of support a platform can expect in
Nixpkgs.

# Motivation
[motivation]: #motivation

When adding a new platform, be it a new C library option, a new
cross-compilation target configuration or a new CPU architecture, there is a
discussion of support expectations and maintenance burden. Having a documented
vocabulary to describe the expectations and documented precedents should make
such discussions more efficient.

# Detailed design
[design]: #detailed-design

## Platform elements

* CPU architecture (possibly: subarchitecture, optional features)
* OS kernel

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in 54, I believe the phrase "OS ABI" is more accurate than "OS kernel" in this context. It may seem like a minor nitpick now, but this could paint us into a problematic corner later. Consider that the FreeBSD kernel can execute binaries compiled for the Linux ABI, but there are Linux utilities that interact with Linux-specific kernel interfaces (networking, power-management, VMs). Giving that set of packages with specific interactions with the Linux kernel is a very small subset of packages that can be executed on Linux, I argue that the ABI platform axis is more significant than the kernel platform axis.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I keep kernel, but move it next to the more exotic considerations like NixOS/non-NixOS layout

* C compiler
* C library
* NixOS/non-NixOS global layout, in case of Linux with glibc

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this mean?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some things (OpenGL, for example) where level of support for Nix-on-non-NixOS-Linux is lower than on NixOS.

* Global linking options
Comment thread
zimbatm marked this conversation as resolved.

## Questions to answer for each platform

* What fraction of packages is expected to work?
Comment thread
7c6f434c marked this conversation as resolved.
Outdated
* How many users there are / how much testing one can expect?
* How much complexity is a platform-specific fix allowed to carry?
* Is there a binary cache for the platform?
* Is the platform normally tested by the tools like ofBorg? Is it possible to
get something tested with reasonable effort?
* Is there expectation that updates do not break things for this platform?
* How many developers are interested in the platform? How easy it it to get a
non-trivial fix reviewed?
* Is Nix supported?
* Are native bootstrap tools available?

## Platforms

* `x86_64-linux`, native builds with `gcc` and `glibc`. Status: default
platform, the only truly first-tier platform. All packages not specifically
defined in terms of OS-specific or CPU-specific tooling for other platforms
are expected to work if they work anywhere.

* `aarch64-linux`, native builds with `gcc` and `glibc`. `x86_64-darwin` as a
name for macOS with `clang` compiler. Status: second-tier platforms. Many
packages are supposed to work, the main Hydra puts a lot of binary packages
into the binary cache, there is tooling support to check builds on these
platforms and some level of effort is expected to be spent on investigating
new failures after update.

* `i686-linux`, `armv7l-linux`, `x86_64-linux` with `musl`, static builds.
Status: cross-compilation targets in different meanings of these words. No
binary cache available, checking a cross-build via ofBorg is possible but
complicated, no expectations on upgrade. Fixes not necessary on upper-tier
platforms are expected to be either localised inside `stdenv` dependencies
and other compilers/build tools, or to be general cleanups that just happen
to be optional on upper-tier platforms.

* Embedded systems like `arm-embedded`, `armhf-embedded` or even `avr`.
Status: only cross-compilation targets, no tooling support, no expectations
of attention from non-users. Platform-specific fixes are expected to only
touch immediate compiler toolchain.

## Adding a new platform

It is expected that embedded-level support (platform definition, basic support
for the target, maybe a toolchain in the binary cache) can added as long as
the support code works and is contained in the expected places. If the
platform users want to set higher expectations, a motivation should be
provided. User interest, platform perspectives and development effort
commitment are usually taken into account.

Before adding an expectation that platform non-users pay attention whether
upgrades break a lower-tier platform, support for testing on this platform
must be available.

# Drawbacks
[drawbacks]: #drawbacks

Maintaining the list of platforms (and coordinating agreement on explicit
support expectations) takes effort, both technical and organisational.

# Alternatives
[alternatives]: #alternatives

Do nothing; make decisions on platform support trade-offs on case-by-case
basis without a shared framework.

# Unresolved questions
[unresolved]: #unresolved-questions

The list of currently supported platforms is incomplete.

# Future work
[future]: #future-work

Clarify what other considerations there are from the point of view of support
expectations.

Describe what expectations usually appear together.

Support expectations for packages (and package options), NixOS modules, and
hardware configurations could also be defined.

Levels of desirability for tricks that are sometimes the only way but are not
generally encouraged could be defined. (Example: when building an FHS
environment becomes a reasonable strategy to get something running on a NixOS
machine?)