|
1 | 1 | ---
|
2 |
| -title: "Builds" |
3 |
| -description: Understanding how to build packages with Flox |
| 2 | +title: "Manifest Builds" |
| 3 | +description: Manifest builds with Flox |
4 | 4 | ---
|
5 | 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. |
| 6 | +See the [builds concept][builds-concept] page for an overview of the different types of builds and how to perform them. |
8 | 7 |
|
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 |
11 | 9 |
|
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. |
17 | 11 | 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.
|
18 | 12 | 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).
|
19 | 13 |
|
@@ -114,24 +108,6 @@ command = '''
|
114 | 108 | sandbox = "pure"
|
115 | 109 | ```
|
116 | 110 |
|
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 |
| - |
135 | 111 | ## What can you build?
|
136 | 112 |
|
137 | 113 | 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"]
|
207 | 183 |
|
208 | 184 | Note again that we include the `install-id` `"hello"` in `runtime-packages`, not the name of the package itself (`hello-go`).
|
209 | 185 |
|
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 |
| - |
216 | 186 | ## Examples
|
217 | 187 |
|
218 | 188 | We've compiled a list of example commands to demonstrate how to use Flox to build packages in various ecosystems.
|
219 | 189 | Each language guide in the Languages section of the Cookbook contains an example of building a package with Flox.
|
220 | 190 | For example, [this section][go-example] contains an example build for the Go language.
|
221 | 191 |
|
222 |
| -[flox-build]: ../reference/command-reference/flox-build.md |
| 192 | +[builds-concept]: ./builds.md |
223 | 193 | [manifest-reference]: ../reference/command-reference/manifest.toml.md#build
|
224 | 194 | [services-concept]: ./services.md
|
225 | 195 | [publish-concept]: ./publishing.md
|
226 | 196 | [fhs-docs]: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
|
227 |
| -[pkg-groups]: ./manifest.md#installing-packages-to-package-groups |
228 | 197 | [pkg-groups]: ../reference/command-reference/manifest.toml.md#package-descriptors
|
229 | 198 | [grpc]: https://grpc.io/
|
230 | 199 | [organizations-concept]: ./organizations.md
|
231 | 200 | [go-example]: ../cookbook/languages/go.md#build-with-flox
|
232 |
| -[flox-ci-cd]: ../tutorials/ci-cd.md |
0 commit comments