Skip to content

Commit

Permalink
applying #227
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Oct 22, 2024
1 parent 1cecfe1 commit c27eef4
Show file tree
Hide file tree
Showing 21 changed files with 41 additions and 11 deletions.
Binary file modified lib/native/win32/ia32/16/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/16/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/18/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/18/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/20/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/ia32/20/edge_nativeclr.node
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/native/win32/ia32/20/node.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.18.0
20.18.0
Binary file modified lib/native/win32/x64/16/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/16/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/18/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/18/edge_nativeclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/20/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/20/edge_nativeclr.node
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/native/win32/x64/20/node.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.18.0
20.18.0
Binary file modified lib/native/win32/x64/22/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/22/edge_nativeclr.node
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/native/win32/x64/22/node.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.10.0
22.10.0
Binary file modified lib/native/win32/x64/23/edge_coreclr.node
Binary file not shown.
Binary file modified lib/native/win32/x64/23/edge_nativeclr.node
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/native/win32/x64/23/node.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
23.0.0
23.0.0
44 changes: 37 additions & 7 deletions src/CoreCLREmbedding/coreclrembedding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,14 +371,44 @@ HRESULT CoreClrEmbedding::Initialize(BOOL debugMode)
if (mode != host_mode_t::standalone)
{
trace::verbose(_X("CoreClrEmbedding::Initialize - host mode: muxer"));
pal::string_t sdkDirectory;

fx_muxer_t::resolve_sdk_dotnet_path(dotnetDirectory, &sdkDirectory);

pal::string_t dotnetAssemblyPath(sdkDirectory);
append_path(&dotnetAssemblyPath, _X("dotnet.dll"));
std::vector<pal::string_t> appConfigFiles;
pal::readdir(edgeAppDir, _X("*.runtimeconfig.json"), &appConfigFiles);
pal::string_t runtimeconfigfile;

get_runtime_config_paths_from_app(dotnetAssemblyPath, &configFile, &devConfigFile);
if (appConfigFiles.size() > 1)
{
std::vector<char> edgeAppDirCstr;
pal::pal_clrstring(edgeAppDir, &edgeAppDirCstr);

throwV8Exception("CoreClrEmbedding::Initialize - Multiple app runtimeconfig files (*.runtimeconfig.json) files exist in the Edge.js application directory (%s).", edgeAppDirCstr.data());
return E_FAIL;
}
else if (appConfigFiles.size() == 1)
{
runtimeconfigfile = pal::string_t(edgeAppDir);
append_path(&runtimeconfigfile, appConfigFiles[0].c_str());

trace::info(_X("CoreClrEmbedding::Initialize - Exactly one (%s) app runtimeconfig file found in the Edge app directory, using it"), runtimeconfigfile.c_str());
configFile = pal::string_t(runtimeconfigfile);
}
else // No app runtimeconfigfile found, using sdk runtimeconfig
{
pal::string_t sdkDirectory;

fx_muxer_t::resolve_sdk_dotnet_path(dotnetDirectory, &sdkDirectory);


if (sdkDirectory.length() == 0)
{
throwV8Exception("CoreClrEmbedding::Initialize - Could not find any runtimeconfig file ([appname].runtimeconfig.json in app folder nor dotnet.runtimeconfig.json in sdk folder)");
return E_FAIL;
}

runtimeconfigfile = pal::string_t(sdkDirectory);
append_path(&runtimeconfigfile, _X("dotnet.dll"));
get_runtime_config_paths_from_app(runtimeconfigfile, &configFile, &devConfigFile);
}
}

else
Expand Down Expand Up @@ -775,4 +805,4 @@ CoreClrGcHandle CoreClrEmbedding::CompileFunc(const void* options, const int pay
trace::info(_X("CoreClrEmbedding::CompileFunc - Finished"));
return function;
}
}
}

0 comments on commit c27eef4

Please sign in to comment.