diff --git a/.github/actions/run-packaging-tests/action.yml b/.github/actions/run-packaging-tests/action.yml
new file mode 100644
index 00000000..81711582
--- /dev/null
+++ b/.github/actions/run-packaging-tests/action.yml
@@ -0,0 +1,52 @@
+name: 'Run Packaging Tests'
+description: 'Runs the packaging tests'
+
+inputs:
+ distro:
+ description: 'Distribution to test (bookworm, jammy, noble)'
+ required: true
+ language:
+ description: 'Language to test'
+ required: true
+ run_piuparts:
+ description: 'Whether to run piuparts'
+ required: false
+ default: 'false'
+ run_autopkgtest:
+ description: 'Whether to run autopkgtest'
+ required: false
+ default: 'false'
+
+runs:
+ using: "composite"
+ steps:
+ - name: Package
+ shell: bash
+ run: |
+ cd examples/${{ inputs.distro }}/${{ inputs.language }}/hello-world
+ pkg-builder package --run-piuparts ${{ inputs.run_piuparts }} --run-autopkgtest ${{ inputs.run_autopkgtest }}
+
+ - name: piuparts
+ if: ${{ inputs.run_piuparts == 'true' }}
+ shell: bash
+ run: |
+ # installing debian-archive-keyring fails on ubuntu LTS, not sure why, but it says it is already installed
+ # sudo apt-get install -y debian-archive-keyring
+ cd examples/${{ inputs.distro }}/${{ inputs.language }}/hello-world
+ ${HOME}/.local/bin/pkg-builder piuparts
+
+ # TODO version parsing fails, as it doesn't use semver
+ - name: autopkgtest
+ if: ${{ inputs.run_autopkgtest == 'true' }}
+ shell: bash
+ run: |
+ sudo cp -R ${HOME}/.pkg-builder /root
+ apt list --installed autopkgtest
+ cd examples/${{ inputs.distro }}/${{ inputs.language }}/hello-world
+ sudo ${HOME}/.local/bin/pkg-builder autopkgtest
+
+ - name: Verify
+ shell: bash
+ run: |
+ cd examples/${{ inputs.distro }}/${{ inputs.language }}/hello-world
+ ${HOME}/.local/bin/pkg-builder verify --no-package true
\ No newline at end of file
diff --git a/.github/actions/setup-packaging-env/action.yml b/.github/actions/setup-packaging-env/action.yml
new file mode 100644
index 00000000..46abbae4
--- /dev/null
+++ b/.github/actions/setup-packaging-env/action.yml
@@ -0,0 +1,39 @@
+name: 'Setup Packaging Environment'
+description: 'Sets up environment for packaging tests'
+
+inputs:
+ include_genisoimage:
+ description: 'Whether to include genisoimage'
+ required: false
+ default: 'false'
+
+runs:
+ using: "composite"
+ steps:
+ - name: Setup sbuild
+ uses: ./.github/actions/setup-sbuild
+
+ - name: Additional dependencies
+ shell: bash
+ run: |
+ sudo apt install -y autopkgtest vmdb2 qemu-system-x86
+ if [ "${{ inputs.include_genisoimage }}" = "true" ]; then
+ sudo apt-get install -y genisoimage
+ fi
+
+ - name: Build pkg-builder
+ shell: bash
+ run: |
+ cargo build --verbose
+ cargo build --release
+
+ - name: Install pkg-builder
+ shell: bash
+ run: |
+ mkdir -p ${HOME}/.local/bin
+ mv target/release/pkg-builder ${HOME}/.local/bin
+ # add to path the prebuilt debcrafter binaries as well
+ cp workspace/pkg_builder/bin_dependencies/debcrafter_* ${HOME}/.local/bin
+ chmod +x ${HOME}/.local/bin/debcrafter_*
+ chmod +x ${HOME}/.local/bin/pkg-builder
+ echo "${HOME}/.local/bin" >> $GITHUB_PATH
\ No newline at end of file
diff --git a/.github/actions/setup-sbuild/action.yml b/.github/actions/setup-sbuild/action.yml
new file mode 100644
index 00000000..95167cb0
--- /dev/null
+++ b/.github/actions/setup-sbuild/action.yml
@@ -0,0 +1,18 @@
+name: 'Setup sbuild'
+description: 'Sets up sbuild environment'
+
+runs:
+ using: "composite"
+ steps:
+ - name: Sbuild setup
+ shell: bash
+ run: |
+ sudo apt-get update
+ # Note this is an older version of sbuild, no need to patch it, yet
+ sudo apt install -y debhelper schroot ubuntu-dev-tools
+ sudo apt-get -y install pkg-config libssl-dev uidmap
+ sudo apt-get install -y libfilesys-df-perl libmime-lite-perl
+ wget https://github.com/eth-pkg/sbuild-ubuntu/releases/download/0.85-6-1/sbuild_0.85.6_all.deb
+ wget https://github.com/eth-pkg/sbuild-ubuntu/releases/download/0.85-6-1/libsbuild-perl_0.85.6_all.deb
+ sudo dpkg -i sbuild_0.85.6_all.deb libsbuild-perl_0.85.6_all.deb || true
+ sudo sbuild-adduser `whoami`
\ No newline at end of file
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 4ec91afb..16cda9d0 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -14,30 +14,20 @@ env:
jobs:
unit_tests:
runs-on: ubuntu-24.04
-
steps:
- uses: actions/checkout@v4
-
- - name: Sbuild setup
- run: |
- sudo apt-get update
- # Note this is an older version of sbuild, no need to patch it, yet
- sudo apt install -y debhelper schroot ubuntu-dev-tools piuparts
- sudo apt-get -y install pkg-config libssl-dev uidmap
- sudo apt-get install -y libfilesys-df-perl libmime-lite-perl
- wget https://github.com/eth-pkg/sbuild-ubuntu/releases/download/0.85-6-1/sbuild_0.85.6_all.deb
- wget https://github.com/eth-pkg/sbuild-ubuntu/releases/download/0.85-6-1/libsbuild-perl_0.85.6_all.deb
- sudo dpkg -i sbuild_0.85.6_all.deb libsbuild-perl_0.85.6_all.deb || true
- sudo sbuild-adduser `whoami`
+
+ - name: Setup sbuild
+ uses: ./.github/actions/setup-sbuild
+
- name: Build
run: cargo build --verbose
- name: Run unit tests
- run: cargo test --lib --verbose
+ run: cargo test --lib --verbose -- --ignored
bookworm_amd64_packaging:
runs-on: ubuntu-24.04
-
strategy:
matrix:
language:
@@ -52,73 +42,30 @@ jobs:
- typescript
- virtual
#- python
+ max-parallel: 3
fail-fast: false
steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Sbuild setup
- run: |
- sudo apt-get update
- # Note this is an older version of sbuild, no need to patch it, yet
- sudo apt install -y debhelper schroot ubuntu-dev-tools piuparts autopkgtest vmdb2 qemu-system-x86
- sudo apt-get install -y pkg-config libssl-dev uidmap
- sudo apt-get install -y libfilesys-df-perl libmime-lite-perl
- # change this into actually built version and cache it
- wget https://github.com/eth-pkg/sbuild-ubuntu/releases/download/0.85-6-1/sbuild_0.85.6_all.deb
- wget https://github.com/eth-pkg/sbuild-ubuntu/releases/download/0.85-6-1/libsbuild-perl_0.85.6_all.deb
- sudo dpkg -i sbuild_0.85.6_all.deb libsbuild-perl_0.85.6_all.deb || true
-
- - name: Build
- run: |
- cargo build --verbose
-
- - name: Install
- run: |
- cargo build --release
- mkdir -p ${HOME}/.local/bin
- mv target/release/pkg-builder ${HOME}/.local/bin
- # add to path the prebuilt debcrafter binaries as well
- cp bin_dependencies/debcrafter_* ${HOME}/.local/bin
- chmod +x ${HOME}/.local/bin/pkg-builder
- echo "${HOME}/.local/bin" >> $GITHUB_PATH
-
+ - uses: actions/checkout@v4
+
+ - name: Setup environment
+ uses: ./.github/actions/setup-packaging-env
+
- name: Create chroot env
run: |
cd examples/bookworm/${{matrix.language}}/hello-world
pkg-builder env create
echo "${HOME}/.cache/sbuild/bookworm-amd64.tar.gz" >> $GITHUB_PATH
- - name: package
- run: |
- cd examples/bookworm/${{matrix.language}}/hello-world
- pkg-builder package --run-piuparts false --run-autopkgtest false
-
-
- - name: piuparts
- run: |
- # installing debian-archive-keyring fails on ubuntu LTS, not sure why, but it says it is already installed
- # sudo apt-get install -y debian-archive-keyring
- cd examples/bookworm/${{matrix.language}}/hello-world
- ${HOME}/.local/bin/pkg-builder piuparts
-
- - name: autopkgtest
- run: |
- sudo cp -R ${HOME}/.pkg-builder /root
- apt list --installed autopkgtest
- cd examples/bookworm/${{matrix.language}}/hello-world
- sudo ${HOME}/.local/bin/pkg-builder autopkgtest
-
-
- - name: verify
- run: |
- cd examples/bookworm/${{matrix.language}}/hello-world
- ${HOME}/.local/bin/pkg-builder verify --no-package true
-
+ - name: Run packaging tests
+ uses: ./.github/actions/run-packaging-tests
+ with:
+ distro: bookworm
+ language: ${{matrix.language}}
+ run_piuparts: false
+ run_autopkgtest: true
jammy_amd64_packaging:
runs-on: ubuntu-24.04
-
strategy:
matrix:
language:
@@ -132,76 +79,30 @@ jobs:
- rust
- typescript
- virtual
+ max-parallel: 3
fail-fast: false
steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Sbuild setup
- run: |
- sudo apt-get update
- # Note this is an older version of sbuild, no need to patch it, yet
- sudo apt install -y debhelper schroot ubuntu-dev-tools piuparts autopkgtest vmdb2 qemu-system-x86
- sudo apt-get install -y pkg-config libssl-dev uidmap
- sudo apt-get install -y libfilesys-df-perl libmime-lite-perl
- sudo apt-get install -y genisoimage
- # change this into actually built version and cache it
- wget https://github.com/eth-pkg/sbuild-ubuntu/releases/download/0.85-6-1/sbuild_0.85.6_all.deb
- wget https://github.com/eth-pkg/sbuild-ubuntu/releases/download/0.85-6-1/libsbuild-perl_0.85.6_all.deb
- sudo dpkg -i sbuild_0.85.6_all.deb libsbuild-perl_0.85.6_all.deb || true
-
- - name: Build
- run: |
- cargo build --verbose
-
- - name: Install
- run: |
- cargo build --release
- mkdir -p ${HOME}/.local/bin
- mv target/release/pkg-builder ${HOME}/.local/bin
- # add to path the prebuilt debcrafter binaries as well
- cp bin_dependencies/debcrafter_* ${HOME}/.local/bin
- chmod +x ${HOME}/.local/bin/pkg-builder
- echo "${HOME}/.local/bin" >> $GITHUB_PATH
-
+ - uses: actions/checkout@v4
+
+ - name: Setup environment
+ uses: ./.github/actions/setup-packaging-env
+
- name: Create chroot env
run: |
cd examples/jammy/${{matrix.language}}/hello-world
pkg-builder env create
echo "${HOME}/.cache/sbuild/noble-amd64.tar.gz" >> $GITHUB_PATH
- - name: package
- run: |
- cd examples/jammy/${{matrix.language}}/hello-world
- pkg-builder package --run-piuparts false --run-autopkgtest false
-
-
- - name: piuparts
- run: |
- # installing debian-archive-keyring fails on ubuntu LTS, not sure why, but it says it is already installed
- # sudo apt-get install -y debian-archive-keyring
- cd examples/jammy/${{matrix.language}}/hello-world
- ${HOME}/.local/bin/pkg-builder piuparts
-
- - name: autopkgtest
- run: |
- sudo cp -R ${HOME}/.pkg-builder /root
- apt list --installed autopkgtest
- echo $AUTOPKGTEST_KEEP_APT_SOURCES
- echo $AUTOPKGTEST_APT_SOURCES_FILE
- cd examples/jammy/${{matrix.language}}/hello-world
- sudo ${HOME}/.local/bin/pkg-builder autopkgtest
-
-
- - name: verify
- run: |
- cd examples/jammy/${{matrix.language}}/hello-world
- ${HOME}/.local/bin/pkg-builder verify --no-package true
-
+ - name: Run packaging tests
+ uses: ./.github/actions/run-packaging-tests
+ with:
+ distro: jammy
+ language: ${{matrix.language}}
+ run_piuparts: false
+ run_autopkgtest: true
noble_amd64_packaging:
runs-on: ubuntu-24.04
-
strategy:
matrix:
language:
@@ -217,73 +118,34 @@ jobs:
- typescript
- virtual
#- python
+ max-parallel: 3
fail-fast: false
steps:
- - name: Checkout code
- uses: actions/checkout@v4
-
- - name: Sbuild setup
+ - uses: actions/checkout@v4
+
+ - name: Setup environment
+ uses: ./.github/actions/setup-packaging-env
+ with:
+ include_genisoimage: true
+
+ - name: Additional noble setup
run: |
- sudo apt-get update
- # Note this is an older version of sbuild, no need to patch it, yet
- sudo apt install -y debhelper schroot ubuntu-dev-tools autopkgtest vmdb2 qemu-system-x86
- sudo apt-get install -y pkg-config libssl-dev uidmap
- sudo apt-get install -y libfilesys-df-perl libmime-lite-perl
- sudo apt-get install -y genisoimage
- # change this into actually built version and cache it
- wget https://github.com/eth-pkg/sbuild-ubuntu/releases/download/0.85-6-1/sbuild_0.85.6_all.deb
- wget https://github.com/eth-pkg/sbuild-ubuntu/releases/download/0.85-6-1/libsbuild-perl_0.85.6_all.deb
- sudo dpkg -i sbuild_0.85.6_all.deb libsbuild-perl_0.85.6_all.deb || true
sudo sbuild-adduser `whoami`
- #newgrp sbuild
-
- - name: Build
- run: |
- cargo build --verbose
-
- - name: Install
- run: |
- cargo build --release
- mkdir -p ${HOME}/.local/bin
- mv target/release/pkg-builder ${HOME}/.local/bin
- # add to path the prebuilt debcrafter binaries as well
- cp bin_dependencies/debcrafter_* ${HOME}/.local/bin
- chmod +x ${HOME}/.local/bin/pkg-builder
- echo "${HOME}/.local/bin" >> $GITHUB_PATH
-
- - name: Create chroot env
- run: |
- cd examples/noble/${{matrix.language}}/hello-world
sudo sysctl -w kernel.unprivileged_userns_clone=1
#sudo ln -s /usr/share/debootstrap/scripts/gutsy /usr/share/debootstrap/scripts/noble
- # sudo ${HOME}/.local/bin/pkg-builder env create
- # First will fail, try again
#sudo cat /etc/subuid
- pkg-builder env create
- echo "${HOME}/.cache/sbuild/noble-amd64.tar.gz" >> $GITHUB_PATH
- - name: package
+ - name: Create chroot env
run: |
cd examples/noble/${{matrix.language}}/hello-world
- pkg-builder package --run-piuparts false --run-autopkgtest false
-
-
- # - name: piuparts
- # run: |
- # # installing debian-archive-keyring fails on ubuntu LTS, not sure why, but it says it is already installed
- # # sudo apt-get install -y debian-archive-keyring
- # cd examples/noble/${{matrix.language}}/hello-world
- # ${HOME}/.local/bin/pkg-builder piuparts
-
- - name: autopkgtest
- run: |
- sudo cp -R ${HOME}/.pkg-builder /root
- apt list --installed autopkgtest
- cd examples/noble/${{matrix.language}}/hello-world
- sudo ${HOME}/.local/bin/pkg-builder autopkgtest
-
+ pkg-builder env create
+ echo "${HOME}/.cache/sbuild/noble-amd64.tar.gz" >> $GITHUB_PATH
- - name: verify
- run: |
- cd examples/noble/${{matrix.language}}/hello-world
- ${HOME}/.local/bin/pkg-builder verify --no-package true
+ - name: Run packaging tests
+ uses: ./.github/actions/run-packaging-tests
+ with:
+ distro: noble
+ language: ${{matrix.language}}
+ run_piuparts: false
+ run_autopkgtest: true
+
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 34bdecd5..2613317c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
/target
.idea
-/bin_dependencies
\ No newline at end of file
+workspace/pkg_builder/bin_dependencies
+workspace/**/target/**
\ No newline at end of file
diff --git a/CONFIG.md b/CONFIG.md
new file mode 100644
index 00000000..68c87bfa
--- /dev/null
+++ b/CONFIG.md
@@ -0,0 +1,182 @@
+# Configuration Reference
+
+pkg-builder uses TOML configuration files to define package metadata, build environments, and dependencies.
+
+## Basic Structure
+
+```toml
+[package_fields]
+spec_file = "path/to/spec.sss"
+package_name = "package-name"
+version_number = "1.0.0"
+revision_number = "1"
+homepage = "https://example.com"
+
+[package_type]
+package_type = "default|git|virtual"
+# Fields vary based on package_type
+
+[build_env]
+codename = "bookworm"
+arch = "amd64"
+pkg_builder_version = "0.3.0"
+debcrafter_version = "8189263"
+# Additional build environment options
+```
+
+## Package Fields
+
+```toml
+[package_fields]
+spec_file = "hello-world.sss" # Path to spec file
+package_name = "hello-world" # Package name
+version_number = "1.0.0" # Version
+revision_number = "1" # Revision number
+homepage = "https://github.com/..." # Project homepage
+```
+
+## Package Types
+
+### Virtual Package
+
+```toml
+[package_type]
+package_type = "virtual"
+```
+
+### Default Package Type
+
+```toml
+[package_type]
+package_type = "default"
+tarball_url = "hello-world-1.0.0.tar.gz"
+tarball_hash = "c93bdd829eca65af1e303d..." # Optional checksum
+
+[package_type.language_env]
+language_env = "c|rust|go|javascript|typescript|java|dotnet|nim|python"
+# Additional fields based on language_env
+```
+
+### Git Package Type
+
+```toml
+[package_type]
+package_type = "git"
+git_tag = "v1.0.0"
+git_url = "https://github.com/user/repo.git"
+
+[[package_type.submodules]]
+commit = "abcdef123456"
+path = "path/to/submodule"
+
+[package_type.language_env]
+language_env = "c|rust|go|javascript|typescript|java|dotnet|nim|python"
+# Additional fields based on language_env
+```
+
+## Language Environments
+
+### C (Default)
+
+```toml
+[package_type.language_env]
+language_env = "c"
+```
+
+### Python
+
+```toml
+[package_type.language_env]
+language_env = "python"
+```
+
+### Rust
+
+```toml
+[package_type.language_env]
+language_env = "rust"
+rust_version = "1.67.0"
+rust_binary_url = "https://static.rust-lang.org/..."
+rust_binary_gpg_asc = "..."
+```
+
+### Go
+
+```toml
+[package_type.language_env]
+language_env = "go"
+go_version = "1.19.0"
+go_binary_url = "https://go.dev/dl/..."
+go_binary_checksum = "..."
+```
+
+### JavaScript/TypeScript
+
+```toml
+[package_type.language_env]
+language_env = "javascript" # or "typescript"
+node_version = "18.12.0"
+node_binary_url = "https://nodejs.org/dist/..."
+node_binary_checksum = "..."
+yarn_version = "1.22.19" # Optional
+```
+
+### Java
+
+```toml
+[package_type.language_env]
+language_env = "java"
+is_oracle = false
+jdk_version = "17.0.5"
+jdk_binary_url = "https://..."
+jdk_binary_checksum = "..."
+
+# Optional Gradle configuration
+[package_type.language_env.gradle]
+gradle_version = "7.6"
+gradle_binary_url = "https://..."
+gradle_binary_checksum = "..."
+```
+
+### .NET
+
+```toml
+[package_type.language_env]
+language_env = "dotnet"
+use_backup_version = false
+deps = ["dependency1", "dependency2"] # Optional
+
+[[package_type.language_env.dotnet_packages]]
+name = "package-name"
+hash = "checksum"
+url = "https://..."
+```
+
+### Nim
+
+```toml
+[package_type.language_env]
+language_env = "nim"
+nim_version = "1.6.8"
+nim_binary_url = "https://nim-lang.org/..."
+nim_version_checksum = "..."
+```
+
+## Build Environment
+
+```toml
+[build_env]
+codename = "bookworm" # Target distribution
+arch = "amd64" # Target architecture
+pkg_builder_version = "0.3.0" # Tool version
+debcrafter_version = "8189263" # Debcrafter version
+sbuild_cache_dir = "/path/to/cache" # Optional cache directory, defaults to ~/.cache/sbuild
+run_lintian = true # Enable lintian checks
+run_piuparts = true # Enable piuparts tests
+run_autopkgtest = true # Enable autopkgtest
+lintian_version = "2.116.3" # Lintian version
+piuparts_version = "1.1.7" # Piuparts version
+autopkgtest_version = "5.28" # Autopkgtest version
+sbuild_version = "0.85.6" # Sbuild version
+workdir = "~/.pkg-builder/..." # Working directory
+```
\ No newline at end of file
diff --git a/Cargo.lock b/Cargo.lock
index e55eb2bd..66daa228 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,21 +1,21 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
-version = 3
+version = 4
[[package]]
name = "addr2line"
-version = "0.21.0"
+version = "0.24.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
+checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1"
dependencies = [
"gimli",
]
[[package]]
-name = "adler"
-version = "1.0.2"
+name = "adler2"
+version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
+checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
[[package]]
name = "aho-corasick"
@@ -28,50 +28,52 @@ dependencies = [
[[package]]
name = "anstream"
-version = "0.6.13"
+version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb"
+checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b"
dependencies = [
"anstyle",
"anstyle-parse",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
+ "is_terminal_polyfill",
"utf8parse",
]
[[package]]
name = "anstyle"
-version = "1.0.6"
+version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc"
+checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9"
[[package]]
name = "anstyle-parse"
-version = "0.2.3"
+version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c"
+checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
-version = "1.0.2"
+version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648"
+checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c"
dependencies = [
- "windows-sys 0.52.0",
+ "windows-sys 0.59.0",
]
[[package]]
name = "anstyle-wincon"
-version = "3.0.2"
+version = "3.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7"
+checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e"
dependencies = [
"anstyle",
- "windows-sys 0.52.0",
+ "once_cell",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -116,28 +118,26 @@ dependencies = [
[[package]]
name = "async-channel"
-version = "2.2.0"
+version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3"
+checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a"
dependencies = [
"concurrent-queue",
- "event-listener 5.2.0",
- "event-listener-strategy 0.5.0",
+ "event-listener-strategy",
"futures-core",
"pin-project-lite",
]
[[package]]
name = "async-executor"
-version = "1.8.0"
+version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c"
+checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec"
dependencies = [
- "async-lock 3.3.0",
"async-task",
"concurrent-queue",
- "fastrand 2.0.2",
- "futures-lite 2.3.0",
+ "fastrand",
+ "futures-lite",
"slab",
]
@@ -147,135 +147,108 @@ version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c"
dependencies = [
- "async-channel 2.2.0",
+ "async-channel 2.3.1",
"async-executor",
- "async-io 2.3.2",
- "async-lock 3.3.0",
+ "async-io",
+ "async-lock",
"blocking",
- "futures-lite 2.3.0",
+ "futures-lite",
"once_cell",
]
[[package]]
name = "async-io"
-version = "1.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af"
-dependencies = [
- "async-lock 2.8.0",
- "autocfg",
- "cfg-if",
- "concurrent-queue",
- "futures-lite 1.13.0",
- "log",
- "parking",
- "polling 2.8.0",
- "rustix 0.37.27",
- "slab",
- "socket2 0.4.10",
- "waker-fn",
-]
-
-[[package]]
-name = "async-io"
-version = "2.3.2"
+version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884"
+checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059"
dependencies = [
- "async-lock 3.3.0",
+ "async-lock",
"cfg-if",
"concurrent-queue",
"futures-io",
- "futures-lite 2.3.0",
+ "futures-lite",
"parking",
- "polling 3.6.0",
- "rustix 0.38.32",
+ "polling",
+ "rustix 0.38.44",
"slab",
"tracing",
- "windows-sys 0.52.0",
-]
-
-[[package]]
-name = "async-lock"
-version = "2.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b"
-dependencies = [
- "event-listener 2.5.3",
+ "windows-sys 0.59.0",
]
[[package]]
name = "async-lock"
-version = "3.3.0"
+version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b"
+checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18"
dependencies = [
- "event-listener 4.0.3",
- "event-listener-strategy 0.4.0",
+ "event-listener 5.4.0",
+ "event-listener-strategy",
"pin-project-lite",
]
[[package]]
name = "async-object-pool"
-version = "0.1.4"
+version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aeb901c30ebc2fc4ab46395bbfbdba9542c16559d853645d75190c3056caf3bc"
+checksum = "333c456b97c3f2d50604e8b2624253b7f787208cb72eb75e64b0ad11b221652c"
dependencies = [
"async-std",
]
[[package]]
name = "async-process"
-version = "1.8.1"
+version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88"
+checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb"
dependencies = [
- "async-io 1.13.0",
- "async-lock 2.8.0",
+ "async-channel 2.3.1",
+ "async-io",
+ "async-lock",
"async-signal",
+ "async-task",
"blocking",
"cfg-if",
- "event-listener 3.1.0",
- "futures-lite 1.13.0",
- "rustix 0.38.32",
- "windows-sys 0.48.0",
+ "event-listener 5.4.0",
+ "futures-lite",
+ "rustix 0.38.44",
+ "tracing",
]
[[package]]
name = "async-signal"
-version = "0.2.5"
+version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5"
+checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3"
dependencies = [
- "async-io 2.3.2",
- "async-lock 2.8.0",
+ "async-io",
+ "async-lock",
"atomic-waker",
"cfg-if",
"futures-core",
"futures-io",
- "rustix 0.38.32",
+ "rustix 0.38.44",
"signal-hook-registry",
"slab",
- "windows-sys 0.48.0",
+ "windows-sys 0.59.0",
]
[[package]]
name = "async-std"
-version = "1.12.0"
+version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d"
+checksum = "730294c1c08c2e0f85759590518f6333f0d5a0a766a27d519c1b244c3dfd8a24"
dependencies = [
"async-attributes",
"async-channel 1.9.0",
"async-global-executor",
- "async-io 1.13.0",
- "async-lock 2.8.0",
+ "async-io",
+ "async-lock",
"async-process",
"crossbeam-utils",
"futures-channel",
"futures-core",
"futures-io",
- "futures-lite 1.13.0",
+ "futures-lite",
"gloo-timers",
"kv-log-macro",
"log",
@@ -289,19 +262,19 @@ dependencies = [
[[package]]
name = "async-task"
-version = "4.7.0"
+version = "4.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799"
+checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
[[package]]
name = "async-trait"
-version = "0.1.79"
+version = "0.1.88"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681"
+checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.55",
+ "syn 2.0.100",
]
[[package]]
@@ -312,23 +285,23 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
[[package]]
name = "autocfg"
-version = "1.2.0"
+version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80"
+checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
[[package]]
name = "backtrace"
-version = "0.3.71"
+version = "0.3.74"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d"
+checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a"
dependencies = [
"addr2line",
- "cc",
"cfg-if",
"libc",
"miniz_oxide",
"object",
"rustc-demangle",
+ "windows-targets 0.52.6",
]
[[package]]
@@ -365,67 +338,58 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
[[package]]
name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
-name = "bitflags"
-version = "2.5.0"
+version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1"
+checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
[[package]]
name = "block-buffer"
-version = "0.11.0-pre.5"
+version = "0.11.0-rc.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ded684142010808eb980d9974ef794da2bcf97d13396143b1515e9f0fb4a10e"
+checksum = "a229bfd78e4827c91b9b95784f69492c1b77c1ab75a45a8a037b139215086f94"
dependencies = [
- "crypto-common",
+ "hybrid-array",
]
[[package]]
name = "blocking"
-version = "1.5.1"
+version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118"
+checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea"
dependencies = [
- "async-channel 2.2.0",
- "async-lock 3.3.0",
+ "async-channel 2.3.1",
"async-task",
- "fastrand 2.0.2",
"futures-io",
- "futures-lite 2.3.0",
+ "futures-lite",
"piper",
- "tracing",
]
[[package]]
name = "bumpalo"
-version = "3.15.4"
+version = "3.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa"
+checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf"
[[package]]
name = "bytes"
-version = "1.6.0"
+version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9"
+checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
[[package]]
name = "camino"
-version = "1.1.6"
+version = "1.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c"
+checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3"
dependencies = [
"serde",
]
[[package]]
name = "cargo-platform"
-version = "0.1.8"
+version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc"
+checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea"
dependencies = [
"serde",
]
@@ -444,16 +408,6 @@ dependencies = [
"thiserror",
]
-[[package]]
-name = "cc"
-version = "1.0.90"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5"
-dependencies = [
- "jobserver",
- "libc",
-]
-
[[package]]
name = "cfg-if"
version = "1.0.0"
@@ -462,9 +416,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "clap"
-version = "4.5.4"
+version = "4.5.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0"
+checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83"
dependencies = [
"clap_builder",
"clap_derive",
@@ -472,9 +426,9 @@ dependencies = [
[[package]]
name = "clap_builder"
-version = "4.5.2"
+version = "4.5.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4"
+checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8"
dependencies = [
"anstream",
"anstyle",
@@ -484,80 +438,108 @@ dependencies = [
[[package]]
name = "clap_derive"
-version = "4.5.4"
+version = "4.5.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64"
+checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7"
dependencies = [
"heck",
"proc-macro2",
"quote",
- "syn 2.0.55",
+ "syn 2.0.100",
]
[[package]]
name = "clap_lex"
-version = "0.7.0"
+version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce"
+checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
+
+[[package]]
+name = "cli"
+version = "0.3.0"
+dependencies = [
+ "cargo_metadata",
+ "clap",
+ "env_logger",
+ "log",
+ "packager_deb",
+ "regex",
+ "serde",
+ "tempfile",
+ "thiserror",
+ "toml",
+ "types",
+]
[[package]]
name = "colorchoice"
-version = "1.0.0"
+version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
+checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990"
[[package]]
name = "concurrent-queue"
-version = "2.4.0"
+version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363"
+checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
dependencies = [
"crossbeam-utils",
]
[[package]]
name = "const-oid"
-version = "0.10.0-pre.2"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7e3352a27098ba6b09546e5f13b15165e6a88b5c2723afecb3ea9576b27e3ea"
+checksum = "1cb3c4a0d3776f7535c32793be81d6d5fec0d48ac70955d9834e643aa249a52f"
[[package]]
name = "cpufeatures"
-version = "0.2.12"
+version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
+checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
dependencies = [
"libc",
]
[[package]]
name = "crossbeam-utils"
-version = "0.8.19"
+version = "0.8.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
+checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
[[package]]
name = "crunchy"
-version = "0.2.2"
+version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
+checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929"
[[package]]
name = "crypto-common"
-version = "0.2.0-pre.5"
+version = "0.2.0-rc.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7aa2ec04f5120b830272a481e8d9d8ba4dda140d2cda59b0f1110d5eb93c38e"
+checksum = "170d71b5b14dec99db7739f6fc7d6ec2db80b78c3acb77db48392ccc3d8a9ea0"
dependencies = [
- "getrandom",
"hybrid-array",
- "rand_core 0.6.4",
+]
+
+[[package]]
+name = "debian"
+version = "0.1.0"
+dependencies = [
+ "log",
+ "serde",
+ "shellexpand",
+ "tempfile",
+ "thiserror",
+ "toml",
+ "types",
]
[[package]]
name = "digest"
-version = "0.11.0-pre.8"
+version = "0.11.0-pre.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "065d93ead7c220b85d5b4be4795d8398eac4ff68b5ee63895de0a3c1fb6edf25"
+checksum = "6c478574b20020306f98d61c8ca3322d762e1ff08117422ac6106438605ea516"
dependencies = [
"block-buffer",
"const-oid",
@@ -606,26 +588,37 @@ dependencies = [
"winapi",
]
+[[package]]
+name = "displaydoc"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.100",
+]
+
[[package]]
name = "either"
-version = "1.10.0"
+version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a"
+checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719"
[[package]]
name = "ena"
-version = "0.14.2"
+version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1"
+checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5"
dependencies = [
"log",
]
[[package]]
name = "env_filter"
-version = "0.1.0"
+version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea"
+checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0"
dependencies = [
"log",
"regex",
@@ -633,31 +626,31 @@ dependencies = [
[[package]]
name = "env_logger"
-version = "0.11.3"
+version = "0.11.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9"
+checksum = "c3716d7a920fb4fac5d84e9d4bce8ceb321e9414b4409da61b07b75c1e3d0697"
dependencies = [
"anstream",
"anstyle",
"env_filter",
- "humantime",
+ "jiff",
"log",
]
[[package]]
name = "equivalent"
-version = "1.0.1"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
+checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
[[package]]
name = "errno"
-version = "0.3.8"
+version = "0.3.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245"
+checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
dependencies = [
"libc",
- "windows-sys 0.52.0",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -668,31 +661,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
[[package]]
name = "event-listener"
-version = "3.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2"
-dependencies = [
- "concurrent-queue",
- "parking",
- "pin-project-lite",
-]
-
-[[package]]
-name = "event-listener"
-version = "4.0.3"
+version = "5.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e"
-dependencies = [
- "concurrent-queue",
- "parking",
- "pin-project-lite",
-]
-
-[[package]]
-name = "event-listener"
-version = "5.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91"
+checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae"
dependencies = [
"concurrent-queue",
"parking",
@@ -701,59 +672,30 @@ dependencies = [
[[package]]
name = "event-listener-strategy"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3"
-dependencies = [
- "event-listener 4.0.3",
- "pin-project-lite",
-]
-
-[[package]]
-name = "event-listener-strategy"
-version = "0.5.0"
+version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291"
+checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2"
dependencies = [
- "event-listener 5.2.0",
+ "event-listener 5.4.0",
"pin-project-lite",
]
-[[package]]
-name = "eyre"
-version = "0.6.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec"
-dependencies = [
- "indenter",
- "once_cell",
-]
-
-[[package]]
-name = "fastrand"
-version = "1.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
-dependencies = [
- "instant",
-]
-
[[package]]
name = "fastrand"
-version = "2.0.2"
+version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984"
+checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
[[package]]
name = "filetime"
-version = "0.2.23"
+version = "0.2.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd"
+checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586"
dependencies = [
"cfg-if",
"libc",
- "redox_syscall",
- "windows-sys 0.52.0",
+ "libredox",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -779,47 +721,32 @@ dependencies = [
[[package]]
name = "futures-channel"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"
+checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
dependencies = [
"futures-core",
]
[[package]]
name = "futures-core"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
+checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
[[package]]
name = "futures-io"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
-
-[[package]]
-name = "futures-lite"
-version = "1.13.0"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce"
-dependencies = [
- "fastrand 1.9.0",
- "futures-core",
- "futures-io",
- "memchr",
- "parking",
- "pin-project-lite",
- "waker-fn",
-]
+checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
[[package]]
name = "futures-lite"
-version = "2.3.0"
+version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5"
+checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532"
dependencies = [
- "fastrand 2.0.2",
+ "fastrand",
"futures-core",
"futures-io",
"parking",
@@ -828,26 +755,26 @@ dependencies = [
[[package]]
name = "futures-macro"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
+checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.55",
+ "syn 2.0.100",
]
[[package]]
name = "futures-task"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
+checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
[[package]]
name = "futures-util"
-version = "0.3.30"
+version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
+checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
dependencies = [
"futures-core",
"futures-macro",
@@ -859,47 +786,38 @@ dependencies = [
[[package]]
name = "getrandom"
-version = "0.2.12"
+version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
+checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
dependencies = [
"cfg-if",
"libc",
- "wasi",
+ "wasi 0.11.0+wasi-snapshot-preview1",
]
[[package]]
-name = "gimli"
-version = "0.28.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
-
-[[package]]
-name = "git2"
-version = "0.18.3"
+name = "getrandom"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70"
+checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8"
dependencies = [
- "bitflags 2.5.0",
+ "cfg-if",
"libc",
- "libgit2-sys",
- "log",
- "openssl-probe",
- "openssl-sys",
- "url",
+ "wasi 0.13.3+wasi-0.2.2",
+ "windows-targets 0.52.6",
]
[[package]]
-name = "glob"
-version = "0.3.1"
+name = "gimli"
+version = "0.31.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
+checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
[[package]]
name = "gloo-timers"
-version = "0.2.6"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c"
+checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994"
dependencies = [
"futures-channel",
"futures-core",
@@ -909,9 +827,9 @@ dependencies = [
[[package]]
name = "hashbrown"
-version = "0.14.3"
+version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
+checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
[[package]]
name = "heck"
@@ -921,9 +839,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hermit-abi"
-version = "0.3.9"
+version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
+checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc"
[[package]]
name = "http"
@@ -949,9 +867,9 @@ dependencies = [
[[package]]
name = "httparse"
-version = "1.8.0"
+version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
+checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
[[package]]
name = "httpdate"
@@ -987,26 +905,20 @@ dependencies = [
"url",
]
-[[package]]
-name = "humantime"
-version = "2.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
-
[[package]]
name = "hybrid-array"
-version = "0.2.0-rc.8"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "53668f5da5a41d9eaf4bf7064be46d1ebe6a4e1ceed817f387587b18f2b51047"
+checksum = "4dab50e193aebe510fe0e40230145820e02f48dae0cf339ea4204e6e708ff7bd"
dependencies = [
"typenum",
]
[[package]]
name = "hyper"
-version = "0.14.28"
+version = "0.14.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80"
+checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7"
dependencies = [
"bytes",
"futures-channel",
@@ -1018,7 +930,7 @@ dependencies = [
"httpdate",
"itoa",
"pin-project-lite",
- "socket2 0.5.6",
+ "socket2",
"tokio",
"tower-service",
"tracing",
@@ -1026,51 +938,160 @@ dependencies = [
]
[[package]]
-name = "idna"
-version = "0.5.0"
+name = "icu_collections"
+version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6"
+checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526"
dependencies = [
- "unicode-bidi",
- "unicode-normalization",
+ "displaydoc",
+ "yoke",
+ "zerofrom",
+ "zerovec",
]
[[package]]
-name = "indenter"
-version = "0.3.3"
+name = "icu_locid"
+version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
+checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637"
+dependencies = [
+ "displaydoc",
+ "litemap",
+ "tinystr",
+ "writeable",
+ "zerovec",
+]
[[package]]
-name = "indexmap"
-version = "2.2.6"
+name = "icu_locid_transform"
+version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
+checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e"
dependencies = [
- "equivalent",
- "hashbrown",
+ "displaydoc",
+ "icu_locid",
+ "icu_locid_transform_data",
+ "icu_provider",
+ "tinystr",
+ "zerovec",
]
[[package]]
-name = "instant"
-version = "0.1.12"
+name = "icu_locid_transform_data"
+version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
+checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e"
+
+[[package]]
+name = "icu_normalizer"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f"
dependencies = [
- "cfg-if",
+ "displaydoc",
+ "icu_collections",
+ "icu_normalizer_data",
+ "icu_properties",
+ "icu_provider",
+ "smallvec",
+ "utf16_iter",
+ "utf8_iter",
+ "write16",
+ "zerovec",
]
[[package]]
-name = "io-lifetimes"
-version = "1.0.11"
+name = "icu_normalizer_data"
+version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2"
+checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516"
+
+[[package]]
+name = "icu_properties"
+version = "1.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5"
dependencies = [
- "hermit-abi",
- "libc",
- "windows-sys 0.48.0",
+ "displaydoc",
+ "icu_collections",
+ "icu_locid_transform",
+ "icu_properties_data",
+ "icu_provider",
+ "tinystr",
+ "zerovec",
]
+[[package]]
+name = "icu_properties_data"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569"
+
+[[package]]
+name = "icu_provider"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9"
+dependencies = [
+ "displaydoc",
+ "icu_locid",
+ "icu_provider_macros",
+ "stable_deref_trait",
+ "tinystr",
+ "writeable",
+ "yoke",
+ "zerofrom",
+ "zerovec",
+]
+
+[[package]]
+name = "icu_provider_macros"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.100",
+]
+
+[[package]]
+name = "idna"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e"
+dependencies = [
+ "idna_adapter",
+ "smallvec",
+ "utf8_iter",
+]
+
+[[package]]
+name = "idna_adapter"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71"
+dependencies = [
+ "icu_normalizer",
+ "icu_properties",
+]
+
+[[package]]
+name = "indexmap"
+version = "2.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058"
+dependencies = [
+ "equivalent",
+ "hashbrown",
+]
+
+[[package]]
+name = "is_terminal_polyfill"
+version = "1.70.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf"
+
[[package]]
name = "itertools"
version = "0.11.0"
@@ -1082,25 +1103,41 @@ dependencies = [
[[package]]
name = "itoa"
-version = "1.0.11"
+version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
+checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
[[package]]
-name = "jobserver"
-version = "0.1.28"
+name = "jiff"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6"
+checksum = "d699bc6dfc879fb1bf9bdff0d4c56f0884fc6f0d0eb0fba397a6d00cd9a6b85e"
dependencies = [
- "libc",
+ "jiff-static",
+ "log",
+ "portable-atomic",
+ "portable-atomic-util",
+ "serde",
+]
+
+[[package]]
+name = "jiff-static"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d16e75759ee0aa64c57a56acbf43916987b20c77373cb7e808979e02b93c9f9"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.100",
]
[[package]]
name = "js-sys"
-version = "0.3.69"
+version = "0.3.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d"
+checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f"
dependencies = [
+ "once_cell",
"wasm-bindgen",
]
@@ -1146,9 +1183,9 @@ dependencies = [
[[package]]
name = "lazy_static"
-version = "1.4.0"
+version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
+checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
[[package]]
name = "levenshtein"
@@ -1158,78 +1195,44 @@ checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760"
[[package]]
name = "libc"
-version = "0.2.153"
+version = "0.2.171"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
-
-[[package]]
-name = "libgit2-sys"
-version = "0.16.2+1.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8"
-dependencies = [
- "cc",
- "libc",
- "libssh2-sys",
- "libz-sys",
- "openssl-sys",
- "pkg-config",
-]
+checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6"
[[package]]
name = "libredox"
-version = "0.0.1"
+version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8"
+checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags",
"libc",
"redox_syscall",
]
[[package]]
-name = "libssh2-sys"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee"
-dependencies = [
- "cc",
- "libc",
- "libz-sys",
- "openssl-sys",
- "pkg-config",
- "vcpkg",
-]
-
-[[package]]
-name = "libz-sys"
-version = "1.1.16"
+name = "linux-raw-sys"
+version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9"
-dependencies = [
- "cc",
- "libc",
- "pkg-config",
- "vcpkg",
-]
+checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
[[package]]
name = "linux-raw-sys"
-version = "0.3.8"
+version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
+checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9"
[[package]]
-name = "linux-raw-sys"
-version = "0.4.13"
+name = "litemap"
+version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c"
+checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856"
[[package]]
name = "lock_api"
-version = "0.4.11"
+version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45"
+checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
dependencies = [
"autocfg",
"scopeguard",
@@ -1237,37 +1240,37 @@ dependencies = [
[[package]]
name = "log"
-version = "0.4.21"
+version = "0.4.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
+checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e"
dependencies = [
"value-bag",
]
[[package]]
name = "memchr"
-version = "2.7.1"
+version = "2.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
+checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = "miniz_oxide"
-version = "0.7.2"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7"
+checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5"
dependencies = [
- "adler",
+ "adler2",
]
[[package]]
name = "mio"
-version = "0.8.11"
+version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c"
+checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd"
dependencies = [
"libc",
- "wasi",
- "windows-sys 0.48.0",
+ "wasi 0.11.0+wasi-snapshot-preview1",
+ "windows-sys 0.52.0",
]
[[package]]
@@ -1276,66 +1279,60 @@ version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
-[[package]]
-name = "num_cpus"
-version = "1.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
-dependencies = [
- "hermit-abi",
- "libc",
-]
-
[[package]]
name = "object"
-version = "0.32.2"
+version = "0.36.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
+checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
dependencies = [
"memchr",
]
[[package]]
name = "once_cell"
-version = "1.19.0"
+version = "1.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
+checksum = "cde51589ab56b20a6f686b2c68f7a0bd6add753d697abf720d63f8db3ab7b1ad"
[[package]]
-name = "openssl-probe"
-version = "0.1.5"
+name = "option-ext"
+version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
+checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
[[package]]
-name = "openssl-sys"
-version = "0.9.101"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff"
+name = "packager_deb"
+version = "0.1.0"
dependencies = [
- "cc",
- "libc",
- "pkg-config",
- "vcpkg",
+ "cargo_metadata",
+ "debian",
+ "dirs",
+ "env_logger",
+ "filetime",
+ "httpmock",
+ "log",
+ "rand",
+ "serde",
+ "sha1",
+ "sha2",
+ "shellexpand",
+ "tempfile",
+ "thiserror",
+ "toml",
+ "types",
]
-[[package]]
-name = "option-ext"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
-
[[package]]
name = "parking"
-version = "2.2.0"
+version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae"
+checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
[[package]]
name = "parking_lot"
-version = "0.12.1"
+version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
+checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
dependencies = [
"lock_api",
"parking_lot_core",
@@ -1343,15 +1340,15 @@ dependencies = [
[[package]]
name = "parking_lot_core"
-version = "0.9.9"
+version = "0.9.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e"
+checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
"smallvec",
- "windows-targets 0.48.5",
+ "windows-targets 0.52.6",
]
[[package]]
@@ -1362,9 +1359,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
[[package]]
name = "petgraph"
-version = "0.6.4"
+version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9"
+checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db"
dependencies = [
"fixedbitset",
"indexmap",
@@ -1372,9 +1369,9 @@ dependencies = [
[[package]]
name = "phf_shared"
-version = "0.10.0"
+version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
+checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"
dependencies = [
"siphasher",
]
@@ -1387,9 +1384,9 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315"
[[package]]
name = "pin-project-lite"
-version = "0.2.13"
+version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
+checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
[[package]]
name = "pin-utils"
@@ -1399,84 +1396,63 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "piper"
-version = "0.2.1"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4"
+checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066"
dependencies = [
"atomic-waker",
- "fastrand 2.0.2",
+ "fastrand",
"futures-io",
]
[[package]]
name = "pkg-builder"
-version = "0.2.11"
+version = "0.3.0"
dependencies = [
- "cargo_metadata",
- "clap",
- "dirs",
- "env_logger",
- "eyre",
- "filetime",
- "git2",
- "glob",
- "httpmock",
- "log",
- "rand",
- "regex",
+ "cli",
"serde",
- "sha1",
- "sha2",
- "shellexpand",
- "tempfile",
- "test-case",
"thiserror",
"toml",
- "whoami",
]
-[[package]]
-name = "pkg-config"
-version = "0.3.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec"
-
[[package]]
name = "polling"
-version = "2.8.0"
+version = "3.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce"
+checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f"
dependencies = [
- "autocfg",
- "bitflags 1.3.2",
"cfg-if",
"concurrent-queue",
- "libc",
- "log",
+ "hermit-abi",
"pin-project-lite",
- "windows-sys 0.48.0",
+ "rustix 0.38.44",
+ "tracing",
+ "windows-sys 0.59.0",
]
[[package]]
-name = "polling"
-version = "3.6.0"
+name = "portable-atomic"
+version = "1.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e"
+
+[[package]]
+name = "portable-atomic-util"
+version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6"
+checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507"
dependencies = [
- "cfg-if",
- "concurrent-queue",
- "hermit-abi",
- "pin-project-lite",
- "rustix 0.38.32",
- "tracing",
- "windows-sys 0.52.0",
+ "portable-atomic",
]
[[package]]
name = "ppv-lite86"
-version = "0.2.17"
+version = "0.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
+checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
+dependencies = [
+ "zerocopy",
+]
[[package]]
name = "precomputed-hash"
@@ -1486,87 +1462,77 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
[[package]]
name = "proc-macro2"
-version = "1.0.79"
+version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
+checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
-version = "1.0.35"
+version = "1.0.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
+checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801"
dependencies = [
"proc-macro2",
]
[[package]]
name = "rand"
-version = "0.9.0-alpha.1"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d31e63ea85be51c423e52ba8f2e68a3efd53eed30203ee029dd09947333693e"
+checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94"
dependencies = [
"rand_chacha",
- "rand_core 0.9.0-alpha.1",
+ "rand_core",
"zerocopy",
]
[[package]]
name = "rand_chacha"
-version = "0.9.0-alpha.1"
+version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78674ef918c19451dbd250f8201f8619b494f64c9aa6f3adb28fd8a0f1f6da46"
+checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
dependencies = [
"ppv-lite86",
- "rand_core 0.9.0-alpha.1",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
-dependencies = [
- "getrandom",
+ "rand_core",
]
[[package]]
name = "rand_core"
-version = "0.9.0-alpha.1"
+version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc89dffba8377c5ec847d12bb41492bda235dba31a25e8b695cd0fe6589eb8c9"
+checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
dependencies = [
- "getrandom",
- "zerocopy",
+ "getrandom 0.3.1",
]
[[package]]
name = "redox_syscall"
-version = "0.4.1"
+version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
+checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1"
dependencies = [
- "bitflags 1.3.2",
+ "bitflags",
]
[[package]]
name = "redox_users"
-version = "0.4.4"
+version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4"
+checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"
dependencies = [
- "getrandom",
+ "getrandom 0.2.15",
"libredox",
"thiserror",
]
[[package]]
name = "regex"
-version = "1.10.4"
+version = "1.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c"
+checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
dependencies = [
"aho-corasick",
"memchr",
@@ -1576,9 +1542,9 @@ dependencies = [
[[package]]
name = "regex-automata"
-version = "0.4.6"
+version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea"
+checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
dependencies = [
"aho-corasick",
"memchr",
@@ -1587,54 +1553,53 @@ dependencies = [
[[package]]
name = "regex-syntax"
-version = "0.8.3"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56"
+checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]]
name = "rustc-demangle"
-version = "0.1.23"
+version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
+checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
[[package]]
name = "rustix"
-version = "0.37.27"
+version = "0.38.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2"
+checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154"
dependencies = [
- "bitflags 1.3.2",
+ "bitflags",
"errno",
- "io-lifetimes",
"libc",
- "linux-raw-sys 0.3.8",
- "windows-sys 0.48.0",
+ "linux-raw-sys 0.4.15",
+ "windows-sys 0.59.0",
]
[[package]]
name = "rustix"
-version = "0.38.32"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89"
+checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825"
dependencies = [
- "bitflags 2.5.0",
+ "bitflags",
"errno",
"libc",
- "linux-raw-sys 0.4.13",
- "windows-sys 0.52.0",
+ "linux-raw-sys 0.9.2",
+ "windows-sys 0.59.0",
]
[[package]]
name = "rustversion"
-version = "1.0.14"
+version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
+checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2"
[[package]]
name = "ryu"
-version = "1.0.17"
+version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1"
+checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
[[package]]
name = "same-file"
@@ -1653,40 +1618,41 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "semver"
-version = "1.0.22"
+version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca"
+checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0"
dependencies = [
"serde",
]
[[package]]
name = "serde"
-version = "1.0.209"
+version = "1.0.219"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09"
+checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.209"
+version = "1.0.219"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170"
+checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.55",
+ "syn 2.0.100",
]
[[package]]
name = "serde_json"
-version = "1.0.115"
+version = "1.0.140"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd"
+checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
dependencies = [
"itoa",
+ "memchr",
"ryu",
"serde",
]
@@ -1703,18 +1669,18 @@ dependencies = [
[[package]]
name = "serde_spanned"
-version = "0.6.7"
+version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d"
+checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1"
dependencies = [
"serde",
]
[[package]]
name = "sha1"
-version = "0.11.0-pre.3"
+version = "0.11.0-pre.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3885de8cb916f223718c1ccd47a840b91f806333e76002dc5cb3862154b4fed3"
+checksum = "55f44e40722caefdd99383c25d3ae52a1094a1951215ae76f68837ece4e7f566"
dependencies = [
"cfg-if",
"cpufeatures",
@@ -1723,9 +1689,9 @@ dependencies = [
[[package]]
name = "sha2"
-version = "0.11.0-pre.3"
+version = "0.11.0-pre.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f33549bf3064b62478926aa89cbfc7c109aab66ae8f0d5d2ef839e482cc30d6"
+checksum = "19b4241d1a56954dce82cecda5c8e9c794eef6f53abe5e5216bac0a0ea71ffa7"
dependencies = [
"cfg-if",
"cpufeatures",
@@ -1743,24 +1709,24 @@ dependencies = [
[[package]]
name = "signal-hook-registry"
-version = "1.4.1"
+version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1"
+checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1"
dependencies = [
"libc",
]
[[package]]
name = "similar"
-version = "2.4.0"
+version = "2.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21"
+checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa"
[[package]]
name = "siphasher"
-version = "0.3.11"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d"
+checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
[[package]]
name = "slab"
@@ -1773,38 +1739,33 @@ dependencies = [
[[package]]
name = "smallvec"
-version = "1.13.2"
+version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
+checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd"
[[package]]
name = "socket2"
-version = "0.4.10"
+version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d"
+checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8"
dependencies = [
"libc",
- "winapi",
+ "windows-sys 0.52.0",
]
[[package]]
-name = "socket2"
-version = "0.5.6"
+name = "stable_deref_trait"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871"
-dependencies = [
- "libc",
- "windows-sys 0.52.0",
-]
+checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
[[package]]
name = "string_cache"
-version = "0.8.7"
+version = "0.8.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b"
+checksum = "938d512196766101d333398efde81bc1f37b00cb42c2f8350e5df639f040bbbe"
dependencies = [
"new_debug_unreachable",
- "once_cell",
"parking_lot",
"phf_shared",
"precomputed-hash",
@@ -1829,25 +1790,38 @@ dependencies = [
[[package]]
name = "syn"
-version = "2.0.55"
+version = "2.0.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0"
+checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
+[[package]]
+name = "synstructure"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.100",
+]
+
[[package]]
name = "tempfile"
-version = "3.10.1"
+version = "3.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1"
+checksum = "2c317e0a526ee6120d8dabad239c8dadca62b24b6f168914bbbc8e2fb1f0e567"
dependencies = [
"cfg-if",
- "fastrand 2.0.2",
- "rustix 0.38.32",
- "windows-sys 0.52.0",
+ "fastrand",
+ "getrandom 0.3.1",
+ "once_cell",
+ "rustix 1.0.2",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -1861,57 +1835,24 @@ dependencies = [
"winapi",
]
-[[package]]
-name = "test-case"
-version = "3.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eb2550dd13afcd286853192af8601920d959b14c401fcece38071d53bf0768a8"
-dependencies = [
- "test-case-macros",
-]
-
-[[package]]
-name = "test-case-core"
-version = "3.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "adcb7fd841cd518e279be3d5a3eb0636409487998a4aff22f3de87b81e88384f"
-dependencies = [
- "cfg-if",
- "proc-macro2",
- "quote",
- "syn 2.0.55",
-]
-
-[[package]]
-name = "test-case-macros"
-version = "3.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.55",
- "test-case-core",
-]
-
[[package]]
name = "thiserror"
-version = "1.0.63"
+version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
+checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.63"
+version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
+checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.55",
+ "syn 2.0.100",
]
[[package]]
@@ -1924,53 +1865,47 @@ dependencies = [
]
[[package]]
-name = "tinyvec"
-version = "1.6.0"
+name = "tinystr"
+version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
+checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f"
dependencies = [
- "tinyvec_macros",
+ "displaydoc",
+ "zerovec",
]
-[[package]]
-name = "tinyvec_macros"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
-
[[package]]
name = "tokio"
-version = "1.36.0"
+version = "1.44.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931"
+checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a"
dependencies = [
"backtrace",
"libc",
"mio",
- "num_cpus",
"pin-project-lite",
"signal-hook-registry",
- "socket2 0.5.6",
+ "socket2",
"tokio-macros",
- "windows-sys 0.48.0",
+ "windows-sys 0.52.0",
]
[[package]]
name = "tokio-macros"
-version = "2.2.0"
+version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
+checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.55",
+ "syn 2.0.100",
]
[[package]]
name = "toml"
-version = "0.8.19"
+version = "0.8.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e"
+checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148"
dependencies = [
"serde",
"serde_spanned",
@@ -1989,9 +1924,9 @@ dependencies = [
[[package]]
name = "toml_edit"
-version = "0.22.20"
+version = "0.22.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d"
+checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474"
dependencies = [
"indexmap",
"serde",
@@ -2002,15 +1937,15 @@ dependencies = [
[[package]]
name = "tower-service"
-version = "0.3.2"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
+checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
[[package]]
name = "tracing"
-version = "0.1.40"
+version = "0.1.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
+checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
dependencies = [
"pin-project-lite",
"tracing-core",
@@ -2018,9 +1953,9 @@ dependencies = [
[[package]]
name = "tracing-core"
-version = "0.1.32"
+version = "0.1.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
+checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c"
dependencies = [
"once_cell",
]
@@ -2033,42 +1968,40 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]]
name = "typenum"
-version = "1.17.0"
+version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
+checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
[[package]]
-name = "unicode-bidi"
-version = "0.3.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75"
+name = "types"
+version = "0.1.0"
+dependencies = [
+ "log",
+ "semver",
+ "serde",
+ "tempfile",
+ "thiserror",
+ "toml",
+ "url",
+]
[[package]]
name = "unicode-ident"
-version = "1.0.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
-
-[[package]]
-name = "unicode-normalization"
-version = "0.1.23"
+version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5"
-dependencies = [
- "tinyvec",
-]
+checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
[[package]]
name = "unicode-xid"
-version = "0.2.4"
+version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c"
+checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
[[package]]
name = "url"
-version = "2.5.0"
+version = "2.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633"
+checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60"
dependencies = [
"form_urlencoded",
"idna",
@@ -2076,28 +2009,28 @@ dependencies = [
]
[[package]]
-name = "utf8parse"
-version = "0.2.1"
+name = "utf16_iter"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
+checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246"
[[package]]
-name = "value-bag"
-version = "1.8.1"
+name = "utf8_iter"
+version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74797339c3b98616c009c7c3eb53a0ce41e85c8ec66bd3db96ed132d20cfdee8"
+checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
[[package]]
-name = "vcpkg"
-version = "0.2.15"
+name = "utf8parse"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
+checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
-name = "waker-fn"
-version = "1.1.1"
+name = "value-bag"
+version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690"
+checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2"
[[package]]
name = "walkdir"
@@ -2125,53 +2058,58 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
-name = "wasite"
-version = "0.1.0"
+name = "wasi"
+version = "0.13.3+wasi-0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b"
+checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2"
+dependencies = [
+ "wit-bindgen-rt",
+]
[[package]]
name = "wasm-bindgen"
-version = "0.2.92"
+version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8"
+checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5"
dependencies = [
"cfg-if",
+ "once_cell",
+ "rustversion",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.92"
+version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da"
+checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6"
dependencies = [
"bumpalo",
"log",
- "once_cell",
"proc-macro2",
"quote",
- "syn 2.0.55",
+ "syn 2.0.100",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-futures"
-version = "0.4.42"
+version = "0.4.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0"
+checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61"
dependencies = [
"cfg-if",
"js-sys",
+ "once_cell",
"wasm-bindgen",
"web-sys",
]
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.92"
+version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726"
+checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -2179,44 +2117,36 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.92"
+version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7"
+checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.55",
+ "syn 2.0.100",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.92"
+version = "0.2.100"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96"
+checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d"
+dependencies = [
+ "unicode-ident",
+]
[[package]]
name = "web-sys"
-version = "0.3.69"
+version = "0.3.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef"
+checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2"
dependencies = [
"js-sys",
"wasm-bindgen",
]
-[[package]]
-name = "whoami"
-version = "1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9"
-dependencies = [
- "redox_syscall",
- "wasite",
- "web-sys",
-]
-
[[package]]
name = "winapi"
version = "0.3.9"
@@ -2235,11 +2165,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
-version = "0.1.6"
+version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596"
+checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [
- "winapi",
+ "windows-sys 0.59.0",
]
[[package]]
@@ -2263,7 +2193,16 @@ version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
- "windows-targets 0.52.4",
+ "windows-targets 0.52.6",
+]
+
+[[package]]
+name = "windows-sys"
+version = "0.59.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
+dependencies = [
+ "windows-targets 0.52.6",
]
[[package]]
@@ -2283,17 +2222,18 @@ dependencies = [
[[package]]
name = "windows-targets"
-version = "0.52.4"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b"
+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
- "windows_aarch64_gnullvm 0.52.4",
- "windows_aarch64_msvc 0.52.4",
- "windows_i686_gnu 0.52.4",
- "windows_i686_msvc 0.52.4",
- "windows_x86_64_gnu 0.52.4",
- "windows_x86_64_gnullvm 0.52.4",
- "windows_x86_64_msvc 0.52.4",
+ "windows_aarch64_gnullvm 0.52.6",
+ "windows_aarch64_msvc 0.52.6",
+ "windows_i686_gnu 0.52.6",
+ "windows_i686_gnullvm",
+ "windows_i686_msvc 0.52.6",
+ "windows_x86_64_gnu 0.52.6",
+ "windows_x86_64_gnullvm 0.52.6",
+ "windows_x86_64_msvc 0.52.6",
]
[[package]]
@@ -2304,9 +2244,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]]
name = "windows_aarch64_gnullvm"
-version = "0.52.4"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9"
+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
@@ -2316,9 +2256,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]]
name = "windows_aarch64_msvc"
-version = "0.52.4"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675"
+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
@@ -2328,9 +2268,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]]
name = "windows_i686_gnu"
-version = "0.52.4"
+version = "0.52.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
+
+[[package]]
+name = "windows_i686_gnullvm"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3"
+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
@@ -2340,9 +2286,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]]
name = "windows_i686_msvc"
-version = "0.52.4"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02"
+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
@@ -2352,9 +2298,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]]
name = "windows_x86_64_gnu"
-version = "0.52.4"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03"
+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
@@ -2364,9 +2310,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]]
name = "windows_x86_64_gnullvm"
-version = "0.52.4"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177"
+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
@@ -2376,35 +2322,123 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "windows_x86_64_msvc"
-version = "0.52.4"
+version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winnow"
-version = "0.6.18"
+version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f"
+checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1"
dependencies = [
"memchr",
]
+[[package]]
+name = "wit-bindgen-rt"
+version = "0.33.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c"
+dependencies = [
+ "bitflags",
+]
+
+[[package]]
+name = "write16"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936"
+
+[[package]]
+name = "writeable"
+version = "0.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51"
+
+[[package]]
+name = "yoke"
+version = "0.7.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40"
+dependencies = [
+ "serde",
+ "stable_deref_trait",
+ "yoke-derive",
+ "zerofrom",
+]
+
+[[package]]
+name = "yoke-derive"
+version = "0.7.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.100",
+ "synstructure",
+]
+
[[package]]
name = "zerocopy"
-version = "0.8.0-alpha.6"
+version = "0.8.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db678a6ee512bd06adf35c35be471cae2f9c82a5aed2b5d15e03628c98bddd57"
+checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6"
dependencies = [
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
-version = "0.8.0-alpha.6"
+version = "0.8.23"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.100",
+]
+
+[[package]]
+name = "zerofrom"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5"
+dependencies = [
+ "zerofrom-derive",
+]
+
+[[package]]
+name = "zerofrom-derive"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.100",
+ "synstructure",
+]
+
+[[package]]
+name = "zerovec"
+version = "0.10.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079"
+dependencies = [
+ "yoke",
+ "zerofrom",
+ "zerovec-derive",
+]
+
+[[package]]
+name = "zerovec-derive"
+version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "201585ea96d37ee69f2ac769925ca57160cef31acb137c16f38b02b76f4c1e62"
+checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6"
dependencies = [
"proc-macro2",
"quote",
- "syn 2.0.55",
+ "syn 2.0.100",
]
diff --git a/Cargo.toml b/Cargo.toml
index 70dca258..fca3066d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,39 +1,44 @@
-[package]
-name = "pkg-builder"
-version = "0.2.11"
-edition = "2021"
-build = "src/build.rs"
-[build-dependencies]
-eyre = "0.6.12"
-thiserror = "1.0.63"
-serde = { version = "1.0.209", features = ["derive"] }
-toml = "0.8.19"
+[workspace]
+members = [
+ "workspace/packager_deb",
+ "workspace/cli",
+ "workspace/types",
+ "workspace/debian",
+ "workspace/pkg_builder",
+]
+resolver = "2"
+
+[workspace.package]
+edition = "2021"
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-[dependencies]
+[workspace.dependencies]
clap = { version = "4.5.4", features = ["derive"] }
toml = "0.8.12"
serde = { version = "1.0", features = ["derive"] }
+env_logger = "0.11.3"
+log = "0.4"
+cargo_metadata = "0.18"
+regex = "1.10.4"
thiserror = "1.0"
+shellexpand = "3.1.0"
tempfile = "3.1"
-log = "0.4"
-env_logger = "0.11.3"
git2 = "0.18.3"
-cargo_metadata = "0.18"
test-case = "3.3.1"
glob = "0.3.1"
dirs = "5.0.1"
rand = "0.9.0-alpha.1"
-shellexpand = "3.1.0"
-eyre = "0.6.12"
sha2 = "0.11.0-pre.3"
whoami = "1.5.1"
sha1 = "0.11.0-pre.3"
filetime = "0.2.23"
-regex = "1.10.4"
-
-[dev-dependencies]
-env_logger = "*"
httpmock = "0.7.0"
+semver = "1.0.20" # Replace with the version you need
+url = "2.4.1" # Use the latest version
+
+# Local crates
+cli = {path = "workspace/cli"}
+debian = {path = "workspace/debian"}
+packager_deb = {path = "workspace/packager_deb"}
+types = {path = "workspace/types"}
diff --git a/EXAMPLES.md b/EXAMPLES.md
new file mode 100644
index 00000000..49ad6801
--- /dev/null
+++ b/EXAMPLES.md
@@ -0,0 +1,72 @@
+# Examples
+
+This document contains example usage for different package types. All examples assume you have already built and installed pkg-builder:
+
+```bash
+cargo build && cargo install --path .
+```
+
+## Virtual Package
+
+```bash
+pkg-builder env create examples/bookworm/virtual-package/pkg-builder.toml
+pkg-builder package examples/bookworm/virtual-package/pkg-builder.toml
+```
+
+## Rust Package
+
+```bash
+pkg-builder env create examples/bookworm/rust/hello-world/pkg-builder.toml
+pkg-builder package examples/bookworm/rust/hello-world/pkg-builder.toml
+```
+
+## TypeScript Package
+
+```bash
+pkg-builder env create examples/bookworm/typescript/hello-world/pkg-builder.toml
+pkg-builder package examples/bookworm/typescript/hello-world/pkg-builder.toml
+```
+
+## JavaScript Package
+
+```bash
+pkg-builder env create examples/bookworm/javascript/hello-world/pkg-builder.toml
+pkg-builder package examples/bookworm/javascript/hello-world/pkg-builder.toml
+```
+
+## Nim Package
+
+```bash
+pkg-builder env create examples/bookworm/nim/hello-world/pkg-builder.toml
+pkg-builder package examples/bookworm/nim/hello-world/pkg-builder.toml
+```
+
+## .NET Package
+
+```bash
+pkg-builder env create examples/bookworm/dotnet/hello-world/pkg-builder.toml
+pkg-builder package examples/bookworm/dotnet/hello-world/pkg-builder.toml
+```
+
+## Java Package
+
+```bash
+pkg-builder env create examples/bookworm/java/hello-world/pkg-builder.toml
+pkg-builder package examples/bookworm/java/hello-world/pkg-builder.toml
+```
+
+## Testing Examples
+
+After building a package, you can run specific tests:
+
+### Piuparts Only
+
+```bash
+pkg-builder piuparts examples/bookworm/virtual-package/pkg-builder.toml
+```
+
+### Autopkgtest Only
+
+```bash
+pkg-builder autopkgtests examples/bookworm/virtual-package/pkg-builder.toml
+```
\ No newline at end of file
diff --git a/INSTALL.md b/INSTALL.md
new file mode 100644
index 00000000..5032d24f
--- /dev/null
+++ b/INSTALL.md
@@ -0,0 +1,42 @@
+# Installation Guide
+
+## Debian Prerequisites
+
+```bash
+sudo apt install libssl-dev pkg-config quilt debhelper tar wget autopkgtest vmdb2 qemu-system-x86 git-lfs uidmap
+sudo sbuild-adduser `whoami`
+```
+
+## Installing sbuild
+
+```bash
+# Clone repository
+git clone https://github.com/eth-pkg/sbuild.git
+cd sbuild
+
+# Install dependencies
+sudo apt-get install -y dh-python dh-sequence-python3 libyaml-tiny-perl python3-all genisoimage
+
+# Build the package
+dpkg-buildpackage -us -uc
+
+# Install the newly built package
+cd .. && sudo dpkg -i sbuild_0.85.6_all.deb libsbuild-perl_0.85.6_all.deb
+```
+
+## Setting up chroot
+
+```bash
+# Create chroot directory if it doesn't exist
+sudo mkdir /srv/chroot
+sudo chown :sbuild /srv/chroot
+
+# For noble builds
+sudo ln -s /usr/share/debootstrap/scripts/gutsy /usr/share/debootstrap/scripts/noble
+```
+
+## Ubuntu-specific Setup
+
+If building for Ubuntu on Bookworm, manually download the ubuntu-archive-keyring:
+1. Get the keyring from [ubuntu-archive-keyring](https://salsa.debian.org/debian/ubuntu-keyring/-/raw/master/keyrings/ubuntu-archive-keyring.gpg?ref_type=heads)
+2. Copy it into `/usr/share/keyrings`
\ No newline at end of file
diff --git a/Readme.md b/Readme.md
index de10ee39..757de803 100644
--- a/Readme.md
+++ b/Readme.md
@@ -1,161 +1,58 @@
# pkg-builder
-pkg-builder simplifies the process of creating packages for Linux distributions. It automates the packaging process based on a configuration file, leveraging debcrafter, a framework for building Debian packages. By specifying package metadata, dependencies, and other configuration details in a structured format, developers can easily generate packages ready for Linux distributions. Pkg-builder abstracts away much of the complexity involved in packaging, allowing developers to focus on their software rather than packaging intricacies.
+[](https://github.com/eth-pkg/pkg-builder/actions/workflows/tests.yml)
-## Table of Contents
+A tool that simplifies building packages for Linux distributions by automating the packaging process using a configuration file approach.
-1. [Prerequisites](#prerequisites)
-2. [Getting Started](#getting-started)
- - [Example Virtual Package](#example-virtual-package)
- - [Example Rust Package](#example-rust-package)
- - [Example TypeScript Package](#example-typescript-package)
- - [Example JavaScript Package](#example-javascript-package)
- - [Example Nim Package](#example-nim-package)
- - [Example .NET Package](#example-net-package)
- - [Example Java Package](#example-java-package)
-3. [Piuparts Only](#piuparts-only)
-4. [Autopkgtest Only](#autopkgtest-only)
+## Overview
-## Prerequisites
+pkg-builder leverages debcrafter to generate Debian packages from a structured configuration file. This abstraction allows developers to focus on their software rather than packaging complexities.
-If you are using Debian, install sbuild, and various dependencies:
+## Quick Start
+### Prerequisites
+
+For Debian systems:
```bash
sudo apt install libssl-dev pkg-config quilt debhelper tar wget autopkgtest vmdb2 qemu-system-x86 git-lfs uidmap
sudo sbuild-adduser `whoami`
-
-# Install sbuild
-git clone https://github.com/eth-pkg/sbuild.git
-cd sbuild
-# Install dependencies
-sudo apt-get install -y dh-python dh-sequence-python3 libyaml-tiny-perl python3-all
-sudo apt-get install -y genisoimage
-# Build the package
-dpkg-buildpackage -us -uc
-# Install the newly built package
-cd .. && sudo dpkg -i sbuild_0.85.6_all.deb libsbuild-perl_0.85.6_all.deb
-
-# if chroot not exists create it
-sudo mkdir /srv/chroot
-sudo chown :sbuild /srv/chroot
-
-# for noble builds
-sudo ln -s /usr/share/debootstrap/scripts/gutsy /usr/share/debootstrap/scripts/noble
-```
-
-If you are building for Ubuntu on Bookworm, you need to manually download the ubuntu-archive-keyring:
-[ubuntu-archive-keyring](https://salsa.debian.org/debian/ubuntu-keyring/-/raw/master/keyrings/ubuntu-archive-keyring.gpg?ref_type=heads)
-and copy it into `/usr/share/keyrings`.
-
-## Getting Started
-
-### Example Virtual Package
-
-Click to expand
-
-```bash
-cargo build && cargo install --path .
-pkg-builder env create examples/bookworm/virtual-package/pkg-builder.toml
-pkg-builder package examples/bookworm/virtual-package/pkg-builder.toml
-```
-
-This will build the package using the provided configuration file.
-
-
-### Example Rust Package
-
-Click to expand
-
-```bash
-cargo build && cargo install --path .
-pkg-builder env create examples/bookworm/rust/hello-world/pkg-builder.toml
-pkg-builder package examples/bookworm/rust/hello-world/pkg-builder.toml
-```
-
-
-### Example TypeScript Package
-
-Click to expand
-
-```bash
-cargo build && cargo install --path .
-pkg-builder env create examples/bookworm/typescript/hello-world/pkg-builder.toml
-pkg-builder package examples/bookworm/typescript/hello-world/pkg-builder.toml
-```
-
-
-### Example JavaScript Package
-
-Click to expand
-
-```bash
-cargo build && cargo install --path .
-pkg-builder env create examples/bookworm/javascript/hello-world/pkg-builder.toml
-pkg-builder package examples/bookworm/javascript/hello-world/pkg-builder.toml
```
-
-### Example Nim Package
-
-Click to expand
+For sbuild installation and setup, see [installation docs](INSTALL.md).
-```bash
-cargo build && cargo install --path .
-pkg-builder env create examples/bookworm/nim/hello-world/pkg-builder.toml
-pkg-builder package examples/bookworm/nim/hello-world/pkg-builder.toml
-```
-
-
-### Example .NET Package
-
-Click to expand
+### Basic Usage
```bash
-cargo build && cargo install --path .
-pkg-builder env create examples/bookworm/dotnet/hello-world/pkg-builder.toml
-pkg-builder package examples/bookworm/dotnet/hello-world/pkg-builder.toml
-```
-
+# Install pkg-builder
+cargo install --path .
-### Example Java Package
-
-Click to expand
-
-```bash
-cargo build && cargo install --path .
-pkg-builder env create examples/bookworm/java/hello-world/pkg-builder.toml
-pkg-builder package examples/bookworm/java/hello-world/pkg-builder.toml
+# Create environment and build package
+pkg-builder env create path/to/pkg-builder.toml
+pkg-builder package path/to/pkg-builder.toml
```
-
-## Piuparts Only
-
-Assuming that you already packaged your source before as such:
+### Testing
```bash
-cargo build && cargo install --path .
-pkg-builder env create examples/bookworm/virtual-package/pkg-builder.toml
-pkg-builder package examples/bookworm/virtual-package/pkg-builder.toml
-```
-
-you can run only piuparts:
+# Run piuparts tests only
+pkg-builder piuparts path/to/pkg-builder.toml
-```bash
-pkg-builder piuparts examples/bookworm/virtual-package/pkg-builder.toml
+# Run autopkgtests only
+pkg-builder autopkgtests path/to/pkg-builder.toml
```
-## Autopkgtest Only
+## Examples
-Assuming that you already packaged your source before as such:
+See [examples documentation](EXAMPLES.md) for sample configurations for various languages:
+- Virtual Packages
+- Rust
+- TypeScript/JavaScript
+- Nim
+- .NET
+- Java
-```bash
-cargo build && cargo install --path .
-pkg-builder env create examples/bookworm/virtual-package/pkg-builder.toml
-pkg-builder package examples/bookworm/virtual-package/pkg-builder.toml
-```
-
-you can run only autopkgtests:
+## Documentation
-```bash
-pkg-builder autopkgtests examples/bookworm/virtual-package/pkg-builder.toml
-```
+- [Installation Guide](INSTALL.md)
+- [Configuration Reference](CONFIG.md)
+- [Examples](EXAMPLES.md)
\ No newline at end of file
diff --git a/bin_dependencies/.crates.toml b/bin_dependencies/.crates.toml
new file mode 100644
index 00000000..4fb4c9fa
--- /dev/null
+++ b/bin_dependencies/.crates.toml
@@ -0,0 +1,2 @@
+[v1]
+"debcrafter 0.2.0 (git+https://github.com/Kixunil/debcrafter?rev=8189263#8189263400e69b747dcbf45de0a702993566fe47)" = ["debcrafter"]
diff --git a/bin_dependencies/.crates2.json b/bin_dependencies/.crates2.json
new file mode 100644
index 00000000..fa608923
--- /dev/null
+++ b/bin_dependencies/.crates2.json
@@ -0,0 +1 @@
+{"installs":{"debcrafter 0.2.0 (git+https://github.com/Kixunil/debcrafter?rev=8189263#8189263400e69b747dcbf45de0a702993566fe47)":{"version_req":null,"bins":["debcrafter"],"features":[],"all_features":false,"no_default_features":false,"profile":"release","target":"x86_64-unknown-linux-gnu","rustc":"rustc 1.85.0 (4d91de4e4 2025-02-17)\nbinary: rustc\ncommit-hash: 4d91de4e48198da2e33413efdcd9cd2cc0c46688\ncommit-date: 2025-02-17\nhost: x86_64-unknown-linux-gnu\nrelease: 1.85.0\nLLVM version: 19.1.7\n"}}}
\ No newline at end of file
diff --git a/bin_dependencies/debcrafter_2711b53 b/bin_dependencies/debcrafter_2711b53
new file mode 100755
index 00000000..aa767271
Binary files /dev/null and b/bin_dependencies/debcrafter_2711b53 differ
diff --git a/bin_dependencies/debcrafter_8189263 b/bin_dependencies/debcrafter_8189263
new file mode 100755
index 00000000..2412e6b4
Binary files /dev/null and b/bin_dependencies/debcrafter_8189263 differ
diff --git a/examples/bookworm/c/hello-world/pkg-builder.toml b/examples/bookworm/c/hello-world/pkg-builder.toml
index d12e6423..654442ba 100644
--- a/examples/bookworm/c/hello-world/pkg-builder.toml
+++ b/examples/bookworm/c/hello-world/pkg-builder.toml
@@ -17,7 +17,7 @@ language_env = "c"
[build_env]
codename="bookworm"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/bookworm/dotnet/hello-world/pkg-builder.toml b/examples/bookworm/dotnet/hello-world/pkg-builder.toml
index 674ebef7..1973eae1 100644
--- a/examples/bookworm/dotnet/hello-world/pkg-builder.toml
+++ b/examples/bookworm/dotnet/hello-world/pkg-builder.toml
@@ -32,7 +32,7 @@ use_backup_version = true
[build_env]
codename = "bookworm"
arch = "amd64"
-pkg_builder_version = "0.2.11"
+pkg_builder_version = "0.3.0"
debcrafter_version = "8189263"
run_lintian = true
run_piuparts = true
@@ -42,13 +42,4 @@ piuparts_version = "1.1.7"
autopkgtest_version = "5.28"
sbuild_version = "0.85.6"
# package directory
-workdir = "~/.pkg-builder/packages/bookworm"
-
-
-[verify]
-# if tarball_url is specified
-tarball_hash = ""
-# if git_source is specified and package_is_git
-git_commit = ""
-# output hash
-bin_bash = ""
+workdir = "~/.pkg-builder/packages/bookworm"
\ No newline at end of file
diff --git a/examples/bookworm/git-package/nimbus/pkg-builder.toml b/examples/bookworm/git-package/nimbus/pkg-builder.toml
index 5ade300e..b90e4866 100644
--- a/examples/bookworm/git-package/nimbus/pkg-builder.toml
+++ b/examples/bookworm/git-package/nimbus/pkg-builder.toml
@@ -70,7 +70,7 @@ nim_version_checksum = "047dde8ff40b18628ac1188baa9ca992d05f1f45c5121d1d07a76224
[build_env]
codename="bookworm"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "latest"
run_lintian=false
run_piuparts=false
diff --git a/examples/bookworm/go/hello-world/pkg-builder.toml b/examples/bookworm/go/hello-world/pkg-builder.toml
index 421ee859..9f932002 100644
--- a/examples/bookworm/go/hello-world/pkg-builder.toml
+++ b/examples/bookworm/go/hello-world/pkg-builder.toml
@@ -20,7 +20,7 @@ go_binary_checksum = "5901c52b7a78002aeff14a21f93e0f064f74ce1360fce51c6ee68cd471
[build_env]
codename="bookworm"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/bookworm/java-gradle/hello-world/pkg-builder.toml b/examples/bookworm/java-gradle/hello-world/pkg-builder.toml
index 385acf9a..7f3f5038 100644
--- a/examples/bookworm/java-gradle/hello-world/pkg-builder.toml
+++ b/examples/bookworm/java-gradle/hello-world/pkg-builder.toml
@@ -26,7 +26,7 @@ gradle_binary_checksum="544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2
[build_env]
codename = "bookworm"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/bookworm/java/hello-world/pkg-builder.toml b/examples/bookworm/java/hello-world/pkg-builder.toml
index 2e442ed9..d3088a9a 100644
--- a/examples/bookworm/java/hello-world/pkg-builder.toml
+++ b/examples/bookworm/java/hello-world/pkg-builder.toml
@@ -21,7 +21,7 @@ jdk_binary_checksum="e4fb2df9a32a876afb0a6e17f54c594c2780e18badfa2e8fc99bc2656b0
[build_env]
codename = "bookworm"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/bookworm/javascript/hello-world/pkg-builder.toml b/examples/bookworm/javascript/hello-world/pkg-builder.toml
index f516f04c..2e639cd1 100644
--- a/examples/bookworm/javascript/hello-world/pkg-builder.toml
+++ b/examples/bookworm/javascript/hello-world/pkg-builder.toml
@@ -21,7 +21,7 @@ yarn_version = "1.22.19"
[build_env]
codename="bookworm"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/bookworm/nim/hello-world/pkg-builder.toml b/examples/bookworm/nim/hello-world/pkg-builder.toml
index 44682736..6116beb7 100644
--- a/examples/bookworm/nim/hello-world/pkg-builder.toml
+++ b/examples/bookworm/nim/hello-world/pkg-builder.toml
@@ -20,7 +20,7 @@ nim_version_checksum = "047dde8ff40b18628ac1188baa9ca992d05f1f45c5121d1d07a76224
[build_env]
codename="bookworm"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/bookworm/python/hello-world/pkg-builder.toml b/examples/bookworm/python/hello-world/pkg-builder.toml
index d2a9fd58..add185b2 100644
--- a/examples/bookworm/python/hello-world/pkg-builder.toml
+++ b/examples/bookworm/python/hello-world/pkg-builder.toml
@@ -17,7 +17,7 @@ language_env = "python"
[build_env]
codename="bookworm"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/bookworm/rust/hello-world/pkg-builder.toml b/examples/bookworm/rust/hello-world/pkg-builder.toml
index 2eefbb3a..746343dc 100644
--- a/examples/bookworm/rust/hello-world/pkg-builder.toml
+++ b/examples/bookworm/rust/hello-world/pkg-builder.toml
@@ -37,7 +37,7 @@ KGFMBQELjcFWLGcBVE45DRuVR8E3XYunjSdgLFXjfZfeGF3uiS6fNHGCH41ryqfj
[build_env]
codename="bookworm"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/bookworm/typescript/hello-world/pkg-builder.toml b/examples/bookworm/typescript/hello-world/pkg-builder.toml
index 14df8c73..d4bfedb0 100644
--- a/examples/bookworm/typescript/hello-world/pkg-builder.toml
+++ b/examples/bookworm/typescript/hello-world/pkg-builder.toml
@@ -21,7 +21,7 @@ yarn_version = "1.22.19"
[build_env]
codename="bookworm"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/bookworm/virtual/hello-world/pkg-builder.toml b/examples/bookworm/virtual/hello-world/pkg-builder.toml
index f1339abd..c3c291bb 100644
--- a/examples/bookworm/virtual/hello-world/pkg-builder.toml
+++ b/examples/bookworm/virtual/hello-world/pkg-builder.toml
@@ -11,7 +11,7 @@ package_type="virtual"
[build_env]
codename="bookworm"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/jammy/c/hello-world/pkg-builder.toml b/examples/jammy/c/hello-world/pkg-builder.toml
index ed728372..7bda0d78 100644
--- a/examples/jammy/c/hello-world/pkg-builder.toml
+++ b/examples/jammy/c/hello-world/pkg-builder.toml
@@ -17,7 +17,7 @@ language_env = "c"
[build_env]
codename="jammy jellyfish"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/jammy/dotnet/hello-world/pkg-builder.toml b/examples/jammy/dotnet/hello-world/pkg-builder.toml
index ebcb1044..566d5708 100644
--- a/examples/jammy/dotnet/hello-world/pkg-builder.toml
+++ b/examples/jammy/dotnet/hello-world/pkg-builder.toml
@@ -31,7 +31,7 @@ use_backup_version = true
[build_env]
codename = "jammy jellyfish"
arch = "amd64"
-pkg_builder_version = "0.2.11"
+pkg_builder_version = "0.3.0"
debcrafter_version = "8189263"
run_lintian = true
run_piuparts = true
diff --git a/examples/jammy/git-package/nimbus/pkg-builder.toml b/examples/jammy/git-package/nimbus/pkg-builder.toml
index bf5d9d50..12a095b8 100644
--- a/examples/jammy/git-package/nimbus/pkg-builder.toml
+++ b/examples/jammy/git-package/nimbus/pkg-builder.toml
@@ -70,7 +70,7 @@ nim_version_checksum = "047dde8ff40b18628ac1188baa9ca992d05f1f45c5121d1d07a76224
[build_env]
codename="bookworm"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "latest"
run_lintian=false
run_piuparts=false
diff --git a/examples/jammy/go/hello-world/pkg-builder.toml b/examples/jammy/go/hello-world/pkg-builder.toml
index d85a0436..70e10978 100644
--- a/examples/jammy/go/hello-world/pkg-builder.toml
+++ b/examples/jammy/go/hello-world/pkg-builder.toml
@@ -20,7 +20,7 @@ go_binary_checksum = "5901c52b7a78002aeff14a21f93e0f064f74ce1360fce51c6ee68cd471
[build_env]
codename="jammy jellyfish"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/jammy/java-gradle/hello-world/pkg-builder.toml b/examples/jammy/java-gradle/hello-world/pkg-builder.toml
index acff30a9..6d75aebb 100644
--- a/examples/jammy/java-gradle/hello-world/pkg-builder.toml
+++ b/examples/jammy/java-gradle/hello-world/pkg-builder.toml
@@ -26,7 +26,7 @@ gradle_binary_checksum="544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2
[build_env]
codename="jammy jellyfish"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/jammy/java/hello-world/pkg-builder.toml b/examples/jammy/java/hello-world/pkg-builder.toml
index 96db5435..582c2eeb 100644
--- a/examples/jammy/java/hello-world/pkg-builder.toml
+++ b/examples/jammy/java/hello-world/pkg-builder.toml
@@ -21,7 +21,7 @@ jdk_binary_checksum="e4fb2df9a32a876afb0a6e17f54c594c2780e18badfa2e8fc99bc2656b0
[build_env]
codename="jammy jellyfish"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/jammy/javascript/hello-world/pkg-builder.toml b/examples/jammy/javascript/hello-world/pkg-builder.toml
index 2fc2f2e3..412615eb 100644
--- a/examples/jammy/javascript/hello-world/pkg-builder.toml
+++ b/examples/jammy/javascript/hello-world/pkg-builder.toml
@@ -21,7 +21,7 @@ yarn_version = "1.22.19"
[build_env]
codename="jammy jellyfish"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/jammy/nim/hello-world/pkg-builder.toml b/examples/jammy/nim/hello-world/pkg-builder.toml
index fc81044a..c9e651ba 100644
--- a/examples/jammy/nim/hello-world/pkg-builder.toml
+++ b/examples/jammy/nim/hello-world/pkg-builder.toml
@@ -20,7 +20,7 @@ nim_version_checksum = "047dde8ff40b18628ac1188baa9ca992d05f1f45c5121d1d07a76224
[build_env]
codename="jammy jellyfish"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/jammy/rust/hello-world/pkg-builder.toml b/examples/jammy/rust/hello-world/pkg-builder.toml
index 9051ec85..4b3261bf 100644
--- a/examples/jammy/rust/hello-world/pkg-builder.toml
+++ b/examples/jammy/rust/hello-world/pkg-builder.toml
@@ -37,7 +37,7 @@ KGFMBQELjcFWLGcBVE45DRuVR8E3XYunjSdgLFXjfZfeGF3uiS6fNHGCH41ryqfj
[build_env]
codename="jammy jellyfish"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/jammy/typescript/hello-world/pkg-builder.toml b/examples/jammy/typescript/hello-world/pkg-builder.toml
index 67529649..9390a81b 100644
--- a/examples/jammy/typescript/hello-world/pkg-builder.toml
+++ b/examples/jammy/typescript/hello-world/pkg-builder.toml
@@ -21,7 +21,7 @@ yarn_version = "1.22.19"
[build_env]
codename="jammy jellyfish"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/jammy/virtual/hello-world/pkg-builder.toml b/examples/jammy/virtual/hello-world/pkg-builder.toml
index 4b97424c..4e1e4158 100644
--- a/examples/jammy/virtual/hello-world/pkg-builder.toml
+++ b/examples/jammy/virtual/hello-world/pkg-builder.toml
@@ -11,7 +11,7 @@ package_type="virtual"
[build_env]
codename="jammy jellyfish"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/noble/c/hello-world/pkg-builder.toml b/examples/noble/c/hello-world/pkg-builder.toml
index 460190d8..e35d13c6 100644
--- a/examples/noble/c/hello-world/pkg-builder.toml
+++ b/examples/noble/c/hello-world/pkg-builder.toml
@@ -17,7 +17,7 @@ language_env = "c"
[build_env]
codename="noble numbat"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/noble/dotnet-9/hello-world/pkg-builder.toml b/examples/noble/dotnet-9/hello-world/pkg-builder.toml
index ed6b12e6..f9f34c78 100644
--- a/examples/noble/dotnet-9/hello-world/pkg-builder.toml
+++ b/examples/noble/dotnet-9/hello-world/pkg-builder.toml
@@ -32,7 +32,7 @@ use_backup_version = true
[build_env]
codename = "noble numbat"
arch = "amd64"
-pkg_builder_version = "0.2.11"
+pkg_builder_version = "0.3.0"
debcrafter_version = "8189263"
run_lintian = true
run_piuparts = true
diff --git a/examples/noble/dotnet/hello-world/pkg-builder.toml b/examples/noble/dotnet/hello-world/pkg-builder.toml
index 840fce83..cf7350b1 100644
--- a/examples/noble/dotnet/hello-world/pkg-builder.toml
+++ b/examples/noble/dotnet/hello-world/pkg-builder.toml
@@ -36,7 +36,7 @@ use_backup_version = true
[build_env]
codename = "noble numbat"
arch = "amd64"
-pkg_builder_version = "0.2.11"
+pkg_builder_version = "0.3.0"
debcrafter_version = "8189263"
run_lintian = true
run_piuparts = true
diff --git a/examples/noble/git-package/nimbus/pkg-builder.toml b/examples/noble/git-package/nimbus/pkg-builder.toml
index fda6fc99..22850b54 100644
--- a/examples/noble/git-package/nimbus/pkg-builder.toml
+++ b/examples/noble/git-package/nimbus/pkg-builder.toml
@@ -70,7 +70,7 @@ nim_version_checksum = "047dde8ff40b18628ac1188baa9ca992d05f1f45c5121d1d07a76224
[build_env]
codename="bookworm"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "latest"
run_lintian=false
run_piuparts=false
diff --git a/examples/noble/go/hello-world/pkg-builder.toml b/examples/noble/go/hello-world/pkg-builder.toml
index f42de706..9379fb0d 100644
--- a/examples/noble/go/hello-world/pkg-builder.toml
+++ b/examples/noble/go/hello-world/pkg-builder.toml
@@ -20,7 +20,7 @@ go_binary_checksum = "5901c52b7a78002aeff14a21f93e0f064f74ce1360fce51c6ee68cd471
[build_env]
codename="noble numbat"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/noble/java-gradle/hello-world/pkg-builder.toml b/examples/noble/java-gradle/hello-world/pkg-builder.toml
index d3f89c7d..fde23949 100644
--- a/examples/noble/java-gradle/hello-world/pkg-builder.toml
+++ b/examples/noble/java-gradle/hello-world/pkg-builder.toml
@@ -26,7 +26,7 @@ gradle_binary_checksum="544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2
[build_env]
codename="noble numbat"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/noble/java/hello-world/pkg-builder.toml b/examples/noble/java/hello-world/pkg-builder.toml
index 34483f10..02370fa7 100644
--- a/examples/noble/java/hello-world/pkg-builder.toml
+++ b/examples/noble/java/hello-world/pkg-builder.toml
@@ -21,7 +21,7 @@ jdk_binary_checksum="e4fb2df9a32a876afb0a6e17f54c594c2780e18badfa2e8fc99bc2656b0
[build_env]
codename="noble numbat"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/noble/javascript/hello-world/pkg-builder.toml b/examples/noble/javascript/hello-world/pkg-builder.toml
index 5d6e4fc0..ca6563ee 100644
--- a/examples/noble/javascript/hello-world/pkg-builder.toml
+++ b/examples/noble/javascript/hello-world/pkg-builder.toml
@@ -21,7 +21,7 @@ yarn_version = "1.22.19"
[build_env]
codename="noble numbat"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/noble/nim/hello-world/pkg-builder.toml b/examples/noble/nim/hello-world/pkg-builder.toml
index afe31f30..dcf88431 100644
--- a/examples/noble/nim/hello-world/pkg-builder.toml
+++ b/examples/noble/nim/hello-world/pkg-builder.toml
@@ -20,7 +20,7 @@ nim_version_checksum = "047dde8ff40b18628ac1188baa9ca992d05f1f45c5121d1d07a76224
[build_env]
codename="noble numbat"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/noble/python/hello-world/pkg-builder.toml b/examples/noble/python/hello-world/pkg-builder.toml
index 5ea7e903..00bc90a4 100644
--- a/examples/noble/python/hello-world/pkg-builder.toml
+++ b/examples/noble/python/hello-world/pkg-builder.toml
@@ -17,7 +17,7 @@ language_env = "python"
[build_env]
codename="noble numbat"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/noble/rust/hello-world/pkg-builder.toml b/examples/noble/rust/hello-world/pkg-builder.toml
index 6c1b7bef..a53fff78 100644
--- a/examples/noble/rust/hello-world/pkg-builder.toml
+++ b/examples/noble/rust/hello-world/pkg-builder.toml
@@ -37,7 +37,7 @@ KGFMBQELjcFWLGcBVE45DRuVR8E3XYunjSdgLFXjfZfeGF3uiS6fNHGCH41ryqfj
[build_env]
codename="noble numbat"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/noble/typescript/hello-world/pkg-builder.toml b/examples/noble/typescript/hello-world/pkg-builder.toml
index 7f74e39e..8e7a4f2b 100644
--- a/examples/noble/typescript/hello-world/pkg-builder.toml
+++ b/examples/noble/typescript/hello-world/pkg-builder.toml
@@ -21,7 +21,7 @@ yarn_version = "1.22.19"
[build_env]
codename="noble numbat"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/examples/noble/virtual/hello-world/pkg-builder.toml b/examples/noble/virtual/hello-world/pkg-builder.toml
index 17e8cadc..40d58e81 100644
--- a/examples/noble/virtual/hello-world/pkg-builder.toml
+++ b/examples/noble/virtual/hello-world/pkg-builder.toml
@@ -11,7 +11,7 @@ package_type="virtual"
[build_env]
codename="noble numbat"
arch = "amd64"
-pkg_builder_version="0.2.11"
+pkg_builder_version="0.3.0"
debcrafter_version = "8189263"
run_lintian=true
run_piuparts=true
diff --git a/rustfmt.toml b/rustfmt.toml
new file mode 100644
index 00000000..382a5f36
--- /dev/null
+++ b/rustfmt.toml
@@ -0,0 +1,2 @@
+# imports_granularity = "Module"
+reorder_imports = true
\ No newline at end of file
diff --git a/src/lib.rs b/src/lib.rs
deleted file mode 100644
index 9c85be90..00000000
--- a/src/lib.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-// src/lib.rs
-pub mod v1;
-pub mod build;
\ No newline at end of file
diff --git a/src/v1/build/debcrafter_helper.rs b/src/v1/build/debcrafter_helper.rs
deleted file mode 100644
index 1450718d..00000000
--- a/src/v1/build/debcrafter_helper.rs
+++ /dev/null
@@ -1,199 +0,0 @@
-use log::info;
-use std::fs;
-use std::io;
-use std::path::Path;
-use std::path::PathBuf;
-use std::process::Command;
-use tempfile::tempdir;
-use thiserror::Error;
-
-#[derive(Debug, Error)]
-pub enum Error {
- #[error("Command not found: {0}")]
- CommandNotFound(#[from] io::Error),
-
- #[error("Failed to execute command: {0}")]
- CommandFailed(CommandError),
-
- #[error("Failed to clone: {0}")]
- GitClone(#[from] git2::Error),
-}
-
-#[derive(Debug, Error)]
-pub enum CommandError {
- #[error("{0}")]
- StringError(String),
- #[error("{0}")]
- IOError(io::Error),
-}
-
-impl From for CommandError {
- fn from(err: String) -> Self {
- CommandError::StringError(err)
- }
-}
-
-impl From for CommandError {
- fn from(err: io::Error) -> Self {
- CommandError::IOError(err)
- }
-}
-
-// TODO use from crates.io
-pub fn check_if_dpkg_parsechangelog_installed() -> Result<(), Error> {
- let mut cmd = Command::new("which");
- cmd.arg("dpkg-parsechangelog");
-
- handle_failure(
- &mut cmd,
- "dpkg-parsechangelog is not installed, please install it.".to_string(),
- )?;
- Ok(())
-}
-
-pub fn check_if_installed(debcrafter_version: &String) -> eyre::Result<()> {
- match Command::new("which")
- .arg(format!("debcrafter_{}", debcrafter_version))
- .output()
- {
- Ok(output) => {
- if output.status.success() {
- Ok(())
- } else {
- let stdout = String::from_utf8_lossy(&output.stdout);
- let stderr = String::from_utf8_lossy(&output.stderr);
-
- eyre::bail!(
- "Command failed with exit code {:?}\nstdout: {}\nstderr: {}",
- output.status.code(),
- stdout,
- stderr
- );
- }
- }
- Err(err) => eyre::bail!("Failed to execute 'which' command: {}", err),
- }
-}
-
-// pub fn check_version_compatibility(debcrafter_version: &str) -> Result<(), String> {
-// let output = Command::new("debcrafter")
-// .arg("--version")
-// .output()
-// .map_err(|_| "Failed to execute debcrafter --version")?;
-
-// let output_str = String::from_utf8_lossy(&output.stdout);
-
-// if !output.status.success() && output_str.contains(debcrafter_version) {
-// return Err("debcrafter does not have the required version".to_string());
-// }
-// Ok(())
-// }
-
-pub fn create_debian_dir(specification_file: &str, target_dir: &str, debcrafter_version: &String) -> Result<(), Error> {
- let debcrafter_dir = tempdir().expect("Failed to create temporary directory");
-
- let spec_file_path = fs::canonicalize(PathBuf::from(specification_file)).map_err(|_| {
- Error::CommandFailed(format!("{} spec_file doesn't exist", specification_file).into())
- })?;
- if !spec_file_path.exists() {
- return Err(Error::CommandFailed(
- format!("{} spec_file doesn't exist", specification_file).into(),
- ));
- }
- let spec_dir = spec_file_path.parent().unwrap();
- let spec_file_name = spec_file_path.file_name().unwrap();
- info!("Spec directory: {:?}", spec_dir.to_str().unwrap());
- info!("Spec file: {:?}", spec_file_name);
- info!("Debcrafter directory: {:?}", debcrafter_dir);
- let mut cmd = Command::new(format!("debcrafter_{}", debcrafter_version));
- cmd.arg(spec_file_name)
- .current_dir(spec_dir)
- .arg(debcrafter_dir.path());
-
- handle_failure(&mut cmd, "Debcrafter error".to_string())?;
-
- if let Some(first_directory) = get_first_directory(debcrafter_dir.path()) {
- let tmp_debian_dir = first_directory.join("debian");
- let dest_dir = Path::new(target_dir).join("debian");
- copy_dir_contents_recursive(&tmp_debian_dir, &dest_dir)
- .map_err(|err| Error::CommandFailed(err.into()))?;
- } else {
- return Err(Error::CommandFailed(
- "Unable to create debian dir.".to_string().into(),
- ));
- }
- Ok(())
-}
-
-fn copy_dir_contents_recursive(src_dir: &Path, dest_dir: &Path) -> io::Result<()> {
- info!(
- "Copying directory: {:?} to {:?}",
- src_dir.display(),
- dest_dir.display()
- );
-
- if src_dir.is_dir() {
- if !dest_dir.exists() {
- fs::create_dir_all(dest_dir)?;
- }
-
- for entry in fs::read_dir(src_dir)? {
- let entry = entry?;
- let src_path = entry.path();
- let dest_path = dest_dir.join(entry.file_name());
-
- if src_path.is_dir() {
- copy_dir_contents_recursive(&src_path, &dest_path)?;
- } else {
- fs::copy(&src_path, &dest_path)?;
- }
- }
- }
-
- Ok(())
-}
-fn handle_failure(cmd: &mut Command, error: String) -> Result<(), Error> {
- let output = cmd
- .output()
- .map_err(|_| Error::CommandFailed(error.clone().into()))?;
-
- if !output.status.success() {
- //let stderr = String::from_utf8_lossy(&output.stderr).to_string();
- return Err(Error::CommandFailed(error.into()));
- }
- Ok(())
-}
-fn get_first_directory(dir: &Path) -> Option {
- if dir.is_dir() {
- for entry in fs::read_dir(dir).ok()? {
- let entry = entry.unwrap();
- let path = entry.path();
- if path.is_dir() {
- return Some(path);
- }
- }
- }
- None
-}
-
-#[cfg(test)]
-mod tests {
- // use super::*;
-
- // #[test]
- // fn test_debcrafter_installed() {
- // let result = check_if_installed();
- // assert!(result.is_err());
- // assert_eq!(result.unwrap_err(), "debcrafter is not installed");
- // }
-
- // #[test]
- // fn test_debcrafter_version_incompatibility() {
- // let result = check_version_compatibility("1.0.0");
- // assert!(result.is_err());
- // assert_eq!(
- // result.unwrap_err(),
- // "debcrafter does not have the required version"
- // );
- // }
-}
diff --git a/src/v1/build/dir_setup.rs b/src/v1/build/dir_setup.rs
deleted file mode 100644
index 519f1afd..00000000
--- a/src/v1/build/dir_setup.rs
+++ /dev/null
@@ -1,901 +0,0 @@
-use std::io::BufRead;
-use std::io::BufReader;
-use std::{env, fs, io};
-
-use eyre::{eyre, Result};
-
-use crate::v1::build::debcrafter_helper;
-use crate::v1::pkg_config::SubModule;
-use dirs::home_dir;
-use filetime::FileTime;
-use log::info;
-use sha2::{Digest, Sha256, Sha512};
-use std::io::{Read, Write};
-use std::os::unix::fs::PermissionsExt;
-use std::path::Path;
-use std::path::PathBuf;
-use std::process::Command;
-
-pub fn create_package_dir(build_artifacts_dir: &String) -> Result<()> {
- if fs::metadata(build_artifacts_dir).is_ok() {
- info!("Remove previous package folder {}", &build_artifacts_dir);
- fs::remove_dir_all(build_artifacts_dir)?;
- }
- info!("Creating package folder {}", &build_artifacts_dir);
- fs::create_dir_all(build_artifacts_dir)?;
- Ok(())
-}
-
-pub fn download_source(tarball_path: &str, tarball_url: &str, config_root: &str) -> Result<()> {
- info!("Downloading source {}", tarball_path);
- let is_web = tarball_url.starts_with("http");
- let tarball_url = get_tarball_url(tarball_url, config_root);
- if is_web {
- info!(
- "Downloading tar: {} to location: {}",
- tarball_url, tarball_path
- );
- let status = Command::new("wget")
- .arg("-q")
- .arg("-O")
- .arg(tarball_path)
- .arg(tarball_url)
- .status()?;
- if !status.success() {
- return Err(eyre!("Download failed".to_string()));
- }
- } else {
- info!("Copying tar: {} to location: {}", tarball_url, tarball_path);
- fs::copy(tarball_url, tarball_path)?;
- }
- Ok(())
-}
-
-pub fn update_submodules(git_submodules: &Vec, current_dir: &str) -> Result<()> {
- // DO not use git2, it has very little git supported functionality
- // Initialize all submodules if they are not already initialized
- // Update submodules to specific commits
- for submodule in git_submodules.clone() {
- let output = Command::new("git")
- .current_dir(Path::new(current_dir).join(submodule.path.clone()))
- .args(&["checkout", &submodule.commit.clone()])
- .output()
- .map_err(|err| eyre!(format!("Failed to checkout submodule {}", err)))?;
- if !output.status.success() {
- return Err(eyre!(
- "Failed to checkout commit {} for submodule {}: {}",
- submodule.commit,
- submodule.path,
- String::from_utf8_lossy(&output.stderr)
- ));
- }
- }
-
- Ok(())
-}
-
-pub fn clone_and_checkout_tag(
- git_url: &str,
- tag_version: &str,
- path: &str,
- git_submodules: &Vec,
-) -> Result<()> {
- match Command::new("which").arg("git-lfs").output() {
- Ok(_) => Ok(()),
- Err(_) => Err(eyre!("git-lfs is not installed, please install it!")),
- }?;
-
- let output = Command::new("git")
- .args(&[
- "clone",
- "--depth",
- "1",
- "--branch",
- tag_version,
- git_url,
- path,
- ])
- .output()
- .expect("Failed to execute git clone command");
- if !output.status.success() {
- return Err(eyre!(
- "Failed to checkout tag {}: {}",
- tag_version,
- String::from_utf8_lossy(&output.stderr)
- ));
- }
-
- // Initialize submodules
- let output = Command::new("git")
- .current_dir(path)
- .args(&["submodule", "update", "--init", "--recursive"])
- .output()?;
-
- if !output.status.success() {
- return Err(eyre!(
- "Failed to initialize submodules: {}",
- String::from_utf8_lossy(&output.stderr)
- ));
- }
-
- update_submodules(git_submodules, path)?;
-
- Ok(())
-}
-
-fn set_creation_time>(dir_path: P, timestamp: FileTime) -> io::Result<()> {
- filetime::set_file_mtime(&dir_path, timestamp)?;
- filetime::set_file_atime(&dir_path, timestamp)?;
-
- let mut stack = vec![PathBuf::from(dir_path.as_ref())];
-
- while let Some(current) = stack.pop() {
- for entry in fs::read_dir(¤t)? {
- let entry = entry?;
- let file_type = entry.file_type()?;
- let file_path = entry.path();
-
- if file_type.is_dir() {
- stack.push(file_path.clone()); // Push directory onto stack for processing
- filetime::set_file_mtime(&file_path, timestamp)?;
- filetime::set_file_atime(&file_path, timestamp)?;
- } else if file_type.is_file() {
- filetime::set_file_mtime(&file_path, timestamp)?;
- filetime::set_file_atime(&file_path, timestamp)?;
- } else if file_type.is_symlink() {
- filetime::set_symlink_file_times(&file_path, timestamp, timestamp)?;
- }
- }
- }
-
- Ok(())
-}
-
-pub fn download_git(
- build_artifacts_dir: &str,
- tarball_path: &str,
- package_name: &str,
- git_url: &str,
- tag_version: &str,
- git_submodules: &Vec,
-) -> Result<()> {
- let path = Path::new(build_artifacts_dir).join(package_name);
- if path.exists() {
- fs::remove_dir_all(path.clone())?;
- }
- fs::create_dir_all(&path.clone())?;
- //let path = Path::new("/tmp/nimbus");
- clone_and_checkout_tag(
- git_url,
- tag_version,
- path.clone().to_str().unwrap(),
- &git_submodules,
- )?;
- // remove .git directory, no need to package it
- fs::remove_dir_all(path.join(".git"))?;
-
- // // Back in the path for reproducibility: January 1, 2022
- let timestamp = FileTime::from_unix_time(1640995200, 0);
- set_creation_time(path.clone(), timestamp)?;
-
- info!("Creating tar from git repo from {}", path.display());
- let output = Command::new("tar")
- .args(&[
- "--sort=name",
- "--owner=0",
- "--group=0",
- "--numeric-owner",
- // does not work
- // "--mtime='2019-01-01 00:00'",
- "--pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime",
- "-czf",
- tarball_path,
- package_name,
- ])
- .current_dir(build_artifacts_dir)
- .output()?;
- if !output.status.success() {
- return Err(eyre!(format!(
- "Failed to create tarball: {}",
- String::from_utf8_lossy(&output.stderr)
- ))
- .into());
- }
-
- Ok(())
-}
-
-pub fn create_empty_tar(build_artifacts_dir: &str, tarball_path: &str) -> Result<()> {
- info!("Creating empty .tar.gz for virtual package");
- let output = Command::new("tar")
- .args(["czvf", tarball_path, "--files-from", "/dev/null"])
- .current_dir(build_artifacts_dir)
- .output()?;
- if !output.status.success() {
- return Err(eyre!("Virtual package .tar.gz creation failed".to_string(),));
- }
-
- Ok(())
-}
-
-pub fn calculate_sha512(mut reader: R) -> Result {
- let mut hasher = Sha512::new();
- io::copy(&mut reader, &mut hasher)?;
- let digest_bytes = hasher.finalize();
- let hex_digest = digest_bytes
- .iter()
- .map(|b| format!("{:02x}", b))
- .collect::();
-
- Ok(hex_digest)
-}
-
-pub fn calculate_sha256(mut reader: R) -> Result {
- let mut hasher = Sha256::new();
- io::copy(&mut reader, &mut hasher)?;
- let digest_bytes = hasher.finalize();
- let hex_digest = digest_bytes
- .iter()
- .map(|b| format!("{:02x}", b))
- .collect::();
-
- Ok(hex_digest)
-}
-
-pub fn verify_tarball_checksum(tarball_path: &str, expected_checksum: &str) -> Result {
- let mut file = fs::File::open(tarball_path).map_err(|_| eyre!("Could not open tarball."))?;
- let mut buffer = Vec::new();
- file.read_to_end(&mut buffer)
- .map_err(|_| eyre!("Could not read tarball."))?;
-
- let actual_sha512 = calculate_sha512(&*buffer.clone()).unwrap_or_default();
- info!("sha512 hash {}", &actual_sha512);
-
- if actual_sha512 == expected_checksum {
- return Ok(true);
- }
-
- let actual_sha256 = calculate_sha256(&*buffer).unwrap_or_default();
- info!("sha256 hash {}", &actual_sha256);
-
- if actual_sha256 == expected_checksum {
- return Ok(true);
- }
- Err(eyre!("Hashes do not match."))
-}
-
-pub fn verify_hash(tarball_path: &str, expected_checksum: Option) -> Result<()> {
- match expected_checksum {
- Some(tarball_hash) => match verify_tarball_checksum(tarball_path, &tarball_hash) {
- Ok(true) => Ok(()),
- Ok(false) => Err(eyre!("Checksum is invalid.")),
- Err(err) => Err(eyre!("Error checking hash: {}", err)),
- },
- None => Ok(()), // If no checksum is provided, consider it verified
- }
-}
-
-pub fn extract_source(tarball_path: &str, build_files_dir: &str) -> Result<()> {
- info!("Extracting source {}", &build_files_dir);
- fs::create_dir_all(build_files_dir)?;
-
- let mut args = vec!["zxvf", &tarball_path, "-C", &build_files_dir];
- let numbers_to_strip = components_to_strip(tarball_path.to_string().clone());
- let numbers_to_strip = numbers_to_strip.unwrap_or_default();
- let strip = format!("--strip-components={}", numbers_to_strip);
- if numbers_to_strip > 0 {
- args.push(&strip);
- }
- info!("Stripping components: {} {:?}", numbers_to_strip, args);
- let output = Command::new("tar").args(args).output()?;
- if !output.status.success() {
- let error_message = String::from_utf8(output.stderr)
- .unwrap_or_else(|_| "Unknown error occurred during extraction".to_string());
- return Err(eyre!(error_message));
- }
- info!("Extracted source to build_files_dir: {:?}", build_files_dir);
-
- Ok(())
-}
-
-pub fn create_debian_dir(
- build_files_dir: &String,
- debcrafter_version: &String,
- spec_file: &str,
-) -> Result<()> {
- debcrafter_helper::check_if_dpkg_parsechangelog_installed()?;
- debcrafter_helper::check_if_installed(debcrafter_version)?;
-
- debcrafter_helper::create_debian_dir(spec_file, build_files_dir, debcrafter_version)?;
- info!(
- "Created /debian dir under build_files_dir folder: {:?}",
- build_files_dir
- );
- Ok(())
-}
-
-pub fn patch_quilt(build_files_dir: &String) -> Result<()> {
- let debian_source_format_path = format!("{}/debian/source/format", build_files_dir);
- info!(
- "Setting up quilt format for patching. Debian source format path: {}",
- debian_source_format_path
- );
- let debian_source_dir = PathBuf::from(&build_files_dir).join("debian/source");
- if !debian_source_dir.exists() {
- fs::create_dir_all(&debian_source_dir)?;
- info!(
- "Created debian/source directory at: {:?}",
- debian_source_dir
- );
- }
-
- if !Path::new(&debian_source_format_path).exists() {
- fs::write(&debian_source_format_path, "3.0 (quilt)\n")?;
- info!(
- "Quilt format file created at: {}",
- debian_source_format_path
- );
- } else {
- info!(
- "Quilt format file already exists at: {}",
- debian_source_format_path
- );
- }
- Ok(())
-}
-
-pub fn patch_pc_dir(build_files_dir: &String) -> Result<()> {
- let pc_version_path = format!("{}/.pc/.version", &build_files_dir);
- info!("Creating necessary directories for patching");
- fs::create_dir_all(format!("{}/.pc", &build_files_dir))?;
- let mut pc_version_file = fs::File::create(pc_version_path)?;
- writeln!(pc_version_file, "2")?;
- Ok(())
-}
-
-pub fn patch_standards_version(build_files_dir: &String, homepage: &String) -> Result<()> {
- let debian_control_path = format!("{}/debian/control", build_files_dir);
- info!(
- "Adding Standards-Version to the control file. Debian control path: {}",
- debian_control_path
- );
- let input_file = fs::File::open(&debian_control_path)?;
- let reader = BufReader::new(input_file);
-
- let original_content: Vec = reader.lines().map(|line| line.unwrap()).collect();
- let has_standards_version = original_content
- .iter()
- .any(|line| line.starts_with("Standards-Version"));
- let standards_version_line = "Standards-Version: 4.5.1";
- let homepage_line = format!("Homepage: {}", homepage);
- if !has_standards_version {
- let mut insert_index = 0;
- for (i, line) in original_content.iter().enumerate() {
- if line.starts_with("Priority:") {
- insert_index = i + 1;
- break;
- }
- }
-
- let mut updated_content = original_content.clone();
- updated_content.insert(insert_index, standards_version_line.to_string());
- updated_content.insert(insert_index + 1, homepage_line.to_string());
-
- let mut output_file = fs::File::create(&debian_control_path)?;
- for line in updated_content {
- writeln!(output_file, "{}", line)?;
- }
-
- info!("Standards-Version added to the control file.");
- } else {
- info!("Standards-Version already exists in the control file. No changes made.");
- }
- Ok(())
-}
-
-pub fn copy_src_dir(build_files_dir: &String, src_dir: &String) -> Result<()> {
- let src_dir_path = Path::new(src_dir);
- if src_dir_path.exists() {
- copy_directory_recursive(Path::new(src_dir), Path::new(&build_files_dir))
- .map_err(|err| eyre!(format!("Failed to copy src directory: {}", err)))?;
- }
- Ok(())
-}
-
-pub fn patch_rules_permission(build_files_dir: &str) -> Result<()> {
- info!(
- "Adding executable permission for {}/debian/rules",
- build_files_dir
- );
-
- let debian_rules = format!("{}/debian/rules", build_files_dir);
- let mut permissions = fs::metadata(debian_rules.clone())
- .map_err(|_| eyre!("Failed to get debian/rules permission."))?
- .permissions();
- permissions.set_mode(permissions.mode() | 0o111);
- fs::set_permissions(debian_rules, permissions)
- .map_err(|_| eyre!("Failed to set debian/rules permission."))?;
- Ok(())
-}
-
-pub fn patch_source(build_files_dir: &String, homepage: &String, src_dir: &String) -> Result<()> {
- // Patch quilt
- patch_quilt(build_files_dir)?;
-
- // Patch .pc dir setup
- patch_pc_dir(build_files_dir)?;
-
- // Patch .pc patch version number
- patch_standards_version(build_files_dir, homepage)?;
-
- // Only copy if src dir exists
- copy_src_dir(build_files_dir, src_dir)?;
-
- patch_rules_permission(build_files_dir)?;
-
- info!("Patching finished successfully!");
- Ok(())
-}
-
-pub fn setup_sbuild() -> Result<()> {
- let home_dir = home_dir().expect("Home dir is empty");
- let dest_path = home_dir.join(".sbuildrc");
- let content = include_str!(".sbuildrc");
- let home_dir = home_dir.to_str().unwrap_or("/home/runner").to_string();
- let replaced_contents = content.replace("", &home_dir);
- let mut file =
- fs::File::create(dest_path).map_err(|_| eyre!("Failed to create ~/.sbuildrc."))?;
- file.write_all(replaced_contents.as_bytes())
- .map_err(|_| eyre!("Failed to write ~/.sbuildrc."))?;
-
- Ok(())
-}
-
-pub fn copy_directory_recursive(src_dir: &Path, dest_dir: &Path) -> Result<(), io::Error> {
- if !src_dir.exists() {
- return Err(io::Error::new(
- io::ErrorKind::NotFound,
- format!("Source directory {:?} does not exist", src_dir),
- ));
- }
-
- if !dest_dir.exists() {
- fs::create_dir_all(dest_dir)?;
- }
-
- for entry in fs::read_dir(src_dir)? {
- let entry = entry?;
- let entry_path = entry.path();
- let file_name = entry.file_name();
-
- let dest_path = dest_dir.join(&file_name);
-
- if entry_path.is_dir() {
- copy_directory_recursive(&entry_path, &dest_path)?;
- } else {
- if let Err(e) = fs::copy(&entry_path, &dest_path) {
- eprintln!(
- "Failed to copy file from {:?} to {:?}: {}",
- entry_path, dest_path, e
- );
- return Err(e);
- }
- }
- }
-
- Ok(())
-}
-
-pub fn components_to_strip(tar_gz_file: String) -> Result {
- let output = Command::new("tar")
- .arg("--list")
- .arg("-z")
- .arg("-f")
- .arg(tar_gz_file)
- .output()?;
-
- let output_str = String::from_utf8_lossy(&output.stdout);
- let lines: Vec<&str> = output_str.lines().filter(|l| !l.ends_with('/')).collect();
-
- let common_prefix = longest_common_prefix(&lines.clone());
-
- let components_to_strip = common_prefix.split('/').filter(|&x| !x.is_empty()).count();
-
- Ok(components_to_strip)
-}
-
-pub fn longest_common_prefix(strings: &[&str]) -> String {
- if strings.is_empty() {
- return String::new();
- }
- if strings.len() == 1 {
- let mut path_buf = PathBuf::from(strings[0]);
- path_buf.pop();
- let common_prefix = path_buf.to_string_lossy().to_string();
- return common_prefix;
- }
-
- let first_string = &strings[0];
- let mut prefix = String::new();
-
- 'outer: for (i, c) in first_string.char_indices() {
- for string in &strings[1..] {
- if let Some(next_char) = string.chars().nth(i) {
- if next_char != c {
- break 'outer;
- }
- } else {
- break 'outer;
- }
- }
- prefix.push(c);
- }
-
- prefix
-}
-
-pub fn get_build_artifacts_dir(
- package_name: &str,
- work_dir: &str,
- version_number: &str,
- revision_number: &str,
-) -> String {
- let build_artifacts_dir = format!(
- "{}/{}-{}-{}",
- work_dir, &package_name, version_number, revision_number
- );
- build_artifacts_dir
-}
-
-pub fn get_tarball_path(
- package_name: &str,
- version_number: &str,
- build_artifacts_dir: &str,
-) -> String {
- let tarball_path = format!(
- "{}/{}_{}.orig.tar.gz",
- &build_artifacts_dir, &package_name, &version_number
- );
- tarball_path
-}
-
-pub fn get_build_files_dir(
- package_name: &str,
- version_number: &str,
- build_artifacts_dir: &str,
-) -> String {
- let build_files_dir = format!(
- "{}/{}-{}",
- build_artifacts_dir, &package_name, &version_number
- );
- build_files_dir
-}
-
-pub fn get_tarball_url(tarball_url: &str, config_root: &str) -> String {
- if tarball_url.starts_with("http") {
- tarball_url.to_string()
- } else {
- expand_path(tarball_url, Some(config_root))
- }
-}
-
-pub fn expand_path(dir: &str, dir_to_expand: Option<&str>) -> String {
- if dir.starts_with('~') {
- let expanded_path = shellexpand::tilde(dir).to_string();
- expanded_path
- } else if dir.starts_with('/') {
- dir.to_string()
- } else {
- let parent_dir = match dir_to_expand {
- None => env::current_dir().unwrap(),
- Some(path) => PathBuf::from(path),
- };
- let dir = parent_dir.join(dir);
- let path = fs::canonicalize(dir.clone()).unwrap_or(dir);
- let path = path.to_str().unwrap().to_string();
- path
- }
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
- use httpmock::prelude::*;
- use std::fs::File;
- use std::path::PathBuf;
- // use std::sync::Once;
- // use env_logger::Env;
- use crate::v1::pkg_config::{PackageType, PkgConfig};
- use tempfile::tempdir;
-
- // static INIT: Once = Once::new();
-
- fn setup() {
- // INIT.call_once(|| {
- // env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
- // });
- }
-
- fn setup_mock_server() -> MockServer {
- // Start the mock server
- let server = MockServer::start();
-
- // Mock the endpoint to serve the tarball file
- server.mock(|when, then| {
- when.method(GET).path("/test_package.tar.gz");
- then.status(200)
- .header("Content-Type", "application/octet-stream")
- .body_from_file("tests/misc/test_package.tar.gz");
- });
-
- server
- }
-
- #[test]
- fn expand_path_expands_tilde_correctly() {
- setup();
- let result = expand_path("~", None);
- assert_ne!(result, "~");
- assert!(!result.contains('~'));
- }
-
- #[test]
- fn expand_path_handles_absolute_paths() {
- setup();
- let result = expand_path("/absolute/path", None);
- assert_eq!(result, "/absolute/path");
- }
-
- #[test]
- fn expand_path_expands_relative_paths_with_parent() {
- setup();
- let result = expand_path("somefile", Some("/tmp"));
- assert_eq!(result, "/tmp/somefile");
- }
-
- #[test]
- fn expand_path_expands_relative_paths_without_parent() {
- setup();
- let result = expand_path("somefile", None);
- assert!(result.starts_with('/'));
- }
-
- #[test]
- fn test_create_package_dir() {
- setup();
-
- let temp_dir = tempdir().expect("Failed to create temporary directory");
-
- let build_artifacts_dir = temp_dir.path().join("test_package");
-
- let result = create_package_dir(&String::from(build_artifacts_dir.to_str().unwrap()));
-
- assert!(result.is_ok());
- assert!(build_artifacts_dir.exists());
- }
-
- #[test]
- fn test_create_package_dir_if_already_exists() {
- setup();
-
- let temp_dir = tempdir().expect("Failed to create temporary directory");
-
- let build_artifacts_dir = temp_dir.path().join("test_package");
- let result = fs::create_dir(build_artifacts_dir.clone());
- assert!(result.is_ok());
- let test_file = build_artifacts_dir.clone().join("test_file");
- File::create(test_file.clone()).expect("Failed to create test_file");
- assert!(test_file.clone().exists());
- let result = create_package_dir(&String::from(build_artifacts_dir.to_str().unwrap()));
-
- assert!(result.is_ok());
- assert!(!test_file.clone().exists());
- assert!(build_artifacts_dir.exists());
- }
-
- #[test]
- fn test_download_source_virtual_package() {
- setup();
-
- let temp_dir = tempdir().expect("Failed to create temporary directory");
-
- let build_artifacts_dir = String::from(temp_dir.path().to_str().unwrap());
- let tarball_name = "test_package.tar.gz";
- let tarball_path = temp_dir.path().join(tarball_name);
- let tarball_path_str = String::from(temp_dir.path().join(tarball_name).to_str().unwrap());
-
- let result = create_empty_tar(&build_artifacts_dir, &tarball_path_str);
-
- assert!(result.is_ok());
- assert!(tarball_path.exists());
- }
-
- #[test]
- fn test_download_source_non_virtual_package() {
- setup();
-
- let server = setup_mock_server();
-
- let temp_dir = tempdir().expect("Failed to create temporary directory");
-
- let tarball_name = "test_package.tar.gz";
- let tarball_path = temp_dir.path().join(tarball_name);
- let tarball_url = format!("{}/{}", server.base_url(), tarball_name);
-
- let result = download_source(tarball_path.to_str().unwrap(), &tarball_url, "/examples");
-
- assert!(result.is_ok());
- assert!(tarball_path.exists());
- }
-
- #[test]
- #[ignore]
- fn test_download_source_with_git_package() {}
-
- #[test]
- fn test_extract_source() {
- setup();
- let package_name = "test_package";
- let temp_dir = tempdir().expect("Failed to create temporary directory");
- let temp_dir = temp_dir.path();
- let tarball_path: PathBuf = PathBuf::from("tests/misc/test_package.tar.gz");
-
- let build_files_dir = temp_dir.join(package_name).to_string_lossy().to_string();
-
- assert!(tarball_path.exists());
- let result = extract_source(tarball_path.to_str().unwrap(), &build_files_dir);
-
- assert!(result.is_ok(), "{:?}", result);
- assert!(Path::new(&build_files_dir).exists());
-
- let test_file_path = PathBuf::from(build_files_dir.clone()).join("empty_file.txt");
-
- assert!(
- test_file_path.exists(),
- "Empty file not found after extraction"
- );
- }
-
- #[test]
- fn patch_rules_permission_adds_exec_permission() -> Result<(), Box> {
- setup();
-
- let temp_dir = tempdir()?;
- let rules_path = temp_dir.path().join("debian/rules");
- fs::create_dir_all(temp_dir.path().join("debian")).expect("Could not create dir");
- File::create(&rules_path)?;
-
- patch_rules_permission(temp_dir.path().to_str().unwrap())?;
-
- let permissions = fs::metadata(&rules_path)?.permissions();
- assert_ne!(permissions.mode() & 0o111, 0);
-
- Ok(())
- }
-
- #[test]
- fn patch_rules_permission_handles_nonexistent_directory() {
- setup();
-
- let result = patch_rules_permission("/nonexistent/dir");
-
- assert!(result.is_err());
- }
-
- #[test]
- fn patch_quilt_creates_source_dir_and_format_file() -> Result<(), Box> {
- setup();
-
- let temp_dir = tempdir()?;
- let build_files_dir = temp_dir.path().to_str().unwrap().to_string();
-
- patch_quilt(&build_files_dir)?;
-
- let debian_source_dir = temp_dir.path().join("debian/source");
- assert!(debian_source_dir.exists());
-
- let debian_source_format_path = temp_dir.path().join("debian/source/format");
- let format_content = fs::read_to_string(debian_source_format_path)?;
- assert_eq!(format_content, "3.0 (quilt)\n");
-
- Ok(())
- }
-
- #[test]
- fn patch_quilt_skips_creation_if_already_exists() -> Result<(), Box> {
- setup();
-
- let temp_dir = tempdir()?;
- let temp_dir = temp_dir.path();
- let build_files_dir = temp_dir.to_str().unwrap().to_string();
-
- fs::create_dir_all(temp_dir.join("debian/source")).expect("Failed to create dir for test.");
- File::create(temp_dir.join("debian/source/format")).expect("Failed to create file.");
-
- let result = patch_quilt(&build_files_dir);
- assert!(result.is_ok());
-
- let entries: Vec<_> = fs::read_dir(temp_dir)?.collect();
- assert_eq!(entries.len(), 1);
-
- Ok(())
- }
-
- #[test]
- fn test_verify_hash_valid_checksum_512() {
- setup();
- let tarball_path = "tests/misc/test_package.tar.gz";
- let expected_checksum = "abd0b8e99f983926dbf60bdcbaef13f83ec7b31d56e68f6252ed05981b237c837044ce768038fc34b71f925e2fb19b7dee451897db512bb4a99e0e1bc96d8ab3";
-
- let result = verify_hash(tarball_path, Some(expected_checksum.to_string()));
-
- assert!(result.is_ok());
- }
-
- #[test]
- fn test_verify_hash_invalid_checksum_512() {
- setup();
- let tarball_path = "tests/misc/test_package.tar.gz";
- let expected_checksum = "abd0b8e99f983926dbf60bdcbaef13f83ec7b31d56e68f6252ed05981b237c837044ce768038fc34b71f925e2fb19b7dee451897db512bb4a99e0e1bc96d8ab2";
-
- let result = verify_hash(tarball_path, Some(expected_checksum.to_string()));
-
- assert!(result.is_err());
- assert_eq!(
- result.err().unwrap().to_string(),
- "Error checking hash: Hashes do not match."
- );
- }
-
- #[test]
- fn test_verify_hash_valid_checksum_256() {
- setup();
- let tarball_path = "tests/misc/test_package.tar.gz";
- let expected_checksum = "b610e83c026d4c465636779240b6ed40a076593a61df5f6b9f9f59f1a929478d";
-
- let result = verify_hash(tarball_path, Some(expected_checksum.to_string()));
-
- assert!(result.is_ok());
- }
-
- #[test]
- fn test_verify_hash_invalid_checksum_256() {
- setup();
- let tarball_path = "tests/misc/test_package.tar.gz";
- let expected_checksum = "b610e83c026d4c465636779240b6ed40a076593a61df5f6b9f9f59f1a929478_";
-
- let result = verify_hash(tarball_path, Some(expected_checksum.to_string()));
-
- assert!(result.is_err());
- assert_eq!(
- result.err().unwrap().to_string(),
- "Error checking hash: Hashes do not match."
- );
- }
-
- #[test]
- fn test_clone_and_checkout_tag() {
- let url = "https://github.com/status-im/nimbus-eth2.git";
- let temp_dir = tempdir().expect("Failed to create temporary directory");
- let repo_path = temp_dir.path();
- let repo_path_str = repo_path.to_str().unwrap();
- let tag_version = "v24.3.0";
- let str = fs::read_to_string("examples/bookworm/git-package/nimbus/pkg-builder.toml")
- .expect("File does not exist");
- let config: PkgConfig = toml::from_str(&str).expect("Cannot parse file.");
- match config.package_type {
- PackageType::Git(gitconfig) => {
- let result =
- clone_and_checkout_tag(url, tag_version, repo_path_str, &gitconfig.submodules);
- assert!(
- result.is_ok(),
- "Failed to clone and checkout tag: {:?}",
- result
- );
- }
- _ => panic!("Wrong type of file."),
- }
-
- fs::remove_dir_all(temp_dir).unwrap();
- }
-}
diff --git a/src/v1/build/mod.rs b/src/v1/build/mod.rs
deleted file mode 100644
index 78dc9aaa..00000000
--- a/src/v1/build/mod.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-pub mod sbuild;
-pub mod sbuild_packager;
-pub mod dir_setup;
-pub mod debcrafter_helper;
-
diff --git a/src/v1/build/sbuild.rs b/src/v1/build/sbuild.rs
deleted file mode 100644
index 0031984e..00000000
--- a/src/v1/build/sbuild.rs
+++ /dev/null
@@ -1,1021 +0,0 @@
-use crate::v1::packager::BackendBuildEnv;
-use crate::v1::pkg_config::{LanguageEnv, PackageType, PkgConfig};
-use crate::v1::pkg_config_verify::PkgVerifyConfig;
-use cargo_metadata::semver::Version;
-use eyre::{eyre, Report, Result};
-use log::{info, warn};
-use rand::random;
-use sha1::{Digest, Sha1};
-use std::fs::create_dir_all;
-use std::io::{BufRead, BufReader, Read, Write};
-use std::path::{Path, PathBuf};
-use std::process::{Child, Command, Stdio};
-use std::{env, fs, io}; // Import from the sha1 crate
-
-pub struct Sbuild {
- config: PkgConfig,
- build_files_dir: String,
- cache_dir: String,
-}
-
-impl Sbuild {
- pub fn new(config: PkgConfig, build_files_dir: String) -> Sbuild {
- Sbuild {
- cache_dir: config
- .build_env
- .sbuild_cache_dir
- .clone()
- .unwrap_or("~/.cache/sbuild".to_string()),
- config,
- build_files_dir,
- }
- }
-
- fn get_build_deps_based_on_langenv(&self, lang_env: &LanguageEnv) -> Vec {
- match lang_env {
- LanguageEnv::C => {
- let lang_deps = vec![];
- lang_deps
- }
- LanguageEnv::Python => {
- let lang_deps = vec![];
- lang_deps
- }
- LanguageEnv::Rust(config) => {
- // TODO
- // let rust_version = &config.rust_version;
- let rust_binary_url = &config.rust_binary_url;
- let rust_binary_gpg_asc = &config.rust_binary_gpg_asc;
- let lang_deps = vec![
- "apt install -y wget gpg gpg-agent".to_string(),
- format!("cd /tmp && wget -q -O rust.tar.xz {}", rust_binary_url),
- format!(
- "cd /tmp && echo \"{}\" >> rust.tar.xz.asc && cat rust.tar.xz.asc ",
- rust_binary_gpg_asc
- ),
- "wget -qO- https://keybase.io/rust/pgp_keys.asc | gpg --import".to_string(),
- "cd /tmp && gpg --verify rust.tar.xz.asc rust.tar.xz".to_string(),
- "cd /tmp && tar xvJf rust.tar.xz -C . --strip-components=1 --exclude=rust-docs"
- .to_string(),
- "cd /tmp && /bin/bash install.sh --without=rust-docs".to_string(),
- "apt remove -y wget gpg gpg-agent".to_string(),
- ];
- lang_deps
- }
- LanguageEnv::Go(config) => {
- // TODO
- //let go_version = &config.go_version;
- let go_binary_url = &config.go_binary_url;
- let go_binary_checksum = &config.go_binary_checksum;
- let install = vec![
- "apt install -y wget".to_string(),
- format!("cd /tmp && wget -q -O go.tar.gz {}", go_binary_url),
- format!("cd /tmp && echo \"{} go.tar.gz\" >> hash_file.txt && cat hash_file.txt", go_binary_checksum),
- "cd /tmp && sha256sum -c hash_file.txt".to_string(),
- "cd /tmp && rm -rf /usr/local/go && mkdir /usr/local/go && tar -C /usr/local -xzf go.tar.gz".to_string(),
- "ln -s /usr/local/go/bin/go /usr/bin/go".to_string(),
- "go version".to_string(),
- // add write permission, this is a chroot env, with one user, should be fine
- "chmod -R a+rwx /usr/local/go/pkg".to_string(),
- "apt remove -y wget".to_string(),
- ];
- install
- }
- LanguageEnv::JavaScript(config) | LanguageEnv::TypeScript(config) => {
- // let node_version = &config.go_version;
- let node_binary_url = &config.node_binary_url;
- let node_binary_checksum = &config.node_binary_checksum;
- let mut install = vec![
- "apt install -y wget".to_string(),
- format!("cd /tmp && wget -q -O node.tar.gz {}", node_binary_url),
- format!("cd /tmp && echo \"{} node.tar.gz\" >> hash_file.txt && cat hash_file.txt", node_binary_checksum),
- "cd /tmp && sha256sum -c hash_file.txt".to_string(),
- "cd /tmp && rm -rf /usr/share/node && mkdir /usr/share/node && tar -C /usr/share/node -xzf node.tar.gz --strip-components=1".to_string(),
- "ls -l /usr/share/node/bin".to_string(),
- "ln -s /usr/share/node/bin/node /usr/bin/node".to_string(),
- "ln -s /usr/share/node/bin/npm /usr/bin/npm".to_string(),
- "ln -s /usr/share/node/bin/npx /usr/bin/npx".to_string(),
- "ln -s /usr/share/node/bin/corepack /usr/bin/corepack".to_string(),
- "apt remove -y wget".to_string(),
- "node --version".to_string(),
- "npm --version".to_string(),
- ];
- if let Some(yarn_version) = &config.yarn_version {
- install.push(format!("npm install --global yarn@{}", yarn_version));
- install.push("ln -s /usr/share/node/bin/yarn /usr/bin/yarn".to_string());
- install.push("yarn --version".to_string());
- }
- install
- }
- LanguageEnv::Java(config) => {
- let is_oracle = config.is_oracle;
- if is_oracle {
- let jdk_version = &config.jdk_version;
- let jdk_binary_url = &config.jdk_binary_url;
- let jdk_binary_checksum = &config.jdk_binary_checksum;
- let mut install = vec![
- "apt install -y wget".to_string(),
- format!("mkdir -p /opt/lib/jvm/jdk-{version}-oracle && mkdir -p /usr/lib/jvm", version = jdk_version),
- format!("cd /tmp && wget -q --output-document jdk.tar.gz {}", jdk_binary_url),
- format!("cd /tmp && echo \"{} jdk.tar.gz\" >> hash_file.txt && cat hash_file.txt", jdk_binary_checksum),
- "cd /tmp && sha256sum -c hash_file.txt".to_string(),
- format!("cd /tmp && tar -zxf jdk.tar.gz -C /opt/lib/jvm/jdk-{version}-oracle --strip-components=1", version = jdk_version),
- format!("ln -s /opt/lib/jvm/jdk-{version}-oracle/bin/java /usr/bin/java", version = jdk_version),
- format!("ln -s /opt/lib/jvm/jdk-{version}-oracle/bin/javac /usr/bin/javac", version = jdk_version),
- "java -version".to_string(),
- "apt remove -y wget".to_string(),
- ];
- if let Some(gradle_config) = &config.gradle {
- let gradle_version = &gradle_config.gradle_version;
- let gradle_binary_url = &gradle_config.gradle_binary_url;
- let gradle_binary_checksum = &gradle_config.gradle_binary_checksum;
-
- install.push("apt install -y wget unzip".to_string());
- install.push(format!(
- "mkdir -p /opt/lib/gradle-{version}",
- version = gradle_version
- ));
- install.push(format!(
- "cd /tmp && wget -q --output-document gradle.tar.gz {}",
- gradle_binary_url
- ));
- install.push(format!("cd /tmp && echo \"{} gradle.tar.gz\" > hash_file.txt && cat hash_file.txt", gradle_binary_checksum));
- install.push("cd /tmp && sha256sum -c hash_file.txt".to_string());
- install.push(format!(
- "cd /tmp && unzip gradle.tar.gz && mv gradle-{version} /opt/lib",
- version = gradle_version
- ));
- install.push(format!(
- "ln -s /opt/lib/gradle-{version}/bin/gradle /usr/bin/gradle",
- version = gradle_version
- ));
- install.push("gradle -version".to_string());
- install.push("apt remove -y wget".to_string());
- }
- return install;
- }
- vec![]
- }
- LanguageEnv::Dotnet(config) => {
- let dotnet_packages = &config.dotnet_packages;
- let deps = config.deps.clone().unwrap_or_default();
- let mut install: Vec = vec![];
- if config.use_backup_version {
- install.push("apt install -y wget".to_string());
- install.push("apt install -y libicu-dev".to_string());
- for package in deps {
- install.push(format!("apt install -y {}", package));
- }
- for package in dotnet_packages {
- install.push(format!("cd /tmp && wget -q {}", package.url));
- install.push(format!("cd /tmp && ls && dpkg -i {}.deb", package.name));
- // check package version
- install.push(format!("cd /tmp && ls && sha1sum {}.deb", package.name));
- install.push(format!(
- "cd /tmp && echo {} {}.deb > hash_file.txt && cat hash_file.txt",
- package.hash, package.name
- ));
- install.push(format!("cd /tmp && sha1sum -c hash_file.txt"));
- }
- install.push("dotnet --version".to_string());
- install.push("apt remove -y wget".to_string());
- } else if self.config.build_env.codename == "bookworm"
- || self.config.build_env.codename == "jammy jellyfish"
- {
- install.push("apt install -y wget".to_string());
- install.push("cd /tmp && wget -q https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb".to_string());
- install.push("cd /tmp && dpkg -i packages-microsoft-prod.deb".to_string());
- install.push("apt update -y".to_string());
- for package in dotnet_packages {
- let pkg = transform_name(&package.name, &self.config.build_env.arch);
- install.push(format!("cd /tmp && wget -q {}", package.url));
- install.push(format!("cd /tmp && apt install -y --allow-downgrades {}", pkg));
- install.push(format!("cd /tmp && apt download -y {}", pkg));
- // check package version
- install.push(format!("cd /tmp && ls && sha1sum {}.deb", package.name));
- install.push(format!(
- "cd /tmp && echo {} {}.deb >> hash_file.txt && cat hash_file.txt",
- package.hash, package.name
- ));
- install.push(format!("cd /tmp && sha1sum -c hash_file.txt"));
- }
- install.push("dotnet --version".to_string());
- install.push("apt remove -y wget".to_string());
- } else if self.config.build_env.codename == "noble numbat" {
- // Note all the previous builds of dotnet fails, as they removed from main repo the dotnet packages
- // when new distrubution 24.10 released
- install.push("apt-get install software-properties-common -y".to_string());
- install.push("add-apt-repository ppa:dotnet/backports".to_string());
- install.push("apt-get update -y".to_string());
- install.push("apt install -y wget".to_string());
- for package in dotnet_packages {
- let pkg = transform_name(&package.name, &self.config.build_env.arch);
- install.push(format!("cd /tmp && wget -q {}", package.url));
- install.push(format!("cd /tmp && apt install -y {}", pkg));
- install.push(format!("cd /tmp && apt download -y {}", pkg));
- // check package version
- install.push(format!("cd /tmp && ls && sha1sum {}.deb", package.name));
- install.push(format!(
- "cd /tmp && echo {} {}.deb >> hash_file.txt && cat hash_file.txt",
- package.hash, package.name
- ));
- install.push(format!("cd /tmp && sha1sum -c hash_file.txt"));
- }
- install.push("dotnet --version".to_string());
- install.push("apt remove -y wget".to_string());
- }
- // validate dotnet packages
- return install;
- }
- LanguageEnv::Nim(config) => {
- let nim_version = &config.nim_version;
- let nim_binary_url = &config.nim_binary_url;
- let nim_version_checksum = &config.nim_version_checksum;
- let install = vec![
- "apt install -y wget".to_string(),
- format!("rm -rf /tmp/nim-{version} && rm -rf /usr/lib/nim/nim-{version}&& rm -rf /opt/lib/nim/nim-{version} && mkdir /tmp/nim-{version}", version = nim_version),
- "mkdir -p /opt/lib/nim && mkdir -p /usr/lib/nim".to_string(),
- format!("cd /tmp && wget -q {}", nim_binary_url),
- format!("cd /tmp && echo {} >> hash_file.txt && cat hash_file.txt", nim_version_checksum),
- "cd /tmp && sha256sum -c hash_file.txt".to_string(),
- format!("cd /tmp && tar xJf nim-{version}-linux_x64.tar.xz -C nim-{version} --strip-components=1", version = nim_version),
- format!("cd /tmp && mv nim-{version} /opt/lib/nim", version = nim_version),
- format!("ln -s /opt/lib/nim/nim-{version}/bin/nim /usr/bin/nim", version = nim_version),
- // equality check not working
- // format!("installed_version=`nim --version | head -n 1 | awk '{{print $4}}'` && echo \"installed version: $installed_version\" && [ \"$installed_version\" != \"{}\" ] && exit 1", nim_version),
- "nim --version".to_string(),
- "apt remove -y wget".to_string(),
- ];
- install
- }
- }
- }
- fn get_build_deps_not_in_debian(&self) -> Vec {
- let package_type = &self.config.package_type;
- let lang_env = match package_type {
- PackageType::Default(config) => Some(&config.language_env),
- PackageType::Git(config) => Some(&config.language_env),
- PackageType::Virtual => None,
- };
- match lang_env {
- None => {
- vec![]
- }
- Some(lang_env) => self.get_build_deps_based_on_langenv(lang_env),
- }
- }
- fn get_test_deps_based_on_langenv(&self, lang_env: &LanguageEnv) -> Vec {
- match lang_env {
- LanguageEnv::C => {
- let lang_deps = vec![];
- lang_deps
- }
- LanguageEnv::Python => {
- let lang_deps = vec![];
- lang_deps
- }
- LanguageEnv::Rust(_) => {
- // rust compiles to binary, no need to install under test_bed
- let lang_deps = vec![];
- lang_deps
- }
- LanguageEnv::Go(_) => {
- // go compiles to binary, no need to install under test_bed
- let lang_deps = vec![];
- lang_deps
- }
- LanguageEnv::JavaScript(_) | LanguageEnv::TypeScript(_) => {
- // do not install node, as we cannot depend on it, make the testbed install it
- // let node_version = &config.go_version;
- let lang_deps = vec![];
- lang_deps
- }
- LanguageEnv::Java(_) => {
- // do not install jdk, or gradle, as we cannot depend on it, make the testbed install it
- // let node_version = &config.go_version;
- let lang_deps = vec![];
- lang_deps
- }
- LanguageEnv::Dotnet(_) => {
- // add ms repo, but do not install dotnet, let test_bed add it as intall dependency
- if self.config.build_env.codename == "bookworm"
- || self.config.build_env.codename == "jammy jellyfish"
- {
- let install = vec![
- "apt install -y wget".to_string(),
- "cd /tmp && wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb".to_string(),
- "cd /tmp && dpkg -i packages-microsoft-prod.deb ".to_string(),
- "apt-get update -y".to_string(),
- "apt remove -y wget".to_string(),
- ];
- install
- } else if self.config.build_env.codename == "noble numbat" {
- return vec![];
- } else {
- return vec![];
- }
- }
- LanguageEnv::Nim(_) => {
- // nim compiles to binary, no need to install under test_bed
- let lang_deps = vec![];
- lang_deps
- }
- }
- }
- fn get_test_deps_not_in_debian(&self) -> Vec {
- let package_type = &self.config.package_type;
- let lang_env = match package_type {
- PackageType::Default(config) => Some(&config.language_env),
- PackageType::Git(config) => Some(&config.language_env),
- PackageType::Virtual => None,
- };
- match lang_env {
- None => {
- vec![]
- }
- Some(lang_env) => self.get_test_deps_based_on_langenv(lang_env),
- }
- }
-
- pub fn get_cache_file(&self) -> String {
- let dir = &self.cache_dir;
- let expanded_path = if dir.starts_with('~') {
- let expanded_path = shellexpand::tilde(dir).to_string();
- expanded_path
- } else if dir.starts_with('/') {
- self.cache_dir.clone()
- } else {
- let parent_dir = env::current_dir().unwrap();
- let dir = parent_dir.join(dir);
- let path = fs::canonicalize(dir.clone()).unwrap();
- let path = path.to_str().unwrap().to_string();
- path
- };
-
- let codename = normalize_codename(&self.config.build_env.codename).unwrap();
- let cache_file_name =
- format!("{}-{}.tar.gz", codename, self.config.build_env.arch).to_string();
- let path = Path::new(&expanded_path);
- let cache_file = path.join(cache_file_name);
- cache_file.to_str().unwrap().to_string()
- }
-
- pub fn get_deb_dir(&self) -> &Path {
- let deb_dir = Path::new(&self.build_files_dir).parent().unwrap();
- deb_dir
- }
- pub fn get_deb_name(&self) -> PathBuf {
- let deb_dir = self.get_deb_dir();
- let deb_file_name = format!(
- "{}_{}-{}_{}.deb",
- self.config.package_fields.package_name,
- self.config.package_fields.version_number,
- self.config.package_fields.revision_number,
- self.config.build_env.arch
- );
- let deb_name = deb_dir.join(deb_file_name);
- deb_name
- }
-
- //hello-world_1.0.0-1_amd64.changes
- pub fn get_changes_file(&self) -> PathBuf {
- let deb_dir = self.get_deb_dir();
- let deb_file_name = format!(
- "{}_{}-{}_{}.changes",
- self.config.package_fields.package_name,
- self.config.package_fields.version_number,
- self.config.package_fields.revision_number,
- self.config.build_env.arch
- );
- let deb_name = deb_dir.join(deb_file_name);
- deb_name
- }
-}
-
-impl BackendBuildEnv for Sbuild {
- fn clean(&self) -> Result<()> {
- let cache_file = self.get_cache_file();
- info!("Cleaning cached build: {}", cache_file);
- let path = Path::new(&cache_file);
- if path.exists() {
- remove_file_or_directory(&cache_file, false)
- .map_err(|_| eyre!("Could not remove previous cache file!"))?;
- }
- Ok(())
- }
-
- fn create(&self) -> Result<()> {
- let mut temp_dir = env::temp_dir();
- let dir_name = format!("temp_{}", random::());
- temp_dir.push(dir_name);
- fs::create_dir(&temp_dir)?;
-
- let cache_file = self.get_cache_file();
- let cache_dir = Path::new(&cache_file).parent().unwrap();
- create_dir_all(cache_dir).map_err(|_| eyre!("Failed to create cache_dir"))?;
- let codename = normalize_codename(&self.config.build_env.codename)?;
-
- let repo_url = get_repo_url(&self.config.build_env.codename.as_str())?;
- let create_result = Command::new("sbuild-createchroot")
- .arg("--chroot-mode=unshare")
- .arg("--make-sbuild-tarball")
- .arg(cache_file)
- .arg(codename)
- .arg(temp_dir)
- .arg(repo_url)
- .status();
-
- if let Err(err) = create_result {
- return Err(eyre!(format!("Failed to create new chroot: {}", err)));
- }
- Ok(())
- }
- fn package(&self) -> Result<()> {
- let codename = normalize_codename(&self.config.build_env.codename)?;
-
- let mut cmd_args = vec![
- "-d".to_string(),
- codename.to_string(),
- "-A".to_string(), // build_arch_all
- "-s".to_string(), // build source
- "--source-only-changes".to_string(), // source_only_changes
- "-c".to_string(), // override cache file location, default is ~/.cache/sbuild both by sbuild and pkg-builder
- self.get_cache_file(),
- "-v".to_string(), // verbose
- "--chroot-mode=unshare".to_string(),
- ];
-
- let mut lang_deps = self.get_build_deps_not_in_debian();
-
- if &self.config.build_env.codename == "noble numbat" {
- lang_deps.push("apt install -y software-properties-common".to_string());
- lang_deps.push("add-apt-repository universe".to_string());
- lang_deps.push("add-apt-repository restricted".to_string());
- lang_deps.push("add-apt-repository multiverse".to_string());
- lang_deps.push("apt update".to_string());
- }
-
- for action in lang_deps.iter() {
- cmd_args.push(format!("--chroot-setup-commands={}", action))
- }
-
- cmd_args.push("--no-run-piuparts".to_string());
- cmd_args.push("--no-apt-upgrade".to_string());
- cmd_args.push("--no-apt-distupgrade".to_string());
-
- if let Some(true) = self.config.build_env.run_lintian {
- cmd_args.push("--run-lintian".to_string());
- cmd_args.push("--lintian-opt=-i".to_string());
- cmd_args.push("--lintian-opt=--I".to_string());
- cmd_args.push("--lintian-opt=--suppress-tags".to_string());
- cmd_args.push("--lintian-opt=bad-distribution-in-changes-file".to_string());
- cmd_args.push("--lintian-opt=--suppress-tags".to_string());
- cmd_args.push("--lintian-opt=debug-file-with-no-debug-symbols".to_string());
- cmd_args.push("--lintian-opt=--tag-display-limit=0".to_string());
- cmd_args.push("--lintian-opts=--fail-on=error".to_string());
- cmd_args.push("--lintian-opts=--fail-on=warning".to_string());
- } else {
- cmd_args.push("--no-run-lintian".to_string());
- }
-
- cmd_args.push("--no-run-autopkgtest".to_string());
-
- info!(
- "Building package by invoking: sbuild {}",
- cmd_args.join(" ")
- );
-
- let mut cmd = Command::new("sbuild")
- .current_dir(self.build_files_dir.clone())
- .args(&cmd_args)
- .stdout(Stdio::inherit())
- .stderr(Stdio::inherit())
- .spawn()?;
- run_process(&mut cmd)?;
-
- if let Some(true) = self.config.build_env.run_piuparts {
- self.run_piuparts()?;
- };
-
- if let Some(true) = self.config.build_env.run_autopkgtest {
- self.run_autopkgtests()?;
- }
-
- Ok(())
- }
-
- fn verify(&self, verify_config: PkgVerifyConfig) -> Result<()> {
- let output_dir = Path::new(&self.build_files_dir).parent().unwrap();
- let package_hash = verify_config.verify.package_hash;
- let mut errors: Vec = vec![];
- for output in package_hash.iter() {
- let file = output_dir.join(output.name.clone());
- if !file.exists() {
- return Err(eyre!(format!(
- "File to be verified does not exist {}",
- output.name
- )));
- }
- let mut file = fs::File::open(file).map_err(|_| eyre!("Could not open file."))?;
- let mut buffer = Vec::new();
- file.read_to_end(&mut buffer)
- .map_err(|_| eyre!("Could not read file."))?;
- let actual_sha1 = calculate_sha1(&*buffer.clone()).unwrap_or_default();
- if actual_sha1 != output.hash {
- errors.push(eyre!(format!(
- "file {} actual sha1 is {}",
- output.name, &actual_sha1
- )));
- }
- }
- let result = if errors.is_empty() {
- println!("Verify is successful!");
- Ok(())
- } else {
- let mut combined_report = errors
- .pop()
- .unwrap_or_else(|| Report::msg("No errors found"));
-
- for report in errors.into_iter() {
- combined_report = combined_report.wrap_err(report);
- }
- Err(combined_report)
- };
- result
- }
-
- fn run_lintian(&self) -> Result<()> {
- info!("Running lintian outside, not as same as on CI..",);
- check_lintian_version(self.config.build_env.lintian_version.clone())?;
- // let deb_dir = self.get_deb_dir();
- let changes_file = self.get_changes_file();
- let changes_file = changes_file.to_str().unwrap();
- let mut cmd_args = vec![
- "--suppress-tags".to_string(),
- "bad-distribution-in-changes-file".to_string(),
- "-i".to_string(),
- "--I".to_string(),
- changes_file.to_string(),
- "--tag-display-limit=0".to_string(),
- "--fail-on=warning".to_string(), // fail on warning
- "--fail-on=error".to_string(), // fail on error
- "--suppress-tags".to_string(), // overrides fails for this message
- "debug-file-with-no-debug-symbols".to_string(),
- ];
- let codename = normalize_codename(&self.config.build_env.codename)?;
-
- if codename == "jammy".to_string() || codename == "noble".to_string() {
- // changed a format of .deb packages on ubuntu, it's not a bug
- // but some lintian will report as such
- cmd_args.push("--suppress-tags".to_string());
- cmd_args.push("malformed-deb-archive".to_string());
- }
-
- info!(
- "Testing package by invoking: lintian {}",
- cmd_args.join(" ")
- );
-
- let mut cmd = Command::new("lintian")
- // for CI
- .args(&cmd_args)
- .stdout(Stdio::inherit())
- .stderr(Stdio::inherit())
- .spawn()?;
- run_process(&mut cmd)
- }
-
- fn run_piuparts(&self) -> Result<()> {
- info!("Running piuparts command with elevated privileges..",);
- info!(
- "Piuparts must run as root user through sudo, please provide your password, if prompted."
- );
- check_piuparts_version(self.config.build_env.piuparts_version.clone())?;
-
- let repo_url = get_repo_url(&self.config.build_env.codename.as_str())?;
- let keyring = get_keyring(&self.config.build_env.codename)?;
- let codename = normalize_codename(&self.config.build_env.codename)?;
-
- let mut cmd_args = vec![
- "-d".to_string(),
- codename.to_string(),
- "-m".to_string(),
- repo_url.to_string(),
- "--bindmount=/dev".to_string(),
- format!("--keyring={}", keyring),
- "--verbose".to_string(),
- ];
- let package_type = &self.config.package_type;
-
- let lang_env = match package_type {
- PackageType::Default(config) => Some(&config.language_env),
- PackageType::Git(config) => Some(&config.language_env),
- PackageType::Virtual => None,
- };
- if let Some(env) = lang_env {
- match env {
- LanguageEnv::Dotnet(_) => {
- if self.config.build_env.codename == "bookworm"
- || self.config.build_env.codename == "jammy jellyfish"
- {
- let ms_repo = format!(
- "deb https://packages.microsoft.com/debian/12/prod {} main",
- self.config.build_env.codename
- );
- cmd_args.push(format!("--extra-repo={}", ms_repo));
- cmd_args.push("--do-not-verify-signatures".to_string());
- } else if self.config.build_env.codename == "noble numbat" {
- }
- }
- _ => {
- // no other package repositories supported
- // might supply my own, but not for now
- }
- }
- }
- let deb_dir = self.get_deb_dir();
- let deb_name = self.get_deb_name();
- info!(
- "Testing package by invoking: sudo -S piuparts {} {}",
- cmd_args.join(" "),
- deb_name.to_str().unwrap()
- );
- info!(
- "Note this command run inside of directory: {}",
- deb_dir.display()
- );
-
- let mut cmd = Command::new("sudo")
- .current_dir(deb_dir)
- // for CI
- .arg("-S")
- .arg("piuparts")
- .args(&cmd_args)
- .arg(deb_name)
- .stdout(Stdio::inherit())
- .stderr(Stdio::inherit())
- .spawn()?;
- run_process(&mut cmd)
- }
-
- fn run_autopkgtests(&self) -> Result<()> {
- info!("Running autopkgtests command outside of build env.",);
- check_autopkgtest_version(self.config.build_env.autopkgtest_version.clone())?;
- let codename = normalize_codename(&self.config.build_env.codename)?;
-
- let image_name = format!(
- "autopkgtest-{}-{}.img",
- codename, self.config.build_env.arch
- );
- let mut cache_dir = self.cache_dir.clone();
- if cache_dir.starts_with('~') {
- cache_dir = shellexpand::tilde(&cache_dir).to_string()
- }
- let image_path = Path::new(&cache_dir).join(image_name.clone());
- create_autopkgtest_image(
- image_path.clone(),
- self.config.build_env.codename.to_string(),
- self.config.build_env.arch.to_string(),
- )?;
-
- let deb_dir = self.get_deb_dir();
- // let deb_name = self.get_deb_name();
- let changes_file = self.get_changes_file();
- let mut cmd_args = vec![
- changes_file.to_str().unwrap().to_string(),
- // this will not going rebuild the package, which we want to avoid
- // as some packages can take an hour to build,
- // we don't want to build for 2 hours
- "--no-built-binaries".to_string(),
- // needed dist-upgrade as testbed is outdated, when new version of distribution released
- "--apt-upgrade".to_string(),
- ];
- let lang_deps = self.get_test_deps_not_in_debian();
-
- for action in lang_deps.iter() {
- cmd_args.push(format!("--setup-commands={}", action))
- }
- cmd_args.push("--".to_string());
- cmd_args.push("qemu".to_string());
- cmd_args.push(image_path.to_str().unwrap().to_string());
- info!(
- "Testing package by invoking: autopkgtest {}",
- cmd_args.join(" ")
- );
- info!(
- "Note this command run inside of directory: {}",
- deb_dir.display()
- );
- let mut cmd = Command::new("autopkgtest")
- .current_dir(deb_dir)
- .args(&cmd_args)
- .stdout(Stdio::inherit())
- .stderr(Stdio::inherit())
- .spawn()?;
- run_process(&mut cmd)
- }
-}
-
-fn check_lintian_version(expected_version: String) -> Result<()> {
- let output = Command::new("lintian").arg("--version").output()?;
-
- if output.status.success() {
- let mut output_str = String::from_utf8_lossy(&output.stdout)
- .to_string()
- .replace("Lintian v", "")
- .replace("\n", "")
- .trim()
- .to_string();
- if let Some(pos) = output_str.find("ubuntu") {
- output_str.truncate(pos);
- output_str = output_str.trim().to_string();
- }
- warn_compare_versions(expected_version, &output_str, "lintian")?;
- Ok(())
- } else {
- Err(eyre!("Failed to execute lintian --version"))
- }
-}
-
-fn check_piuparts_version(expected_version: String) -> Result<()> {
- let output = Command::new("piuparts").arg("--version").output()?;
-
- if output.status.success() {
- let output_str = String::from_utf8_lossy(&output.stdout)
- .to_string()
- .replace("piuparts ", "")
- .replace("\n", "")
- .trim()
- .to_string();
- warn_compare_versions(expected_version, &output_str, "piuparts")?;
- Ok(())
- } else {
- Err(eyre!("Failed to execute piuparts --version"))
- }
-}
-
-fn check_autopkgtest_version(expected_version: String) -> Result<()> {
- let output = Command::new("apt")
- .arg("list")
- .arg("--installed")
- .arg("autopkgtest")
- .output()?;
-
- //autopkgtest/jammy-updates,now 5.32ubuntu3~22.04.1 all [installed]
- if output.status.success() {
- let version: String = String::from_utf8_lossy(&output.stdout)
- .to_string()
- .split_whitespace()
- .find(|s| s.chars().next().unwrap_or(' ').is_digit(10))
- .map(|version| {
- version
- .chars()
- .take_while(|c| c.is_digit(10) || *c == '.')
- .collect()
- })
- .unwrap_or_default();
- info!("autopkgtest version {}", version);
- // append versions, to it looks like semver
- let expected_version = format!("{}.0", expected_version);
- let actual_version = format!("{}.0", version);
- warn_compare_versions(expected_version, &actual_version, "autopkgtest")?;
- Ok(())
- } else {
- Err(eyre!("Failed to execute apt list --installed autopkgtest"))
- }
-}
-
-pub fn warn_compare_versions(
- expected_version: String,
- actual_version: &str,
- program_name: &str,
-) -> Result<()> {
- let expected_version = Version::parse(&expected_version).unwrap();
- let actual_version = Version::parse(actual_version).unwrap();
- match expected_version.cmp(&actual_version) {
- std::cmp::Ordering::Less => {
- warn!("Warning: using newer versions than expected version.");
- Ok(())
- }
- std::cmp::Ordering::Greater => {
- warn!("Using older version of {}", program_name);
- Ok(())
- }
- std::cmp::Ordering::Equal => {
- info!("Versions match. Proceeding.");
- Ok(())
- }
- }
-}
-
-pub fn normalize_codename(codename: &str) -> Result<&str> {
- match codename {
- "bookworm" => Ok("bookworm"),
- "noble numbat" => Ok("noble"),
- "jammy jellyfish" => Ok("jammy"),
- _ => Err(eyre!("Not supported distribution")),
- }
-}
-
-pub fn get_keyring(codename: &str) -> Result<&str> {
- match codename {
- "bookworm" => Ok("/usr/share/keyrings/debian-archive-keyring.gpg"),
- "noble numbat" | "jammy jellyfish" => Ok("/usr/share/keyrings/ubuntu-archive-keyring.gpg"),
- _ => Err(eyre!("Not supported distribution")),
- }
-}
-
-pub fn get_repo_url(codename: &str) -> Result<&str> {
- match codename {
- "bookworm" => Ok("http://deb.debian.org/debian"),
- "noble numbat" | "jammy jellyfish" => Ok("http://archive.ubuntu.com/ubuntu"),
- _ => Err(eyre!("Not supported distribution")),
- }
-}
-
-pub fn calculate_sha1(mut reader: R) -> Result {
- let mut hasher = Sha1::new();
- io::copy(&mut reader, &mut hasher)?;
- let digest_bytes = hasher.finalize();
- let hex_digest = digest_bytes
- .iter()
- .map(|b| format!("{:02x}", b))
- .collect::();
-
- Ok(hex_digest)
-}
-
-fn create_autopkgtest_image(image_path: PathBuf, codename: String, arch: String) -> Result<()> {
- // do not recreate image if exists
- if image_path.exists() {
- return Ok(());
- }
- info!("autopkgtests environment does not exist. Creating it.");
- info!("please provide your password through sudo to as autopkgtest env creation requires it.");
- create_dir_all(image_path.parent().unwrap())?;
- let repo_url = get_repo_url(&codename)?;
-
- match codename.as_str() {
- "bookworm" => {
- let codename = normalize_codename(&codename)?;
- let cmd_args = vec![
- codename.to_string(),
- image_path.to_str().unwrap().to_string(),
- format!("--mirror={}", repo_url),
- format!("--arch={}", arch),
- ];
- let mut cmd = Command::new("sudo")
- // for CI
- .arg("-S")
- .arg("autopkgtest-build-qemu")
- .args(&cmd_args)
- .stdout(Stdio::inherit())
- .stderr(Stdio::inherit())
- .spawn()?;
- run_process(&mut cmd)
- }
- "noble numbat" | "jammy jellyfish" => {
- let codename = normalize_codename(&codename)?;
- let cmd_args = vec![
- format!("--release={}", codename.to_string()),
- format!("--mirror={}", repo_url),
- format!("--arch={}", arch),
- "-v".to_string(),
- ];
- let mut cmd = Command::new("sudo")
- // for CI
- .arg("-S")
- .arg("autopkgtest-buildvm-ubuntu-cloud")
- .args(&cmd_args)
- .current_dir(image_path.parent().unwrap().to_str().unwrap())
- .stdout(Stdio::inherit())
- .stderr(Stdio::inherit())
- .spawn()?;
- run_process(&mut cmd)
- }
- _ => Err(eyre!("Not supported distribution")),
- }
-}
-
-fn run_process(child: &mut Child) -> Result<()> {
- if let Some(stdout) = child.stdout.take() {
- let reader = BufReader::new(stdout);
-
- for line in reader.lines() {
- let line = line?;
- info!("{}", line);
- }
- }
- io::stdout().flush()?;
-
- let status = child.wait().map_err(|err| eyre!(err.to_string()))?;
- if status.success() {
- Ok(())
- } else {
- Err(eyre!("Sbuild exited with non-zero status code. Please see build output for potential causes."))
- }
-}
-
-fn remove_file_or_directory(path: &str, is_directory: bool) -> io::Result<()> {
- if is_directory {
- fs::remove_dir_all(path)?;
- } else {
- fs::remove_file(path)?;
- }
- Ok(())
-}
-
-fn transform_name(input: &str, arch: &str) -> String {
- if let Some(pos) = input.find(format!("_{}", arch).as_str()) {
- let trimmed = &input[..pos];
- trimmed.replace('_', "=")
- } else {
- input.replace('_', "=")
- }
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
- use env_logger::Env;
- use std::fs::File;
- use std::sync::Once;
- use tempfile::tempdir;
-
- static INIT: Once = Once::new();
-
- // Set up logging for tests
- fn setup() {
- INIT.call_once(|| {
- env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
- });
- }
-
- #[test]
- fn test_clean_sbuild_env_when_file_does_not_exist() {
- setup();
- let mut pkg_config = PkgConfig::default();
- let build_files_dir = tempdir().unwrap().path().to_str().unwrap().to_string();
- pkg_config.build_env.codename = "bookworm".to_string();
- pkg_config.build_env.arch = "amd64".to_string();
- let sbuild_cache_dir = tempdir().unwrap().path().to_str().unwrap().to_string();
- pkg_config.build_env.sbuild_cache_dir = Some(sbuild_cache_dir);
- let build_env = Sbuild::new(pkg_config, build_files_dir);
- let result = build_env.clean();
- assert!(result.is_ok());
- let cache_file = build_env.get_cache_file();
- let cache_file_path = Path::new(&cache_file);
- assert!(!cache_file_path.exists())
- }
-
- #[test]
- fn test_clean_sbuild_env() {
- setup();
- let mut pkg_config = PkgConfig::default();
- let build_files_dir = tempdir().unwrap().path().to_str().unwrap().to_string();
- pkg_config.build_env.codename = "bookworm".to_string();
- pkg_config.build_env.arch = "amd64".to_string();
- let sbuild_cache = tempdir().unwrap();
- // create dir manually, as it doesn't exist
- create_dir_all(sbuild_cache.path())
- .expect("Could not create temporary directory for testing.");
- let sbuild_cache_dir = sbuild_cache.path().to_str().unwrap().to_string();
- pkg_config.build_env.sbuild_cache_dir = Some(sbuild_cache_dir.clone());
- let build_env = Sbuild::new(pkg_config, build_files_dir);
- let cache_file = build_env.get_cache_file();
- let cache_file_path = Path::new(&cache_file);
-
- File::create(cache_file_path)
- .expect("File needs to be created manually before testing deletion.");
- assert!(Path::new(&sbuild_cache_dir).exists(),);
-
- assert!(
- cache_file_path.exists(),
- "File should exist before testing deletion."
- );
-
- let result = build_env.clean();
- assert!(result.is_ok());
- assert!(!cache_file_path.exists())
- }
-
- #[test]
- fn test_create_sbuild_env() {
- setup();
- let mut pkg_config = PkgConfig::default();
- pkg_config.build_env.codename = "bookworm".to_string();
- pkg_config.build_env.arch = "amd64".to_string();
- let sbuild_cache_dir = tempdir().unwrap().path().to_str().unwrap().to_string();
- pkg_config.build_env.sbuild_cache_dir = Some(sbuild_cache_dir);
-
- let build_files_dir = tempdir().unwrap().path().to_str().unwrap().to_string();
- let build_env = Sbuild::new(pkg_config, build_files_dir);
- build_env.clean().expect("Could not clean previous env.");
- let cache_file = build_env.get_cache_file();
- let cache_file_path = Path::new(&cache_file);
- assert!(!cache_file_path.exists());
- let result = build_env.create();
- assert!(result.is_ok());
- assert!(cache_file_path.exists())
- }
-}
diff --git a/src/v1/build/sbuild_packager.rs b/src/v1/build/sbuild_packager.rs
deleted file mode 100644
index 1df123c5..00000000
--- a/src/v1/build/sbuild_packager.rs
+++ /dev/null
@@ -1,138 +0,0 @@
-use crate::v1::build::sbuild::Sbuild;
-use crate::v1::packager::{BackendBuildEnv, Packager};
-
-use eyre::{Result};
-
-use crate::v1::pkg_config::{PackageType, PkgConfig};
-use log::info;
-use std::path::PathBuf;
-use crate::v1::build::dir_setup::{*};
-
-pub struct SbuildPackager {
- config: PkgConfig,
- source_to_patch_from_path: String,
- debian_artifacts_dir: String,
- debian_orig_tarball_path: String,
- build_files_dir: String,
- config_root: String,
-}
-
-impl Packager for SbuildPackager {
- type BuildEnv = Sbuild;
-
- fn new(config: PkgConfig, config_root: String) -> Self {
- let package_fields = config.package_fields.clone();
- let config_root_path = PathBuf::from(&config_root);
- let source_to_patch_from_path = config_root_path.join("src").to_str().unwrap().to_string();
- let workdir = config
- .build_env
- .workdir
- .clone()
- .unwrap_or(format!("~/.pkg-builder/packages/{}", config.build_env.codename));
- let workdir = expand_path(&workdir, None);
- let debian_artifacts_dir = get_build_artifacts_dir(&package_fields.package_name, &workdir, &package_fields.version_number, &package_fields.revision_number);
- let debian_orig_tarball_path = get_tarball_path(
- &package_fields.package_name,
- &package_fields.version_number,
- &debian_artifacts_dir,
- );
- let build_files_dir = get_build_files_dir(
- &package_fields.package_name,
- &package_fields.version_number,
- &debian_artifacts_dir,
- );
- let mut updated_config = SbuildPackager {
- config,
- source_to_patch_from_path,
- build_files_dir,
- debian_artifacts_dir,
- debian_orig_tarball_path,
- config_root,
- };
- updated_config.config.build_env.workdir = Some(workdir);
- let spec_file = package_fields.spec_file;
- let spec_file_canonical = config_root_path.join(spec_file);
- updated_config.config.package_fields.spec_file =
- spec_file_canonical.to_str().unwrap().to_string();
- updated_config
- }
-
- fn package(&self) -> Result<()> {
- let pre_build: Result<()> = match &self.config.package_type {
- PackageType::Default(config) => {
- create_package_dir(&self.debian_artifacts_dir.clone())?;
- download_source(
- &self.debian_orig_tarball_path,
- &config.tarball_url,
- &self.config_root,
- )?;
- verify_hash(&self.debian_orig_tarball_path, config.tarball_hash.clone())?;
- extract_source(&self.debian_orig_tarball_path, &self.build_files_dir)?;
- create_debian_dir(
- &self.build_files_dir.clone(),
- &self.config.build_env.debcrafter_version,
- &self.config.package_fields.spec_file,
- )?;
- patch_source(
- &self.build_files_dir.clone(),
- &self.config.package_fields.homepage,
- &self.source_to_patch_from_path,
- )?;
- setup_sbuild()?;
- Ok(())
- }
- PackageType::Git(config) => {
- create_package_dir(&self.debian_artifacts_dir.clone())?;
- download_git(
- &self.debian_artifacts_dir,
- &self.debian_orig_tarball_path,
- &self.config.package_fields.package_name,
- &config.git_url,
- &config.git_tag,
- &config.submodules,
- )?;
- extract_source(&self.debian_orig_tarball_path, &self.build_files_dir)?;
- create_debian_dir(
- &self.build_files_dir.clone(),
- &self.config.build_env.debcrafter_version,
- &self.config.package_fields.spec_file,
- )?;
- patch_source(
- &self.build_files_dir.clone(),
- &self.config.package_fields.homepage,
- &self.source_to_patch_from_path,
- )?;
- setup_sbuild()?;
- Ok(())
- }
- PackageType::Virtual => {
- info!("creating virtual package");
- create_package_dir(&self.debian_artifacts_dir.clone())?;
- create_empty_tar(&self.debian_artifacts_dir, &self.debian_orig_tarball_path)?;
- extract_source(&self.debian_orig_tarball_path, &self.build_files_dir)?;
- create_debian_dir(
- &self.build_files_dir.clone(),
- &self.config.build_env.debcrafter_version,
- &self.config.package_fields.spec_file,
- )?;
- patch_source(
- &self.build_files_dir.clone(),
- &self.config.package_fields.homepage,
- &self.source_to_patch_from_path,
- )?;
- setup_sbuild()?;
- Ok(())
- }
- };
- pre_build?;
- let build_env = self.get_build_env().unwrap();
- build_env.package()?;
- Ok(())
- }
-
- fn get_build_env(&self) -> Result {
- let backend_build_env = Sbuild::new(self.config.clone(), self.build_files_dir.clone());
- Ok(backend_build_env)
- }
-}
-
diff --git a/src/v1/cli.rs b/src/v1/cli.rs
deleted file mode 100644
index 8dc1b38d..00000000
--- a/src/v1/cli.rs
+++ /dev/null
@@ -1,193 +0,0 @@
-use super::args::{ActionType, BuildEnvSubCommand, PkgBuilderArgs};
-use super::packager::DistributionPackager;
-use crate::v1::pkg_config::{get_config, PkgConfig};
-use clap::Parser;
-use env_logger::Env;
-use eyre::{eyre, Result};
-use std::{env, fs, path::Path};
-use std::process::Command;
-use cargo_metadata::semver;
-use log::{error, info, warn};
-use crate::v1::pkg_config_verify::PkgVerifyConfig;
-use semver::Version;
-use regex::Regex;
-
-const CONFIG_FILE_NAME: &str = "pkg-builder.toml";
-const VERIFY_CONFIG_FILE_NAME: &str = "pkg-builder-verify.toml";
-
-
-pub fn run_cli() -> Result<()> {
- let args = PkgBuilderArgs::parse();
- env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
- let program_name: &str = env!("CARGO_PKG_NAME");
- let program_version: &str = env!("CARGO_PKG_VERSION");
- match args.action {
- ActionType::Verify(command) => {
- let config_file = get_config_file(command.config, CONFIG_FILE_NAME)?;
- let config = get_config::(config_file.clone())?;
-
- fail_compare_versions(config.build_env.pkg_builder_version.clone(), program_version, program_name)?;
-
- let distribution = get_distribution(config, config_file)?;
- let verify_config_file = get_config_file(command.verify_config, VERIFY_CONFIG_FILE_NAME)?;
- let verify_config_file = get_config::(verify_config_file.clone())?;
- let no_package = command.no_package.unwrap_or_default();
- distribution.verify(verify_config_file, !no_package)?;
- }
- ActionType::Lintian(command) => {
- let config_file = get_config_file(command.config, CONFIG_FILE_NAME)?;
- let config = get_config::(config_file.clone())?;
-
- fail_compare_versions(config.build_env.pkg_builder_version.clone(), program_version, program_name)?;
-
- let distribution = get_distribution(config, config_file)?;
- distribution.run_lintian()?;
- }
- ActionType::Piuparts(command) => {
- let config_file = get_config_file(command.config, CONFIG_FILE_NAME)?;
- let config = get_config::(config_file.clone())?;
- fail_compare_versions(config.build_env.pkg_builder_version.clone(), program_version, program_name)?;
-
- let distribution = get_distribution(config, config_file)?;
- distribution.run_piuparts()?;
- }
- ActionType::Autopkgtest(command) => {
- let config_file = get_config_file(command.config, CONFIG_FILE_NAME)?;
- let config = get_config::(config_file.clone())?;
- fail_compare_versions(config.build_env.pkg_builder_version.clone(), program_version, program_name)?;
-
- let distribution = get_distribution(config, config_file)?;
- distribution.run_autopkgtests()?;
- }
- ActionType::Package(command) => {
- let config_file = get_config_file(command.config, CONFIG_FILE_NAME)?;
- let mut config = get_config::(config_file.clone())?;
- fail_compare_versions(config.build_env.pkg_builder_version.clone(), program_version, program_name)?;
-
- check_sbuild_version(config.build_env.sbuild_version.clone())?;
- if let Some(run_piuparts) = command.run_piuparts {
- config.build_env.run_piuparts = Some(run_piuparts);
- }
- if let Some(run_autopkgttests) = command.run_autopkgtest {
- config.build_env.run_autopkgtest = Some(run_autopkgttests);
- }
- if let Some(run_lintian) = command.run_lintian {
- config.build_env.run_lintian = Some(run_lintian);
- }
- let distribution = get_distribution(config, config_file)?;
- distribution.package()?;
- }
- ActionType::Env(build_env_action) => {
- match build_env_action.build_env_sub_command {
- BuildEnvSubCommand::Create(sub_command) => {
- let config_file = get_config_file(sub_command.config, CONFIG_FILE_NAME)?;
- let config = get_config::(config_file.clone())?;
- fail_compare_versions(config.build_env.pkg_builder_version.clone(), program_version, program_name)?;
-
- let distribution = get_distribution(config, config_file)?;
- distribution.create_build_env()?;
- }
- BuildEnvSubCommand::Clean(sub_command) => {
- let config_file = get_config_file(sub_command.config, CONFIG_FILE_NAME)?;
- let config = get_config::(config_file.clone())?;
- fail_compare_versions(config.build_env.pkg_builder_version.clone(), program_version, program_name)?;
- let distribution = get_distribution(config, config_file)?;
- distribution.clean_build_env()?;
- }
- };
- }
- ActionType::Version => {
- println!("Version: {}", env!("CARGO_PKG_VERSION"));
- }
- }
- Ok(())
-}
-
-pub fn check_sbuild_version(expected_version: String) -> Result<()> {
- let output = Command::new("sbuild")
- .arg("--version")
- .output()?;
-
- if output.status.success() {
- let actual_version = String::from_utf8_lossy(&output.stdout).to_string();
- let actual_version = get_first_line(&actual_version);
- let actual_version = extract_version(actual_version).unwrap();
- info!("sbuild version {}", actual_version);
- fail_compare_versions(expected_version, &actual_version, "sbuild")?;
- Ok(())
- } else {
- Err(eyre!("Failed to execute sbuild --version"))
- }
-}
-
-fn extract_version(input: &str) -> Option<&str> {
- // Define a regular expression pattern to match the version number
- let re = Regex::new(r"sbuild \(Debian sbuild\) ([\d.]+)").unwrap();
-
- // Use the regular expression to capture the version number
- if let Some(captures) = re.captures(input) {
- if let Some(version) = captures.get(1) {
- return Some(version.as_str());
- }
- }
- None
-}
-fn get_first_line(text: &str) -> &str {
- text.split_once('\n').map_or(text, |(first_line, _rest)| first_line)
-}
-
-pub fn fail_compare_versions(expected_version: String, actual_version: &str, program_name: &str) -> Result<()> {
- let expected_version = Version::parse(&expected_version).unwrap();
- let actual_version = Version::parse(actual_version).unwrap();
- match expected_version.cmp(&actual_version) {
- std::cmp::Ordering::Less => {
- warn!("Warning: {} using newer versions than expected version.", program_name);
- Ok(())
- }
- std::cmp::Ordering::Greater => {
- error!("Error: Actual version is less than expected. Halting. Please install newer version.");
- Err(eyre!("{} version is older than expected.!", program_name))
- }
- std::cmp::Ordering::Equal => {
- info!("{} versions match. Proceeding.", program_name);
- Ok(())
- }
- }
-}
-
-pub fn get_distribution(config: PkgConfig, config_file_path: String) -> Result {
- let path = Path::new(&config_file_path);
- let config_file_path = fs::canonicalize(path)?;
- let config_root = config_file_path
- .parent()
- .unwrap()
- .to_str()
- .unwrap()
- .to_string();
- Ok(DistributionPackager::new(config, config_root))
-}
-
-
-pub fn get_config_file(config: Option, config_file_name: &str) -> Result {
- return if let Some(location) = config {
- let path = Path::new(&location);
- if !path.exists() {
- return Err(eyre!("Directory or file does not exist {}", location));
- }
- if path.is_dir() {
- let config_file = path.join(config_file_name);
- if config_file.exists() {
- return Ok(config_file.to_str().unwrap().to_string());
- }
- return Err(eyre!("Could not find {} in dir: {}", config_file_name, path.to_str().unwrap()));
- }
- Ok(location)
- } else {
- let path = env::current_dir().unwrap();
- let config_file = path.join(config_file_name);
- if config_file.exists() {
- return Ok(config_file.to_str().unwrap().to_string());
- }
- Err(eyre!("Could not find {} in current directory.", config_file_name))
- };
-}
\ No newline at end of file
diff --git a/src/v1/mod.rs b/src/v1/mod.rs
deleted file mode 100644
index 7c8ad0cf..00000000
--- a/src/v1/mod.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-// src/v1/mod.rs
-pub mod cli;
-pub mod build;
-pub mod packager;
-mod args;
-pub mod pkg_config;
-pub mod pkg_config_verify;
diff --git a/src/v1/packager.rs b/src/v1/packager.rs
deleted file mode 100644
index e0f6e16d..00000000
--- a/src/v1/packager.rs
+++ /dev/null
@@ -1,175 +0,0 @@
-use eyre::{eyre, Result};
-use crate::v1::build::sbuild_packager::SbuildPackager;
-
-
-use crate::v1::pkg_config::PkgConfig;
-use crate::v1::pkg_config_verify::PkgVerifyConfig;
-
-
-pub trait Packager {
- type BuildEnv: BackendBuildEnv;
- fn new(config: PkgConfig, config_root: String) -> Self;
- fn package(&self) -> Result<()>;
- fn get_build_env(&self) -> Result;
-}
-
-pub struct DistributionPackager {
- config: PkgConfig,
- config_root: String,
-}
-
-pub trait BackendBuildEnv {
- fn clean(&self) -> Result<()>;
- fn create(&self) -> Result<()>;
- fn package(&self) -> Result<()>;
-
- fn verify(&self, verify_config: PkgVerifyConfig) -> Result<()>;
-
- fn run_lintian(&self) -> Result<()>;
- fn run_piuparts(&self) -> Result<()>;
- fn run_autopkgtests(&self) -> Result<()>;
-}
-
-impl DistributionPackager {
- pub fn new(config: PkgConfig, config_root: String) -> Self {
- DistributionPackager {
- config,
- config_root,
- }
- }
- pub fn package(&self) -> Result<()> {
- let config = self.config.clone();
-
- match self.config.build_env.codename.clone().as_str() {
- "bookworm" | "noble numbat" | "jammy jellyfish" => {
- let packager = SbuildPackager::new(config, self.config_root.clone());
- packager.package()?;
- }
- invalid_codename => {
- return Err(eyre!(format!(
- "Invalid codename '{}' specified",
- invalid_codename
- )));
- }
- }
- Ok(())
- }
- pub fn run_lintian(&self) -> Result<()> {
- let config = self.config.clone();
-
- match self.config.build_env.codename.clone().as_str() {
- "bookworm" | "noble numbat" | "jammy jellyfish" => {
- let packager = SbuildPackager::new(config, self.config_root.clone());
- let build_env = packager.get_build_env()?;
- build_env.run_lintian()?;
- }
- invalid_codename => {
- return Err(eyre!(format!(
- "Invalid codename '{}' specified",
- invalid_codename
- )));
- }
- }
- Ok(())
- }
- pub fn run_piuparts(&self) -> Result<()> {
- let config = self.config.clone();
-
- match self.config.build_env.codename.clone().as_str() {
- "bookworm" | "noble numbat" | "jammy jellyfish" => {
- let packager = SbuildPackager::new(config, self.config_root.clone());
- let build_env = packager.get_build_env()?;
- build_env.run_piuparts()?;
- }
- invalid_codename => {
- return Err(eyre!(format!(
- "Invalid codename '{}' specified",
- invalid_codename
- )));
- }
- }
- Ok(())
- }
- pub fn run_autopkgtests(&self) -> Result<()> {
- let config = self.config.clone();
-
- match self.config.build_env.codename.clone().as_str() {
- "bookworm" | "noble numbat" | "jammy jellyfish" => {
- let packager = SbuildPackager::new(config, self.config_root.clone());
- let build_env = packager.get_build_env()?;
- build_env.run_autopkgtests()?;
- }
- invalid_codename => {
- return Err(eyre!(format!(
- "Invalid codename '{}' specified",
- invalid_codename
- )));
- }
- }
- Ok(())
- }
- pub fn clean_build_env(&self) -> Result<()> {
- let config = self.config.clone();
-
- match self.config.build_env.codename.clone().as_str() {
- "bookworm" | "noble numbat" | "jammy jellyfish" => {
- let packager = SbuildPackager::new(config, self.config_root.clone());
-
- let build_env = packager.get_build_env()?;
- build_env.clean()?;
- }
- invalid_codename => {
- return Err(eyre!(format!(
- "Invalid codename '{}' specified",
- invalid_codename
- )));
- }
- }
- Ok(())
- }
- pub fn create_build_env(&self) -> Result<()> {
- let config = self.config.clone();
-
- match self.config.build_env.codename.clone().as_str() {
- "bookworm" | "noble numbat" | "jammy jellyfish" => {
- let packager = SbuildPackager::new(config, self.config_root.clone());
- let build_env = packager.get_build_env()?;
- build_env.create()?;
- }
- invalid_codename => {
- return Err(eyre!(format!(
- "Invalid codename '{}' specified",
- invalid_codename
- )));
- }
- }
- Ok(())
- }
-
- pub fn verify(&self, verify_config: PkgVerifyConfig, package: bool) -> Result<()> {
- let config = self.config.clone();
-
- match self.config.build_env.codename.clone().as_str() {
- "bookworm" | "noble numbat" | "jammy jellyfish" => {
- let mut config = config.clone();
- config.build_env.run_autopkgtest = Some(false);
- config.build_env.run_lintian = Some(false);
- config.build_env.run_piuparts = Some(false);
- let packager = SbuildPackager::new(config, self.config_root.clone());
- if package {
- packager.package()?;
- }
- let build_env = packager.get_build_env()?;
- // files to verify
- build_env.verify(verify_config)?;
- }
- invalid_codename => {
- return Err(eyre!(format!(
- "Invalid codename '{}' specified",
- invalid_codename
- )));
- }
- }
- Ok(())
- }
-}
diff --git a/src/v1/pkg_config.rs b/src/v1/pkg_config.rs
deleted file mode 100644
index ab994f3f..00000000
--- a/src/v1/pkg_config.rs
+++ /dev/null
@@ -1,951 +0,0 @@
-use std::fs;
-use std::path::Path;
-use eyre::{eyre, Report, Result};
-use serde::{Deserialize, Deserializer};
-use std::str::FromStr;
-use serde::de::DeserializeOwned;
-
-pub fn deserialize_option_empty_string<'de, T, D>(deserializer: D) -> Result