Skip to content

Commit

Permalink
Add rust to build packages (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
sed-i authored Aug 9, 2024
1 parent 80eb940 commit bf78b58
Showing 1 changed file with 8 additions and 5 deletions.
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

0 comments on commit bf78b58

Please sign in to comment.