-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install natively using dotnet-install scripts (#2)
* Install natively using dotnet-install scripts Having an installation for each .NET SDK version causes all sorts of issues, as the whole ecosystem expects all SDKs and runtimes to share the same installation directory. In practice this is currently causing issues because DOTNET_ROOT cannot be set to anything meaningful on a system-level. Other tooling like IntelliJ Rider can thus not find the correct SDK to use. You'd have to somehow set DOTNET_ROOT per project, and even then that project can only be aware of a single SDK version at a time. So I've decided to rely on proto's `native_install` feature instead, which opens another can of worms, but a more manageable one at least. It relies on the official dotnet-install scripts to install SDKs into whatever DOTNET_ROOT is set to (or ~/.dotnet per default). Supporting uninstallation will come later, as it will be a bit tricky, now that everything lives in the same directory. The dotnet executable will no longer be shimmed nor symlinked, and the user is expected to add DOTNET_ROOT to their PATH. * Remove obsolete tests
- Loading branch information
Showing
7 changed files
with
98 additions
and
175 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use std::path::PathBuf; | ||
|
||
use extism_pdk::*; | ||
use proto_pdk::{host_env, HostEnvironment}; | ||
|
||
#[host_fn] | ||
extern "ExtismHost" { | ||
fn get_env_var(name: String) -> String; | ||
} | ||
|
||
pub fn get_dotnet_root(env: &HostEnvironment) -> Result<PathBuf, Error> { | ||
// Variable returns a real path | ||
Ok(host_env!("DOTNET_ROOT") | ||
.map(PathBuf::from) | ||
// So we need our fallback to also be a real path | ||
.unwrap_or_else(|| env.home_dir.real_path().join(".dotnet"))) | ||
} |
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
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.