Skip to content

Commit

Permalink
fix: add DOTNET_ROOT env variable (#4921)
Browse files Browse the repository at this point in the history
  • Loading branch information
wendrul authored Dec 13, 2024
1 parent 3634ade commit eb3ed7a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backend/windmill-worker/src/csharp_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ const NSJAIL_CONFIG_RUN_CSHARP_CONTENT: &str = include_str!("../nsjail/run.cshar
#[cfg(feature = "csharp")]
lazy_static::lazy_static! {
static ref HOME_DIR: String = std::env::var("HOME").expect("Could not find the HOME environment variable");
static ref DOTNET_ROOT: String = std::env::var("DOTNET_ROOT").expect("Could not find the DOTNET_ROOT environment variable");

}

#[cfg(feature = "csharp")]
Expand Down Expand Up @@ -281,6 +283,7 @@ async fn build_cs_proj(
.env("HOME", HOME_ENV.as_str())
.env("DOTNET_CLI_TELEMETRY_OPTOUT", "true")
.env("DOTNET_NOLOGO", "true")
.env("DOTNET_ROOT", DOTNET_ROOT.as_str())
.args(vec![
"publish",
"--configuration",
Expand Down Expand Up @@ -493,6 +496,7 @@ pub async fn handle_csharp_job(
.env("BASE_INTERNAL_URL", base_internal_url)
.env("DOTNET_CLI_TELEMETRY_OPTOUT", "true")
.env("DOTNET_NOLOGO", "true")
.env("DOTNET_ROOT", DOTNET_ROOT.as_str())
.args(vec!["--config", "run.config.proto", "--", "/tmp/main"])
.stdout(Stdio::piped())
.stderr(Stdio::piped());
Expand All @@ -509,6 +513,7 @@ pub async fn handle_csharp_job(
.env("TZ", TZ_ENV.as_str())
.env("DOTNET_CLI_TELEMETRY_OPTOUT", "true")
.env("DOTNET_NOLOGO", "true")
.env("DOTNET_ROOT", DOTNET_ROOT.as_str())
.env("BASE_INTERNAL_URL", base_internal_url)
.env("HOME", HOME_ENV.as_str())
.stdout(Stdio::piped())
Expand Down
1 change: 1 addition & 0 deletions docker/DockerfileFull
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ RUN pip3 install ansible

COPY --from=bitnami/dotnet-sdk:9.0.101-debian-12-r0 /opt/bitnami/dotnet-sdk /opt/dotnet-sdk
RUN ln -s /opt/dotnet-sdk/bin/dotnet /usr/bin/dotnet
ENV DOTNET_ROOT="/opt/dotnet-sdk/bin"
1 change: 1 addition & 0 deletions docker/DockerfileFullEe
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ RUN pip3 install ansible

COPY --from=bitnami/dotnet-sdk:9.0.101-debian-12-r0 /opt/bitnami/dotnet-sdk /opt/dotnet-sdk
RUN ln -s /opt/dotnet-sdk/bin/dotnet /usr/bin/dotnet
ENV DOTNET_ROOT="/opt/dotnet-sdk/bin"
1 change: 1 addition & 0 deletions docker/DockerfileNsjail
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ RUN pip3 install ansible

COPY --from=bitnami/dotnet-sdk:9.0.101-debian-12-r0 /opt/bitnami/dotnet-sdk /opt/dotnet-sdk
RUN ln -s /opt/dotnet-sdk/bin/dotnet /usr/bin/dotnet
ENV DOTNET_ROOT="/opt/dotnet-sdk/bin"

COPY --from=nsjail /nsjail/nsjail /bin/nsjail

0 comments on commit eb3ed7a

Please sign in to comment.