Skip to content

Commit 3ebd128

Browse files
zmitchellbrendaneamonfloxbotFloxBotmkenigs
authored
chore: Release v1.6.0 (#285)
Co-authored-by: Brendan Magee <brendaneamon@users.noreply.github.com> Co-authored-by: flox automations <73946670+floxbot@users.noreply.github.com> Co-authored-by: FloxBot <bot@flox.dev> Co-authored-by: Matthew Kenigsberg <matthew@floxdev.com> Co-authored-by: Yannik Sander <7040031+ysndr@users.noreply.github.com> Co-authored-by: Dan Carley <dan@flox.dev> Co-authored-by: Jenny Mahmoudi <jenny@floxdev.com>
1 parent 1917f75 commit 3ebd128

22 files changed

+1003
-733
lines changed

.flox/env/manifest.lock

Lines changed: 348 additions & 348 deletions
Large diffs are not rendered by default.

docs/concepts/builds.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: "Builds"
3+
description: Understanding how to build packages with Flox
4+
---
5+
6+
The typical development lifecycle involves a step where your source code and potentially some other assets are bundled together into a package.
7+
That package could be a compiled executable, an archive containing source files, or something else entirely.
8+
9+
A Flox environment ensures that the same set of tools, dependencies, and environment variables are available where the environment is activated, whether that's during development, running in CI, or _when building packages_.
10+
Flox environments have native support for defining builds that should be performed in the context of the environment, making it quick and easy to transition from _developing_ your software in a reliable and reproducible way, to _building_ your software in a reliable and reproducible way.
11+
12+
## Defining builds
13+
14+
There are two ways to define builds, depending on your needs:
15+
16+
* [Manifest builds][manifest-builds-concept] allow you to use the tools and commands you're already familiar with to easily build packages with a reasonable amount of reproducibility
17+
* [Nix expression builds][nix-expression-builds-concept] are for truly reproducible builds and modify existing packages, if you're already familiar with or willing to learn some of the Nix language
18+
19+
## Performing builds
20+
21+
Builds are performed with the [`flox build`][flox-build] command.
22+
When invoked with no other arguments, `flox build` will execute each build defined in the environment.
23+
You can optionally specify which builds to perform:
24+
25+
```bash
26+
$ flox build myproject
27+
```
28+
29+
For each build that `flox` successfully executes, a symlink named `result-<name>` will be placed in the root directory of the project.
30+
These symlinks link to the read-only locations where the contents of each package are stored.
31+
Continuing with the `myproject` example, after the build you could run the compiled binary via
32+
33+
```bash
34+
$ ./result-myproject/bin/myproject
35+
```
36+
37+
## Cross-platform builds
38+
39+
When you build a package, it is built on your host machine, and therefore only built for the system (`aarch64-darwin`, `x86_64-linux`, etc) of your host machine.
40+
This means that if you want packages built for multiple platforms, you need to run the build on multiple platforms.
41+
One way to accomplish this is to run your builds in [CI][flox-ci-cd].
42+
43+
[manifest-builds-concept]: ./manifest-builds.md
44+
[nix-expression-builds-concept]: ./nix-expression-builds.md
45+
[flox-build]: ../reference/command-reference/flox-build.md
46+
[flox-ci-cd]: ../tutorials/ci-cd.md

docs/concepts/environments.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The best way to edit the manifest is by running [`flox edit`][flox_edit] which w
6262

6363
See [`manifest.toml`][manifest] for a complete description of the manifest format and the [customizing environments guide][customizing_environments_guide] to walk through examples.
6464

65-
```toml title="manifest.toml"
65+
```toml title=".flox/env/manifest.toml"
6666
version = 1
6767

6868
[install]
@@ -74,7 +74,7 @@ nodejs.pkg-path = "nodejs_24"
7474
The lock file serves as a snapshot of the specific package versions and their dependencies that were built and activated at a particular point in time.
7575
Flox manages this file for you.
7676

77-
``` json title="manifest.lock"
77+
``` json title=".flox/env/manifest.lock"
7878
{
7979
8080
"packages": [
@@ -91,12 +91,16 @@ Flox manages this file for you.
9191
}
9292
```
9393

94+
### `pkgs`
95+
96+
[Nix expression builds][nix-expression-builds-concept] are stored in the directory `.flox/pkgs`.
97+
9498
### `env.json`
9599

96100
A metadata file that contains the name of the environment and the environment's
97101
version. Flox manages this file for you.
98102

99-
``` json title="env.json"
103+
``` json title=".flox/env.json"
100104
{
101105
"name": "example-project",
102106
"version": 1
@@ -119,4 +123,5 @@ version. Flox manages this file for you.
119123
[floxhub_concept]: ./floxhub.md
120124
[discourse]: https://discourse.flox.dev/
121125
[manifest]: ../reference/command-reference/manifest.toml.md
126+
[nix-expression-builds-concept]: ./nix-expression-builds.md
122127
[toml_spec]: https://toml.io/en/v1.0.0

docs/concepts/manifest-builds.md

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
---
2-
title: "Builds"
3-
description: Understanding how to build packages with Flox
2+
title: "Manifest Builds"
3+
description: Manifest builds with Flox
44
---
55

6-
The typical development lifecycle involves a step where your source code and potentially some other assets are bundled together into a package.
7-
That package could be a compiled executable, an archive containing source files, or something else entirely.
6+
See the [builds concept][builds-concept] page for an overview of the different types of builds and how to perform them.
87

9-
A Flox environment ensures that the same set of tools, dependencies, and environment variables are available where the environment is activated, whether that's during development, running in CI, or _when building packages_.
10-
Flox environments have native support for defining builds that should be performed in the context of the environment, making it quick and easy to transition from _developing_ your software in a reliable and reproducible way, to _building_ your software in a reliable and reproducible way.
8+
## Overview
119

12-
## The big picture
13-
14-
Builds are defined in the `[build]` section of the manifest, and are performed using the [`flox build`][flox-build] command.
15-
16-
A build takes place in the context of an environment.
10+
Manifest builds are defined in the `[build]` section of the manifest and take place in the context of an environment.
1711
What that means is that a build run by the Flox CLI behaves similarly to activating the environment yourself and running the build commands manually.
1812
This allows you to achieve a level of reproducibility while still being able to run the build commands you're familiar with (`cargo build`, `go build`, etc).
1913

@@ -114,24 +108,6 @@ command = '''
114108
sandbox = "pure"
115109
```
116110

117-
## Performing builds
118-
119-
Builds are performed with the [`flox build`][flox-build] command.
120-
When invoked with no other arguments, `flox build` will execute each build listed in the manifest.
121-
You can optionally specify which builds to perform:
122-
123-
```bash
124-
$ flox build myproject
125-
```
126-
127-
For each build that `flox` successfully executes, a symlink named `result-<name>` will be placed in the root directory of the project.
128-
These symlinks link to the read-only locations where the contents of each `$out` directory are stored.
129-
Continuing with the `myproject` example, after the build you could run the compiled binary via
130-
131-
```bash
132-
$ ./result-myproject/bin/myproject
133-
```
134-
135111
## What can you build?
136112

137113
The obvious answer to this question is, of course, "software", but this omits a variety of interesting use cases that may not be immediately obvious.
@@ -207,26 +183,18 @@ systems = ["aarch64-darwin", "x86_64-darwin", "aarch64-linux", "x86_64-linux"]
207183

208184
Note again that we include the `install-id` `"hello"` in `runtime-packages`, not the name of the package itself (`hello-go`).
209185

210-
## Cross-platform builds
211-
212-
When you build a package, it is built on your host machine, and therefore only built for the system (`aarch64-darwin`, `x86_64-linux`, etc) of your host machine.
213-
This means that if you want packages built for multiple platforms, you need to run the build on multiple platforms.
214-
One way to accomplish this is to run your builds in [CI][flox-ci-cd].
215-
216186
## Examples
217187

218188
We've compiled a list of example commands to demonstrate how to use Flox to build packages in various ecosystems.
219189
Each language guide in the Languages section of the Cookbook contains an example of building a package with Flox.
220190
For example, [this section][go-example] contains an example build for the Go language.
221191

222-
[flox-build]: ../reference/command-reference/flox-build.md
192+
[builds-concept]: ./builds.md
223193
[manifest-reference]: ../reference/command-reference/manifest.toml.md#build
224194
[services-concept]: ./services.md
225195
[publish-concept]: ./publishing.md
226196
[fhs-docs]: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
227-
[pkg-groups]: ./manifest.md#installing-packages-to-package-groups
228197
[pkg-groups]: ../reference/command-reference/manifest.toml.md#package-descriptors
229198
[grpc]: https://grpc.io/
230199
[organizations-concept]: ./organizations.md
231200
[go-example]: ../cookbook/languages/go.md#build-with-flox
232-
[flox-ci-cd]: ../tutorials/ci-cd.md

0 commit comments

Comments
 (0)