stage0
bundlers | stage0 | |
---|---|---|
3 | 22 | |
88 | 888 | |
- | - | |
2.8 | 3.9 | |
7 months ago | 3 months ago | |
Nix | Assembly | |
MIT License | GNU General Public License v3.0 only |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
bundlers
-
The Magic Nix Cache
- the caching works across branches, so for example merging a feature branch to master, if nothing changes the build on master will be very quick
I created something similar to nix-cache for gitlab, but I had to create a dedicated runner running NixOS.
If I could use NixOS for deployment, at that point I would just point the same binary cache to the machine and use the same derivation to build the app. Because the app was already build by CI, it would just download the compiled version. No need for artifactory or similar. In that scenario (you using poetry) you probably would just use poetry2nix to generate the application.
If the OS is not NixOS, but you still want to deploy via nix, then IMO this[2] looks interesting, basically it packages everything in self extracting archive. That you can extract and then run the app.
Other alternatives are these bundlers[3], which includes building toArx (works in a way similar to the previous one but pretends everything is in a single file), RPM, DEB, docker (you would have more control over it if you would use the code directly instead of a bundler though)
And the last option (probably the most obvious one) is that you can simply just use the tool to build the package. Since you're using poetry, then you can generate a wheel from it.
[1] https://github.com/takeda/nix-cde/blob/master/contrib/gitlab...
[2] https://github.com/Ninlives/relocatable.nix
[3] https://github.com/NixOS/bundlers/blob/master/flake.nix
-
After 20 years are developers now ready for Nix?
We've seen the opposite. New package managers are built with a much better understanding of the problem space because of Nix and sometimes explicitly taking ideas and concepts. This results in those new systems being far more compatible and easily integrated with Nix itself. Consider the iteration towards better and better locking in python + Node. Consider Rust/Cargo.
There has also been sharing of ideas and collaboration between things us and bazel/buck/spack/etc. I think it is clear that we are all moving towards a similar end state, that often looks very much like Nix, or a re-invention of it.
For things like OCI, Nix predates it, but we should start to re-use the standard. The Tvix group is exploring this and I'd suspect our sandboxing will be OCI at some point. For outputs; we make it easy to convert a Nix package into an equivalent container. Things like flatpack,AppImage,Snap should also be easy for people to output (i'm trying to collect these "transformers"/"bundlers" here: https://github.com/NixOS/bundlers).
-
Nixpacks takes a source directory and produces an OCI compliant image
Nix 3 has a dead simple, builtin CLI frontend for built packages: https://nixos.org/manual/nix/unstable/command-ref/new-cli/ni...
It uses dockerTools: https://github.com/NixOS/bundlers/blob/master/flake.nix
maybe a bundler can be added that uses OCI tools, thus providing such a wrapper and giving a nice CLI for it
stage0
- Running the "Reflections on Trusting Trust" Compiler
- Stage0: A minimal bootstrapping path to a C compiler capable of compiling GCC
- Goodbye to the C++ Implementation of Zig
- Stage0 – A set of minimal dependency bootstrap binaries
-
Nixpacks takes a source directory and produces an OCI compliant image
Somewhat tangential, but I'm curious how big the bootstrap seed for Nix is. That is, if you wanted to build the entire world, what's a minimum set of binaries you'd need?
Guix has put quite a bit of work into this, AFAIU, and it's getting close to being bootstrappable all the way from stage0 [0]. Curious if some group is also working on similar things for Nix.
[0]:https://github.com/oriansj/stage0
-
"Do you believe that every upstream project... is examined by an expert who can accurately identify whether said project contains malware...?"
https://www.bootstrappable.org/ has some good info. Reading the source of https://github.com/oriansj/stage0 is also very enlightening. It's set its goal to be understandable by 70% of programmers.
- Stage0 - A set of minimal dependency bootstrap binaries
-
Common libraries and data structures for C
Even if they aren't, people absolutely should be able to bootstrap new platforms from scratch. It's important to have confidence in our tools, in our ability to rebuild from scratch, and to be safe against the "trusting trust" attack among other things.
Lately I've been catching up on the state of the art in bootstrapping. Check out the live-bootstrap project. stage0 starts with a seed "compiler" of a couple hundred bytes that basically turns hex codes into bytes while stripping comments. A series of such text files per architecture work their way up to a full macro assembler, which is then used to write a mostly architecture-independent minimal C compiler, which then builds a larger compiler written in this subset of C. This then bootstraps a Scheme in which a full C compiler (mescc) is written, which then builds TinyCC, which then builds GCC 4, which works its way up to modern GCC for C++... It's a fascinating read:
https://github.com/oriansj/stage0
https://github.com/fosslinux/live-bootstrap/blob/master/part...
Even if no one is "using" this it should still be a primary motivator for keeping C simple.
-
How To Build an Evil Compiler
One countermeasure not mentioned here is bootstrapping a compiler with a program small enough to be manually verified. The stage0 project is under 1KB (small enough that the binary can be, and has been, manually checked against the hand written assembly), and GNU Guix (a system for reproducible, isolated builds) is currently working on moving it's bootstrap speed to stage0. That means that, fairly soon, there will be a large set of software that doesn't have a connection to an original C compiler.
- A minimal C compiler in x86 assembly
What are some alternatives?
hasql-interpolate
rizin - UNIX-like reverse engineering framework and command-line toolset.
relocatable.nix - A nix bundler that produces relocatable deployment script for nix store paths.
arocc - A C compiler written in Zig.
nixpkgs - Nix Packages collection & NixOS
chibicc - A small C compiler
libcperciva - BSD-licensed C99/POSIX library code shared between tarsnap, scrypt, kivaloo, spiped, and bsdiff.
bug - Scala 2 bug reports only. Please, no questions — proper bug reports only.
c4 - C in four functions
pkgconf - package compiler and linker metadata toolkit
swc - Rust-based platform for the Web
sc - Common libraries and data structures for C.