Skip to content

Commit

Permalink
segregate out rust vars
Browse files Browse the repository at this point in the history
They should be set on Ubuntu, but not Nix: for Nix, .cargo and .rustup
should be within project repo to not pollute system.
  • Loading branch information
Lederstrumpf committed Nov 4, 2024
1 parent c7e3e96 commit a2f8a40
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
4 changes: 0 additions & 4 deletions scripts/.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
RUST_VERSION=1.77.0
RUSTUP_HOME=~/.rustup
CARGO_HOME=~/.cargo

CMAKE_VERSION="3.25"
CMAKE_CORE_NUMBER=6

Expand Down
5 changes: 5 additions & 0 deletions scripts/.rust_env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
RUST_VERSION=1.77.0
RUSTUP_HOME=~/.rustup
CARGO_HOME=~/.cargo

PATH="${CARGO_HOME}/bin:${PATH}"
8 changes: 7 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ current_dir=$(dirname $(readlink -f "$0"))
parent_dir=$(dirname "$current_dir")
cd $parent_dir

set -a; source $current_dir/.env; set +a #include .env vars
#include .env vars and optionally .rust_env vars
set -a;
if [ -z "$FLAKE_INITIATED" ]; then
source $current_dir/.rust_env;
fi
source $current_dir/.env;
set +a

source $parent_dir/venv/bin/activate
cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release
Expand Down
8 changes: 7 additions & 1 deletion scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ current_dir=$(dirname $(readlink -f "$0"))
parent_dir=$(dirname "$current_dir")
cd $parent_dir

set -a; source $current_dir/.env; set +a #include .env vars
#include .env vars and optionally .rust_env vars
set -a;
if [ -z "$FLAKE_INITIATED" ]; then
source $current_dir/.rust_env;
fi
source $current_dir/.env;
set +a

# if not using nix, install the following packages
if [ -z "$FLAKE_INITIATED" ]; then
Expand Down

0 comments on commit a2f8a40

Please sign in to comment.