Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .buildkite/pipeline_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
if any(x.parent.name == "devctr" for x in changed_files):
pipeline.build_group_per_arch(
"🐋 Dev Container Sanity Build",
"./tools/devtool -y build_devctr && DEVCTR_IMAGE_TAG=latest ./tools/devtool test -- integration_tests/functional/test_api.py",
"./tools/devtool -y build_devctr && DEVCTR_IMAGE_TAG=latest ./tools/devtool test --no-build -- integration_tests/functional/test_api.py",
)

if any(
Expand All @@ -46,6 +46,7 @@
pipeline.build_group_per_arch(
"📦 Release Sanity Build",
"./tools/devtool -y make_release",
depends_on_build=False,
)

if not pipeline.args.no_kani and (
Expand Down
36 changes: 8 additions & 28 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,39 +57,19 @@ If you just want to receive feedback for a contribution proposal, open an “RFC
## Contribution Quality Standards

Most quality and style standards are enforced automatically during integration
testing. For ease of use you can setup a git pre-commit hook by running the
testing. For ease of use you can set up a git pre-commit hook by running the
following in the Firecracker root directory:

```
cargo install rusty-hook
rusty-hook init
cat >> .git/hooks/pre-commit << EOF
./tools/devtool checkstyle || exit 1
EOF
```

This project also has linters for Python and Markdown. These will be called by
the pre-commit when you modify any Python and Markdown files. In order to make
sure you are setup we recommend you install
[poetry](https://python-poetry.org/docs/) and
[pyenv](https://github.com/pyenv/pyenv?tab=readme-ov-file#installation).

Poetry is used by this project and pyenv will help you make sure you have a
Python version compatible with the poetry python project we use as part of
`./tools/devctr`.

Once you have these two installed you can run the following to install the dev
container poetry project:

```
poetry -C ./tools/devctr install --no-root
```

Then, you can activate the poetry virtual environment by running:

```
poetry shell -C ./tools/devctr
```

Which you will need to do after modifying python or markdown files so that the
pre-commit can finish successfully.
This will automatically lint your Rust, markdown and python changes when running
`git commit`, as well as running any other checks our CI validates as part of
its 'Style' step. Most reported violations can be automatically fixed using
`./tools/devtool fmt`.

Your contribution needs to meet the following standards:

Expand Down
10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@ members = ["src/*"]
# for the gnu target, and the jailer needs a statically compiled binary to work correctly.
# See https://github.com/firecracker-microvm/firecracker/commit/3bf285c8f8a815149923c562dd7edaffcaf10c4e
# and https://github.com/firecracker-microvm/firecracker/issues/2102
default-members = ["src/clippy-tracing", "src/cpu-template-helper", "src/firecracker", "src/rebase-snap", "src/seccompiler", "src/snapshot-editor", "src/acpi-tables"]
default-members = [
"src/clippy-tracing",
"src/cpu-template-helper",
"src/firecracker",
"src/rebase-snap",
"src/seccompiler",
"src/snapshot-editor",
"src/acpi-tables",
]
resolver = "2"

[workspace.lints.rust]
Expand Down
52 changes: 0 additions & 52 deletions pre-commit

This file was deleted.

7 changes: 0 additions & 7 deletions rusty-hook.toml

This file was deleted.

11 changes: 7 additions & 4 deletions src/acpi-tables/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
[package]
name = "acpi_tables"
version = "0.1.0"
authors = ["The Cloud Hypervisor Authors", "Amazon Firecracker team <[email protected]>"]
authors = [
"The Cloud Hypervisor Authors",
"Amazon Firecracker team <[email protected]>",
]
edition = "2024"
license = "Apache-2.0"

[lib]
bench = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand All @@ -12,8 +18,5 @@ thiserror = "2.0.12"
vm-memory = { version = "0.16.1", features = ["backend-mmap", "backend-bitmap"] }
zerocopy = { version = "0.8.25", features = ["derive"] }

[lib]
bench = false

[lints]
workspace = true
6 changes: 3 additions & 3 deletions src/cpu-template-helper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ license = "Apache-2.0"
name = "cpu-template-helper"
bench = false

[features]
tracing = ["log-instrument", "vmm/tracing"]

[dependencies]
clap = { version = "4.5.38", features = ["derive", "string"] }
displaydoc = "0.2.5"
Expand All @@ -21,8 +24,5 @@ thiserror = "2.0.12"
vmm = { path = "../vmm" }
vmm-sys-util = "0.12.1"

[features]
tracing = ["log-instrument", "vmm/tracing"]

[lints]
workspace = true
23 changes: 11 additions & 12 deletions src/firecracker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@ description = "Firecracker enables you to deploy workloads in lightweight virtua
homepage = "https://firecracker-microvm.github.io/"
license = "Apache-2.0"

[lib]
bench = false

[[bin]]
name = "firecracker"
bench = false

[lib]
bench = false
[features]
tracing = ["log-instrument", "utils/tracing", "vmm/tracing"]
gdb = ["vmm/gdb"]

[dependencies]
displaydoc = "0.2.5"
event-manager = "0.4.0"
libc = "0.2.172"
log-instrument = { path = "../log-instrument", optional = true }
micro_http = { git = "https://github.com/firecracker-microvm/micro-http" }

serde = { version = "1.0.219", features = ["derive"] }
serde_derive = "1.0.136"
serde_json = "1.0.140"
Expand All @@ -31,6 +34,11 @@ utils = { path = "../utils" }
vmm = { path = "../vmm" }
vmm-sys-util = { version = "0.12.1", features = ["with-serde"] }

[build-dependencies]
seccompiler = { path = "../seccompiler" }
serde = { version = "1.0.219" }
serde_json = "1.0.140"

[dev-dependencies]
cargo_toml = "0.22.1"
libc = "0.2.172"
Expand All @@ -40,15 +48,6 @@ regex = { version = "1.11.1", default-features = false, features = ["std", "unic
serde = { version = "1.0.219", features = ["derive"] }
userfaultfd = "0.8.1"

[build-dependencies]
seccompiler = { path = "../seccompiler" }
serde = { version = "1.0.219" }
serde_json = "1.0.140"

[features]
tracing = ["log-instrument", "utils/tracing", "vmm/tracing"]
gdb = ["vmm/gdb"]

[lints]
workspace = true

Expand Down
6 changes: 3 additions & 3 deletions src/jailer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ license = "Apache-2.0"
name = "jailer"
bench = false

[features]
tracing = ["log-instrument", "utils/tracing"]

[dependencies]
libc = "0.2.172"
log-instrument = { path = "../log-instrument", optional = true }
Expand All @@ -20,8 +23,5 @@ vmm-sys-util = "0.12.1"

utils = { path = "../utils" }

[features]
tracing = ["log-instrument", "utils/tracing"]

[lints]
workspace = true
14 changes: 7 additions & 7 deletions src/log-instrument/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ license = "Apache-2.0"
[lib]
bench = false

[dependencies]
log = "0.4.27"
log-instrument-macros = { path = "../log-instrument-macros" }

[dev-dependencies]
env_logger = "0.11.8"

[[example]]
name = "one"

Expand All @@ -27,12 +34,5 @@ name = "five"
[[example]]
name = "six"

[dependencies]
log = "0.4.27"
log-instrument-macros = { path = "../log-instrument-macros" }

[dev-dependencies]
env_logger = "0.11.8"

[lints]
workspace = true
6 changes: 3 additions & 3 deletions src/rebase-snap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ license = "Apache-2.0"
name = "rebase-snap"
bench = false

[features]
tracing = ["log-instrument", "utils/tracing"]

[dependencies]
displaydoc = "0.2.5"
libc = "0.2.172"
Expand All @@ -18,8 +21,5 @@ vmm-sys-util = "0.12.1"

utils = { path = "../utils" }

[features]
tracing = ["log-instrument", "utils/tracing"]

[lints]
workspace = true
6 changes: 3 additions & 3 deletions src/snapshot-editor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ license = "Apache-2.0"
name = "snapshot-editor"
bench = false

[features]
tracing = ["log-instrument", "fc_utils/tracing", "vmm/tracing"]

[dependencies]
clap = { version = "4.5.38", features = ["derive", "string"] }
displaydoc = "0.2.5"
Expand All @@ -24,8 +27,5 @@ vmm-sys-util = "0.12.1"
[target.'cfg(target_arch = "aarch64")'.dependencies]
clap-num = "1.2.0"

[features]
tracing = ["log-instrument", "fc_utils/tracing", "vmm/tracing"]

[lints]
workspace = true
6 changes: 3 additions & 3 deletions src/utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ license = "Apache-2.0"
[lib]
bench = false

[features]
tracing = ["log-instrument"]

[dependencies]
displaydoc = "0.2.5"
libc = "0.2.172"
log-instrument = { path = "../log-instrument", optional = true }
thiserror = "2.0.12"

[features]
tracing = ["log-instrument"]

[lints]
workspace = true
12 changes: 6 additions & 6 deletions src/vmm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ license = "Apache-2.0"
[lib]
bench = false

[features]
default = []
tracing = ["log-instrument"]
gdb = ["arrayvec", "gdbstub", "gdbstub_arch"]

[dependencies]
acpi_tables = { path = "../acpi-tables" }
aes-gcm = { version = "0.10.1", default-features = false, features = ["aes"] }
aes-gcm = { version = "0.10.1", default-features = false, features = ["aes"] }
arrayvec = { version = "0.7.6", optional = true }
aws-lc-rs = { version = "1.13.1", features = ["bindgen"] }
base64 = "0.22.1"
Expand Down Expand Up @@ -54,11 +59,6 @@ device_tree = "1.1.0"
itertools = "0.14.0"
proptest = { version = "1.6.0", default-features = false, features = ["std"] }

[features]
default = []
tracing = ["log-instrument"]
gdb = ["arrayvec", "gdbstub", "gdbstub_arch"]

[[bench]]
name = "cpu_templates"
harness = false
Expand Down
2 changes: 1 addition & 1 deletion tests/framework/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_os_version():
"""Get the OS version

>>> get_os_version()
'Ubuntu 24.04.1 LTS'
'Ubuntu 24.04.2 LTS'
"""

os_release = Path("/etc/os-release").read_text(encoding="ascii")
Expand Down
Loading