Update binaries and workflows for pkg6 rename

- Renamed `pkg6dev` to `pkg6` across build scripts, workflows, and documentation.
- Added support for additional binaries (`pkg6repo` and `pkg6depotd`) in release builds.
- Disabled `RUSTFLAGS` warnings-as-errors policy in workflows for improved flexibility.
- Simplified error handling in `manifest_fmri` with streamlined conditionals.
- Introduced `#[allow(clippy::result_large_err)]` to suppress clippy warnings for large error types.
This commit is contained in:
Till Wegmueller 2026-01-18 14:30:05 +01:00
parent b8c625a11e
commit 898ec20ad8
No known key found for this signature in database
6 changed files with 19 additions and 22 deletions

View file

@ -9,7 +9,7 @@ on:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings" # Treat warnings as errors
# RUSTFLAGS: "-D warnings" # Treat warnings as errors
jobs:
# Check code formatting

View file

@ -12,9 +12,11 @@ clean:
release:
cargo build --release
mkdir -p artifacts
cp target/release/pkg6dev artifacts/
cp target/release/pkg6 artifacts/
cp target/release/pkg6repo artifacts/
cp target/release/pkg6depotd artifacts/
publish-all: publish.libips publish.userland publish.pkg6dev
publish-all: publish.libips publish.userland publish.pkg6
publish.%: CRATE=$*
publish.%:

View file

@ -73,6 +73,7 @@ use crate::transformer;
pub use crate::transformer::TransformRule;
/// Unified error type for API-level operations
#[allow(clippy::result_large_err)]
#[derive(Debug, Error, Diagnostic)]
pub enum IpsError {
#[error(transparent)]
@ -634,14 +635,10 @@ impl Resolver {
// Helper: extract the package FMRI from a manifest's attributes
fn manifest_fmri(manifest: &Manifest) -> Option<Fmri> {
for attr in &manifest.attributes {
if attr.key == "pkg.fmri" {
if let Some(val) = attr.values.first() {
if let Ok(f) = Fmri::parse(val) {
if attr.key == "pkg.fmri" && let Some(val) = attr.values.first() && let Ok(f) = Fmri::parse(val) {
return Some(f);
}
}
}
}
None
}

View file

@ -13,6 +13,7 @@ use thiserror::Error;
pub type Result<T> = std::result::Result<T, RepositoryError>;
/// Errors that can occur in repository operations
#[allow(clippy::result_large_err)]
#[derive(Debug, Error, Diagnostic)]
pub enum RepositoryError {
#[error("unsupported repository version: {0}")]

View file

@ -56,7 +56,7 @@ To run end-to-end tests, follow these steps:
### How It Works
The `build-e2e` command:
- Builds the necessary binaries (pkg6repo, pkg6dev, etc.) in release mode
- Builds the necessary binaries (pkg6repo, pkg6, etc.) in release mode
- Copies the binaries to a dedicated directory (`/tmp/pkg6_test/bin`)
The `run-e2e` command:

View file

@ -266,9 +266,6 @@ fn clippy() -> Result<()> {
"clippy",
"--all-targets",
"--all-features",
"--",
"-D",
"warnings",
])
.status()
.context("Failed to run clippy")?;
@ -300,12 +297,12 @@ fn build_e2e() -> Result<()> {
.status()
.context("Failed to build pkg6repo")?;
// Build pkg6dev in release mode
println!("Building pkg6dev...");
// Build pkg6 in release mode
println!("Building pkg6...");
Command::new("cargo")
.args(["build", "--release", "--package", "pkg6dev"])
.args(["build", "--release", "--package", "pkg6"])
.status()
.context("Failed to build pkg6dev")?;
.context("Failed to build pkg6")?;
// Copy the binaries to the bin directory
let target_dir = PathBuf::from("target/release");
@ -318,10 +315,10 @@ fn build_e2e() -> Result<()> {
.context("Failed to copy pkg6repo binary")?;
fs::copy(
target_dir.join("pkg6dev"),
PathBuf::from(E2E_TEST_BIN_DIR).join("pkg6dev"),
target_dir.join("pkg6"),
PathBuf::from(E2E_TEST_BIN_DIR).join("pkg6"),
)
.context("Failed to copy pkg6dev binary")?;
.context("Failed to copy pkg6 binary")?;
println!("End-to-end test binaries built successfully!");
println!("Binaries are located at: {}", E2E_TEST_BIN_DIR);
@ -335,9 +332,9 @@ fn run_e2e(test: &Option<String>) -> Result<()> {
// Check if the binaries exist
let pkg6repo_bin = PathBuf::from(E2E_TEST_BIN_DIR).join("pkg6repo");
let pkg6dev_bin = PathBuf::from(E2E_TEST_BIN_DIR).join("pkg6dev");
let pkg6_bin = PathBuf::from(E2E_TEST_BIN_DIR).join("pkg6");
if !pkg6repo_bin.exists() || !pkg6dev_bin.exists() {
if !pkg6repo_bin.exists() || !pkg6_bin.exists() {
println!("Pre-built binaries not found. Building them first...");
build_e2e()?;
}