Add background information for the project

main
Savanni D'Gerinel 2023-07-09 18:25:17 -04:00
parent 065130c09b
commit ea75073147
6 changed files with 75 additions and 18 deletions

View File

@ -1 +1,3 @@
{}
{
"promptDelete": false
}

View File

@ -32,9 +32,36 @@
"source": false
}
}
},
{
"id": "4d0f931be6c172b5",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Nix For Development.md",
"mode": "source",
"backlinks": true,
"source": false
}
}
},
{
"id": "bd24ffd92b4cc242",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Nix should immediately make a person's time better.md",
"mode": "source",
"backlinks": true,
"source": false
}
}
}
],
"currentTab": 1
"currentTab": 1,
"stacked": true
}
],
"direction": "vertical"
@ -165,15 +192,16 @@
"active": "f8131571839b6055",
"lastOpenFiles": [
"Nix For Development.md",
"Index.md",
"Nix Monorepos.md",
"Rust build tools in Nix.md",
"Nix should immediately make a person's time better.md",
"cargo2nix.md",
"Nix Flakes.md",
"buildRustPackage.md",
"buildRustCrate.md",
"crate2nix.md",
"cargo2nix.md",
"How can I interrogate a Nix builder.md",
"Index.md",
"Nix Monorepos.md",
"Cross-compiling.md",
"Makefiles and Monorepos.md",
"Mononix, C library.md",

View File

@ -4,8 +4,37 @@ Goal: Using one coherent build tool, I can develop multiple projects with common
# Background
I do a lot of Rust development. I also like to attach other programming languages so that I can, for instance, write a [go application that works in a web browser](https://git.luminescent-dreams.com/savanni/tools/src/branch/main/kifu/pwa). And, I tend to work in a [monorepo](https://git.luminescent-dreams.com/savanni/tools/), because that helps me keep all of my disparate interests somewhat in sync with one another.
Finally, I use Nix to manage my development tools.
However, what I cannot do is use Nix to actually build my projects. Most of my projects, admittedly, are Rust projects and so they are pretty easily built with a simple Cargo.toml. However, as soon as I want to do something complicated, such as a web application, I have to dig extensively to find documentation on how to actually lay out the application and get all of the tools in place. Plus, I have to use a different build tool and get all of the build tools to work together.
What I actually want to do is this.
```
> nix run .#kifu-gtk
```
And I want you to be able to just say this...
```
> nix run https://git.luminescent-dreams.com/savanni/tools/#.kifu-gtk
```
## Monorepos
For the purpose of this project, a monorepo as a single Git repository which contains potentially many libraries and applications, in separate packages (rust Crates, node Modules, etc), which interdepend and may be developed simultaneously with one another.
## Past experiences
I don't have many past experiences.
- I have the 1Password Monorepo, which is mostly held together with Makefiles which invoke platform-specific build tools. These were put together before I arrived at the company, and they are extensive. The developer build environment does not match the CI build environment.
- I have tried Bazel, but have not been able to build a purely Rust project even while following the tutorials.
- I have my [Tools Monorepo](https://git.luminescent-dreams.com/savanni/tools/) where I use a bunch of Makefiles to invoke platform-specific build commands. This doesn't work too badly, but I've hand-rolled every boilerplate Makefile, and should I want to add something like cross-compilation to Raspberry Pi, I am in for a world of pain.
I have evaluated all but one of the [[Rust build tools in Nix]], and found significant drawbacks in each. The biggest drawback, though, is that the tools are all for building an application. Binding two applications together is never a consideration with any of the build tools, and so something like the Kifu PWA application simply cannot be built with Nix as a build tool.
# Requirements
- select the toolchains and versions thereof for the project
@ -52,8 +81,9 @@ Backends
Each of these is a separate Nix command that builds or runs the desired result.
---
- [[Nix Monorepos]]
- [[Nix For Development]]
- [[Cross-compiling]]
- [[Scaling Rust Builds with Bazel]]
- [[Makefiles and Monorepos]]
- [[Makefiles and Monorepos]]
- [Experiment in cross-compiling](https://github.com/jraygauthier/jrg-rust-cross-experiment/blob/master/simple-static-rustup-target-windows/shell.nix)
- [Building Nix flakes from Rust workspaces - Tweag](https://www.tweag.io/blog/2022-09-22-rust-nix/)

View File

@ -17,7 +17,6 @@
---
- [[Nix should immediately make a person's time better]]
- [[Nix Monorepos]]
- [[Scaling Rust Builds with Bazel]]
- [[Nix Flakes]]
- [[crate2nix]]

View File

@ -1,7 +1,3 @@
- [Experiment in cross-compiling](https://github.com/jraygauthier/jrg-rust-cross-experiment/blob/master/simple-static-rustup-target-windows/shell.nix)
- [Building Nix flakes from Rust workspaces - Tweag](https://www.tweag.io/blog/2022-09-22-rust-nix/)
# Rust
## Tools
@ -16,8 +12,4 @@ I am building this table to evaluate tools from the perspective that I would wan
| [[crate2nix]] | | | no |
| [[naersk]] | | | |
Nothing short of caching each dependency in a separate crate will make a tool acceptable for monorepo development.
# A strategy
- Each crate needs to be treated as a separate
Nothing short of caching each dependency in a separate crate will make a tool acceptable for monorepo development.

View File

@ -2,4 +2,10 @@
Monorepo tools using Nix as the build, link, and package tool.
See [the documentation index](Mononix/Index.md) for more detailed documentation.
- [Documentation Index](Mononix/Index.md)
- [Tracker](https://www.pivotaltracker.com/n/projects/2650555)
- [Demo Repository](https://git.luminescent-dreams.com/savanni/demo-repo)
# Usage
There is no code yet, so there are no usage instructions