Skip to content

Commit

Permalink
refactor: replace removed CARGO_RUSTC_CURRENT_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasKruckenberg committed Nov 20, 2024
1 parent b733d7c commit ab85019
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ Variables can be set using `just VARIABLE=VALUE ...` or

# env var to set the cargo runner for the riscv64 target
export CARGO_TARGET_RISCV64GC_K23_NONE_KERNEL_RUNNER := "just _run_riscv64"
# as of recent Rust nightly versions the old `CARGO_RUSTC_CURRENT_DIR` we used to locate the kernel artifact from the
# loader build script got removed :/ This is a stopgap until they come up with a replacement.
# https://github.com/rust-lang/cargo/issues/3946
export __K23_CARGO_RUSTC_CURRENT_DIR := `dirname "$(cargo locate-project --workspace --message-format plain)"`

# default recipe to display help information
_default:
Expand Down
2 changes: 1 addition & 1 deletion loader/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::path::{Path, PathBuf};
use std::{env, fs};

fn main() {
let workspace_root = Path::new(env!("CARGO_RUSTC_CURRENT_DIR"));
let workspace_root = PathBuf::from(env::var_os("__K23_CARGO_RUSTC_CURRENT_DIR").unwrap());
let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());

println!("cargo::rerun-if-env-changed=KERNEL");
Expand Down

0 comments on commit ab85019

Please sign in to comment.