Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rust to build packages #155

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ bases:
- build-on:
- name: "ubuntu"
channel: "20.04"
run-on:
run-on:
- name: "ubuntu"
channel: "20.04"
- build-on:
Expand All @@ -16,6 +16,9 @@ parts:
charm:
build-packages:
- "git"
# rustc and cargo required to build pydantic
- rustc
- cargo
charm-binary-python-packages:
# Install PyYAML from binary and avoid building it from sources. This way, we can use PyYAML with C-optimized lib.
# With the C-optimized lib, serialization in ops is 20x faster.
Expand All @@ -26,10 +29,10 @@ parts:
build-packages:
- curl
override-pull: |
if [ $CRAFT_TARGET_ARCH == "amd64" ]; then
if [ $CRAFT_ARCH_BUILD_FOR == "amd64" ]; then
URI=https://github.com/canonical/nrpe_exporter/releases/latest/download/nrpe_exporter-amd64
curl -L $URI -o nrpe_exporter-amd64
elif [ $CRAFT_TARGET_ARCH == "arm64" ] || [ $CRAFT_TARGET_ARCH == "aarch64" ]; then
elif [ $CRAFT_ARCH_BUILD_FOR == "arm64" ] || [ $CRAFT_ARCH_BUILD_FOR == "aarch64" ]; then
URI=https://github.com/canonical/nrpe_exporter/releases/latest/download/nrpe_exporter-arm64
curl -L $URI -o nrpe_exporter-aarch64
fi
Expand All @@ -41,9 +44,9 @@ parts:
- tar
override-pull: |
VERSION=0.36.0
if [ $CRAFT_TARGET_ARCH == "amd64" ]; then
if [ $CRAFT_ARCH_BUILD_FOR == "amd64" ]; then
ARCH=x86_64-unknown-linux-musl
elif [ $CRAFT_TARGET_ARCH == "arm64" ]; then
elif [ $CRAFT_ARCH_BUILD_FOR == "arm64" ]; then
ARCH=aarch64-unknown-linux-musl
fi

Expand Down
Loading