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

feat: rename app binary #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "env-exporter"
name = "snappy-env"
version = "0.1.0"
edition = "2021"

Expand Down
22 changes: 11 additions & 11 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ apps:
environment:
env_alias: app-bash
command-chain:
- bin/env-exporter.sh
- bin/snappy-env.sh
command: bin/env.sh

# App using Rust implementation
app-rust:
environment:
env_alias: app-rust
command-chain:
- bin/env-exporter
- bin/snappy-env
command: bin/env.sh

# App without using snappy-env, for benchmarking purposes
Expand All @@ -33,17 +33,17 @@ parts:
plugin: dump
source: snap/local

env-exporter-bash:
snappy-env-bash:
plugin: dump
source: env-exporter.sh
source: snappy-env.sh
source-type: file
organize:
env-exporter.sh: bin/env-exporter.sh
snappy-env.sh: bin/snappy-env.sh

env-exporter-rust:
snappy-env-rust:
plugin: nil
source: .
build-snaps:
build-snaps:
- rustup
build-packages:
- upx-ucl # for binary compression
Expand All @@ -55,8 +55,8 @@ parts:
rustup target add $TARGET
cargo build --target $TARGET --release
mkdir -p $SNAPCRAFT_PART_INSTALL/bin

# compress the binary
upx --best --lzma target/$TARGET/release/env-exporter
cp target/$TARGET/release/env-exporter $SNAPCRAFT_PART_INSTALL/bin
upx --best --lzma target/$TARGET/release/snappy-env
cp target/$TARGET/release/snappy-env $SNAPCRAFT_PART_INSTALL/bin

File renamed without changes.
2 changes: 1 addition & 1 deletion tests/initialize
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ inject_test_app() {
"env_alias": "app-rust-2"
},
"command-chain": [
"bin/env-exporter"
"bin/snappy-env"
],
"command": "bin/env.sh"
}' -i "snap/snapcraft.yaml"
Expand Down
6 changes: 3 additions & 3 deletions tests/test-snappyenv
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ sudo -u "$SUDO_USER" yq '.apps.app-rust-2 = {
"env_alias": "app-rust-2"
},
"command-chain": [
"bin/env-exporter"
"bin/snappy-env"
],
"command": "bin/env.sh"
}' -i "snap/snapcraft.yaml"

unsquashfs "${PROJECT_ROOT}/${SNAP}.snap"

echo "Check that the env-exporter program is present"
[ -f squashfs-root/bin/env-exporter ] || fail
echo "Check that the snappy-env program is present"
[ -f squashfs-root/bin/snappy-env ] || fail

echo "Check that the exec-env script is present"
[ -f squashfs-root/bin/env.sh ] || fail
Expand Down
Loading