Add background information for the project
This commit is contained in:
parent
065130c09b
commit
ea75073147
|
@ -1 +1,3 @@
|
||||||
{}
|
{
|
||||||
|
"promptDelete": false
|
||||||
|
}
|
|
@ -32,9 +32,36 @@
|
||||||
"source": false
|
"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"
|
"direction": "vertical"
|
||||||
|
@ -165,15 +192,16 @@
|
||||||
"active": "f8131571839b6055",
|
"active": "f8131571839b6055",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
"Nix For Development.md",
|
"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",
|
"Nix should immediately make a person's time better.md",
|
||||||
|
"cargo2nix.md",
|
||||||
"Nix Flakes.md",
|
"Nix Flakes.md",
|
||||||
"buildRustPackage.md",
|
"buildRustPackage.md",
|
||||||
"buildRustCrate.md",
|
"buildRustCrate.md",
|
||||||
"crate2nix.md",
|
"crate2nix.md",
|
||||||
"cargo2nix.md",
|
|
||||||
"How can I interrogate a Nix builder.md",
|
"How can I interrogate a Nix builder.md",
|
||||||
"Index.md",
|
|
||||||
"Nix Monorepos.md",
|
|
||||||
"Cross-compiling.md",
|
"Cross-compiling.md",
|
||||||
"Makefiles and Monorepos.md",
|
"Makefiles and Monorepos.md",
|
||||||
"Mononix, C library.md",
|
"Mononix, C library.md",
|
||||||
|
|
|
@ -4,8 +4,37 @@ Goal: Using one coherent build tool, I can develop multiple projects with common
|
||||||
|
|
||||||
# Background
|
# 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
|
# Requirements
|
||||||
|
|
||||||
- select the toolchains and versions thereof for the project
|
- 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.
|
Each of these is a separate Nix command that builds or runs the desired result.
|
||||||
|
|
||||||
---
|
---
|
||||||
- [[Nix Monorepos]]
|
|
||||||
- [[Nix For Development]]
|
- [[Nix For Development]]
|
||||||
- [[Cross-compiling]]
|
- [[Cross-compiling]]
|
||||||
- [[Scaling Rust Builds with Bazel]]
|
- [[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/)
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
---
|
---
|
||||||
- [[Nix should immediately make a person's time better]]
|
- [[Nix should immediately make a person's time better]]
|
||||||
- [[Nix Monorepos]]
|
|
||||||
- [[Scaling Rust Builds with Bazel]]
|
- [[Scaling Rust Builds with Bazel]]
|
||||||
- [[Nix Flakes]]
|
- [[Nix Flakes]]
|
||||||
- [[crate2nix]]
|
- [[crate2nix]]
|
|
@ -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
|
# Rust
|
||||||
## Tools
|
## Tools
|
||||||
|
|
||||||
|
@ -16,8 +12,4 @@ I am building this table to evaluate tools from the perspective that I would wan
|
||||||
| [[crate2nix]] | | | no |
|
| [[crate2nix]] | | | no |
|
||||||
| [[naersk]] | | | |
|
| [[naersk]] | | | |
|
||||||
|
|
||||||
Nothing short of caching each dependency in a separate crate will make a tool acceptable for monorepo development.
|
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
|
|
|
@ -2,4 +2,10 @@
|
||||||
|
|
||||||
Monorepo tools using Nix as the build, link, and package tool.
|
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
|
||||||
|
|
Loading…
Reference in New Issue