Skip to content

Commit

Permalink
Merge branch 'main' into no-bitflags
Browse files Browse the repository at this point in the history
  • Loading branch information
livingsilver94 committed Mar 5, 2024
2 parents 09223db + 749ab4d commit 8f0e68e
Show file tree
Hide file tree
Showing 121 changed files with 5,125 additions and 3,581 deletions.
65 changes: 60 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[workspace]
members = [
"boulder",
"moss",
"crates/*",
]
default-members = [
"crates/moss"
"moss"
]
resolver = "2"

Expand All @@ -15,11 +17,14 @@ bytes = "1.5.0"
chrono = "0.4.30"
clap = { version = "4.4.11", features = ["derive", "string"] }
crossterm = "0.27.0"
derive_more = "0.99"
dialoguer = "0.11.0"
dirs = "5.0"
elf = "0.7.4"
indicatif = "0.17.7"
itertools = "0.12.0"
futures = "0.3.30"
glob = "0.3.1"
hex = "0.4.3"
log = "0.4"
nom = "7.1.3"
Expand All @@ -29,6 +34,7 @@ petgraph = "0.6.4"
rayon = "1.8"
reqwest = { version = "0.11.23", default-features = false, features = ["rustls-tls", "stream"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.9"
sha2 = "0.10.8"
sqlx = { version = "0.7.3", features = ["sqlite", "chrono", "runtime-tokio"] }
Expand Down
18 changes: 13 additions & 5 deletions crates/boulder/Cargo.toml → boulder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,31 @@ edition.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
config = { path = "../config" }
container = { path = "../container" }
config = { path = "../crates/config" }
container = { path = "../crates/container" }
moss = { path = "../moss" }
stone_recipe = { path = "../stone_recipe" }
tui = { path = "../tui" }
yaml = { path = "../yaml" }
stone = { path = "../crates/stone" }
stone_recipe = { path = "../crates/stone_recipe" }
tui = { path = "../crates/tui" }
yaml = { path = "../crates/yaml" }

chrono.workspace = true
clap.workspace = true
derive_more.workspace = true
dirs.workspace = true
elf.workspace = true
glob.workspace = true
futures.workspace = true
hex.workspace = true
itertools.workspace = true
nix.workspace = true
rayon.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_yaml.workspace = true
sha2.workspace = true
strum.workspace = true
thiserror.workspace = true
tokio.workspace = true
url.workspace = true
xxhash-rust.workspace = true
29 changes: 29 additions & 0 deletions boulder/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Boulder

This directory contains the Serpent OS package building tool `boulder`.

## Building boulder

To build boulder, use the `boulder` target:

cargo build -p boulder

This will produce a debug build by default, which is available as `./target/debug/boulder`

The [onboarding/ repository](https://github.com/serpent-os/onboarding/) is in the process of being updated to default to building the Rust based boulder.

## Configuring user namespaces

Boulder supports building as your own user, using a feature called "user namespaces".

If your username is `bob` with `UID = 1000` and `GID = 1000` then you will need to add the following files with the following contents:

$ echo 'bob:100000:65536' |sudo tee /etc/subuid
$ echo 'bob:100000:65536' |sudo tee /etc/subgid

NB: The above assumes you haven't already configured user namespaces.

You can check your username, UID and GID with `grep ${USER} /etc/passwd`, where your username is the first field, the UID is the third field and the GID is the fourth field:

$ grep ${USER} /etc/passwd
bob:x:1000:1000:bob:/home/bob:/bin/bash
File renamed without changes.
38 changes: 38 additions & 0 deletions boulder/data/macros/actions/cargo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
actions:
# Fetch dependencies
- cargo_fetch:
command: |
cargo fetch -v --locked
dependencies:
- rust

# Build the rust project
- cargo_build:
command: |
cargo build -v -j "%(jobs)" --frozen --release --target %(target_triple) \
--config profile.release.debug=\"full\" \
--config profile.release.split-debuginfo=\"off\" \
--config profile.release.strip=\"none\"
dependencies:
- rust

# Install the built binary
- cargo_install:
command: |
cargo_install(){
if [ $# -eq 1 ]; then
%install_bin target/%(target_triple)/release/"$1"
else
%install_bin target/%(target_triple)/release/%(name)
fi
}
cargo_install
dependencies:
- rust

# Run tests
- cargo_test:
command: |
cargo test -v -j "%(jobs)" --frozen --release --target %(target_triple) --workspace
dependencies:
- rust
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ actions:
dependencies:
- ninja

# Run testsuite with ctest
- cmake_test:
command: |
ninja test -v -j "%(jobs)" -C "%(builddir)"
dependencies:
- cmake
- ninja

definitions:

# Default cmake options as passed to cmake
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ actions:
dependencies:
- meson

- meson_test:
command: |
meson test --no-rebuild --print-errorlogs -j "%(jobs)" -C "%(builddir)"
dependencies:
- meson

definitions:

# Default meson options as passed to meson
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ definitions:
- cpp : "%(compiler_cpp) -m64"
- march : armv8-a+simd+fp+crypto
- mtune : cortex-a72.cortex-a53
- target_triple : "aarch64-unknown-linux-gnu"

flags:

Expand Down
Loading

0 comments on commit 8f0e68e

Please sign in to comment.