-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update sovereign.toml resoultion to relative path (#855)
* feat: update sovereign.toml resoultion to relative path Prior to this commit, the resolution of the sovereign.toml dependend on unstable features of proc-macro2, available only for recent toolchain versions. This commit introduces the path resolution of the manifest file to recurse from the target directory. It will allow endpoints to set their own manifest file, replacing the ones bundled with the modules. It will also read an optional `SOVEREIGN_MANIFEST` that, if set, will override the manifest path. The manifest path is expected to be resolved at compile time, making it possible to construct const/static structures with it. * remove deprecated .env
- Loading branch information
Showing
6 changed files
with
57 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/target | ||
|
||
.idea/ | ||
target-path | ||
|
||
target/ | ||
fuzz/Cargo.lock | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use std::path::PathBuf; | ||
use std::{env, fs, io}; | ||
|
||
fn main() -> io::Result<()> { | ||
// writes the target output dir into the manifest path so it can be later read for the | ||
// resolution of the sovereign.toml manifest file | ||
let target = env::var("OUT_DIR").map_err(|e| io::Error::new(io::ErrorKind::Other, e))?; | ||
let target = PathBuf::from(target).canonicalize()?.display().to_string(); | ||
let manifest = env!("CARGO_MANIFEST_DIR"); | ||
let manifest = PathBuf::from(manifest).canonicalize()?.join("target-path"); | ||
fs::write(manifest, target)?; | ||
|
||
Ok(()) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Base SDK configuration file |