Sets up initial Rust project with ARM64 deployment
Introduces the `rustylee` Rust project with a basic "Hello, world!" application. Configures cross-compilation for `aarch64-unknown-linux-gnu` targets using `cargo.toml`. Adds a deployment script to automate pushing the compiled ARM64 binary to a remote host. This enables development and deployment of Rust applications for the target environment.
This commit is contained in:
parent
2125e936dc
commit
d452578afc
6 changed files with 50 additions and 0 deletions
2
src/rustylee/.cargo/config.toml
Normal file
2
src/rustylee/.cargo/config.toml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
[target.aarch64-unknown-linux-gnu]
|
||||||
|
linker = "aarch64-linux-gnu-gcc"
|
||||||
8
src/rustylee/.gitignore
vendored
Normal file
8
src/rustylee/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
# The build directory where all the binaries and object files live
|
||||||
|
/target
|
||||||
|
|
||||||
|
# If you ever use a tool like 'cargo expand' or 'cargo profiler'
|
||||||
|
**/*.rs.bk
|
||||||
|
|
||||||
|
# If you use a local IDE setting that shouldn't be shared
|
||||||
|
.idea/
|
||||||
7
src/rustylee/Cargo.lock
generated
Normal file
7
src/rustylee/Cargo.lock
generated
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 4
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustylee"
|
||||||
|
version = "0.1.0"
|
||||||
6
src/rustylee/Cargo.toml
Normal file
6
src/rustylee/Cargo.toml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
[package]
|
||||||
|
name = "rustylee"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
3
src/rustylee/src/main.rs
Normal file
3
src/rustylee/src/main.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
fn main() {
|
||||||
|
println!("Hello, world!");
|
||||||
|
}
|
||||||
24
utils/deploy_rustylee
Executable file
24
utils/deploy_rustylee
Executable file
|
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Configuration
|
||||||
|
# Note: We point to the specific ARM64 release folder Cargo created
|
||||||
|
LOCAL_BIN="$HOME/dev/Dixon/src/rustylee/target/aarch64-unknown-linux-gnu/release/rustylee"
|
||||||
|
REMOTE_TARGET="russellg59@dixon1"
|
||||||
|
REMOTE_DIR="/home/russellg59/dixon"
|
||||||
|
REMOTE_EXE="$REMOTE_DIR/rustylee" # Changed to avoid overwriting your C++ app
|
||||||
|
|
||||||
|
|
||||||
|
# Check if the monster PC actually finished the build
|
||||||
|
if [ ! -f "$LOCAL_BIN" ]; then
|
||||||
|
echo "Error: Binary not found at $LOCAL_BIN"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Cleaning remote path and pushing binary..."
|
||||||
|
|
||||||
|
# Remove the target first to prevent the 'directory' bug, then push and fix permissions
|
||||||
|
ssh $REMOTE_TARGET "rm -rf $REMOTE_EXE"
|
||||||
|
scp "$LOCAL_BIN" $REMOTE_TARGET:"$REMOTE_EXE"
|
||||||
|
ssh $REMOTE_TARGET "chmod +x $REMOTE_EXE"
|
||||||
|
|
||||||
|
echo "Deployment complete: $REMOTE_EXE"
|
||||||
Loading…
Reference in a new issue