Skip to content

Commit d62d7e8

Browse files
committed
Respond to feedback
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent 77634ee commit d62d7e8

6 files changed

Lines changed: 16 additions & 18 deletions

File tree

src/sdk/dotnet/Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ devnull := if os() == "windows" { "$null" } else { "/dev/null" }
1919
#### BUILD ####
2020

2121
# Build everything (Rust FFI + .NET solution)
22-
build target=default-target: (build-rust target) (build-dotnet target)
22+
build target=default-target: (build-rust target) (build-dotnet target) (build-guests target)
2323

2424
# Build only the Rust FFI crate
2525
build-rust target=default-target:

src/sdk/dotnet/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ just dotnet copilot-sdk-example # Run Copilot SDK example
252252
|--------|-------------|
253253
| `WithModulePath(string)` | Path to `.wasm`/`.aot` guest (required for Wasm) |
254254
| `WithPythonModule()` | Use the bundled Python guest from `Hyperlight.HyperlightSandbox.Guest.Python` |
255-
| `WithJavaScriptModule()` | Use the bundled JavaScript Wasm guest from `Hyperlight.HyperlightSandbox.Guest.JavaScript` |
255+
| `WithJavaScriptModule()` | Use the bundled JavaScript guest from `Hyperlight.HyperlightSandbox.Guest.JavaScript` |
256256
| `WithBackend(SandboxBackend)` | `Wasm` (default) or `JavaScript` |
257257
| `WithHeapSize(string\|ulong)` | Guest heap size (e.g. `"50Mi"`, default: platform-dependent) |
258258
| `WithStackSize(string\|ulong)` | Guest stack size (e.g. `"35Mi"`, default: platform-dependent) |

src/sdk/dotnet/core/Guest.JavaScript/HyperlightSandbox.Guest.JavaScript.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<PropertyGroup>
2424
<WorkspaceRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)../../../../..'))</WorkspaceRoot>
25-
<JavaScriptGuestDir>$(WorkspaceRoot)\src\wasm_sandbox\guests\javascript</JavaScriptGuestDir>
25+
<JavaScriptGuestDir>$([System.IO.Path]::Combine('$(WorkspaceRoot)', 'src', 'wasm_sandbox', 'guests', 'javascript'))</JavaScriptGuestDir>
2626
</PropertyGroup>
2727

2828
<ItemGroup>
@@ -36,15 +36,15 @@
3636
NuGet selects the right entry for each consumer platform from a single package build.
3737
-->
3838
<ItemGroup>
39-
<None Include="$(JavaScriptGuestDir)\js-sandbox.aot"
40-
Condition="Exists('$(JavaScriptGuestDir)\js-sandbox.aot')">
39+
<None Include="$(JavaScriptGuestDir)/js-sandbox.aot"
40+
Condition="Exists('$(JavaScriptGuestDir)/js-sandbox.aot')">
4141
<Pack>true</Pack>
4242
<PackagePath>runtimes/linux-x64/native/</PackagePath>
4343
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4444
<Link>runtimes/linux-x64/native/js-sandbox.aot</Link>
4545
</None>
46-
<None Include="$(JavaScriptGuestDir)\js-sandbox.aot"
47-
Condition="Exists('$(JavaScriptGuestDir)\js-sandbox.aot')">
46+
<None Include="$(JavaScriptGuestDir)/js-sandbox.aot"
47+
Condition="Exists('$(JavaScriptGuestDir)/js-sandbox.aot')">
4848
<Pack>true</Pack>
4949
<PackagePath>runtimes/win-x64/native/</PackagePath>
5050
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -53,7 +53,7 @@
5353
</ItemGroup>
5454

5555
<Target Name="ValidateJavaScriptGuestResources" BeforeTargets="Pack">
56-
<Error Condition="!Exists('$(JavaScriptGuestDir)\js-sandbox.aot')"
56+
<Error Condition="!Exists('$(JavaScriptGuestDir)/js-sandbox.aot')"
5757
Text="JavaScript guest AOT binary is missing. Run 'just wasm js-guest-build' before packing Hyperlight.HyperlightSandbox.Guest.JavaScript." />
5858
</Target>
5959

src/sdk/dotnet/core/Guest.JavaScript/JavaScriptGuestModule.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Reflection;
21
using HyperlightSandbox.Api;
32

43
namespace HyperlightSandbox.Guest.JavaScript;
@@ -34,7 +33,7 @@ public static SandboxBuilder WithJavaScriptModule(this SandboxBuilder builder)
3433
private static string FindGuestFile(string fileName)
3534
{
3635
string assemblyDir = Path.GetDirectoryName(
37-
typeof(JavaScriptGuestModule).Assembly.Location) ?? string.Empty;
36+
typeof(JavaScriptGuestModule).Assembly.Location) ?? AppContext.BaseDirectory;
3837

3938
// The .aot binary is built on Windows but works on both linux-x64 and win-x64.
4039
// Probe the OS-appropriate RID path first (matches SafeNativeMethods.DllImportResolver).

src/sdk/dotnet/core/Guest.Python/HyperlightSandbox.Guest.Python.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<PropertyGroup>
2424
<WorkspaceRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)../../../../..'))</WorkspaceRoot>
25-
<PythonGuestDir>$(WorkspaceRoot)\src\wasm_sandbox\guests\python</PythonGuestDir>
25+
<PythonGuestDir>$([System.IO.Path]::Combine('$(WorkspaceRoot)', 'src', 'wasm_sandbox', 'guests', 'python'))</PythonGuestDir>
2626
</PropertyGroup>
2727

2828
<ItemGroup>
@@ -36,15 +36,15 @@
3636
NuGet selects the right entry for each consumer platform from a single package build.
3737
-->
3838
<ItemGroup>
39-
<None Include="$(PythonGuestDir)\python-sandbox.aot"
40-
Condition="Exists('$(PythonGuestDir)\python-sandbox.aot')">
39+
<None Include="$(PythonGuestDir)/python-sandbox.aot"
40+
Condition="Exists('$(PythonGuestDir)/python-sandbox.aot')">
4141
<Pack>true</Pack>
4242
<PackagePath>runtimes/linux-x64/native/</PackagePath>
4343
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4444
<Link>runtimes/linux-x64/native/python-sandbox.aot</Link>
4545
</None>
46-
<None Include="$(PythonGuestDir)\python-sandbox.aot"
47-
Condition="Exists('$(PythonGuestDir)\python-sandbox.aot')">
46+
<None Include="$(PythonGuestDir)/python-sandbox.aot"
47+
Condition="Exists('$(PythonGuestDir)/python-sandbox.aot')">
4848
<Pack>true</Pack>
4949
<PackagePath>runtimes/win-x64/native/</PackagePath>
5050
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -53,7 +53,7 @@
5353
</ItemGroup>
5454

5555
<Target Name="ValidatePythonGuestResources" BeforeTargets="Pack">
56-
<Error Condition="!Exists('$(PythonGuestDir)\python-sandbox.aot')"
56+
<Error Condition="!Exists('$(PythonGuestDir)/python-sandbox.aot')"
5757
Text="Python guest AOT binary is missing. Run 'just wasm guest-build' before packing Hyperlight.HyperlightSandbox.Guest.Python." />
5858
</Target>
5959

src/sdk/dotnet/core/Guest.Python/PythonGuestModule.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Reflection;
21
using HyperlightSandbox.Api;
32

43
namespace HyperlightSandbox.Guest.Python;
@@ -34,7 +33,7 @@ public static SandboxBuilder WithPythonModule(this SandboxBuilder builder)
3433
private static string FindGuestFile(string fileName)
3534
{
3635
string assemblyDir = Path.GetDirectoryName(
37-
typeof(PythonGuestModule).Assembly.Location) ?? string.Empty;
36+
typeof(PythonGuestModule).Assembly.Location) ?? AppContext.BaseDirectory;
3837

3938
// The .aot binary is built on Windows but works on both linux-x64 and win-x64.
4039
// Probe the OS-appropriate RID path first (matches SafeNativeMethods.DllImportResolver).

0 commit comments

Comments
 (0)