Skip to content

Commit

Permalink
update environment (.NET 8, Node.js 20)
Browse files Browse the repository at this point in the history
  • Loading branch information
StackOverflowExcept1on committed Aug 30, 2024
1 parent 6b231f9 commit 2110152
Show file tree
Hide file tree
Showing 12 changed files with 349 additions and 207 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ on:

jobs:
build:
if: "!contains(github.event.head_commit.message, '[ci skip]')"
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18
node-version: 20

- name: Install node packages
run: npm install
Expand Down
13 changes: 13 additions & 0 deletions Bootstrapper/include/coreclr_delegates.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,17 @@ typedef int (CORECLR_DELEGATE_CALLTYPE *get_function_pointer_fn)(
void *reserved /* Extensibility parameter (currently unused and must be 0) */,
/*out*/ void **delegate /* Pointer where to store the function pointer result */);

typedef int (CORECLR_DELEGATE_CALLTYPE *load_assembly_fn)(
const char_t *assembly_path /* Fully qualified path to assembly */,
void *load_context /* Extensibility parameter (currently unused and must be 0) */,
void *reserved /* Extensibility parameter (currently unused and must be 0) */);

typedef int (CORECLR_DELEGATE_CALLTYPE *load_assembly_bytes_fn)(
const void *assembly_bytes /* Bytes of the assembly to load */,
size_t assembly_bytes_len /* Byte length of the assembly to load */,
const void *symbols_bytes /* Optional. Bytes of the symbols for the assembly */,
size_t symbols_bytes_len /* Optional. Byte length of the symbols for the assembly */,
void *load_context /* Extensibility parameter (currently unused and must be 0) */,
void *reserved /* Extensibility parameter (currently unused and must be 0) */);

#endif // __CORECLR_DELEGATES_H__
56 changes: 55 additions & 1 deletion Bootstrapper/include/hostfxr.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ enum hostfxr_delegate_type
hdt_com_unregister,
hdt_load_assembly_and_get_function_pointer,
hdt_get_function_pointer,
hdt_load_assembly,
hdt_load_assembly_bytes,
};

typedef int32_t(HOSTFXR_CALLTYPE *hostfxr_main_fn)(const int argc, const char_t **argv);
Expand Down Expand Up @@ -353,12 +355,64 @@ struct hostfxr_dotnet_environment_info
//
// String encoding:
// Windows - UTF-16 (pal::char_t is 2 byte wchar_t)
// Unix - UTF-8 (pal::char_t is 1 byte char)
// Non-Windows - UTF-8 (pal::char_t is 1 byte char)
//
typedef int32_t(HOSTFXR_CALLTYPE* hostfxr_get_dotnet_environment_info_fn)(
const char_t* dotnet_root,
void* reserved,
hostfxr_get_dotnet_environment_info_result_fn result,
void* result_context);

struct hostfxr_framework_result
{
size_t size;
const char_t* name;
const char_t* requested_version;
const char_t* resolved_version;
const char_t* resolved_path;
};

struct hostfxr_resolve_frameworks_result
{
size_t size;

size_t resolved_count;
const struct hostfxr_framework_result* resolved_frameworks;

size_t unresolved_count;
const struct hostfxr_framework_result* unresolved_frameworks;
};

typedef void (HOSTFXR_CALLTYPE* hostfxr_resolve_frameworks_result_fn)(
const hostfxr_resolve_frameworks_result* result,
void* result_context);

//
// Resolves frameworks for a runtime config
//
// Parameters:
// runtime_config_path
// Path to the .runtimeconfig.json file
// parameters
// Optional. Additional parameters for initialization.
// If null or dotnet_root is null, the root corresponding to the running hostfx is used.
// callback
// Optional. Result callback invoked with result of the resolution.
// Structs and their elements are valid for the duration of the call.
// result_context
// Optional. Additional context passed to the result callback.
//
// Return value:
// 0 on success, otherwise failure.
//
// String encoding:
// Windows - UTF-16 (pal::char_t is 2-byte wchar_t)
// Non-Windows - UTF-8 (pal::char_t is 1-byte char)
//
typedef int32_t(HOSTFXR_CALLTYPE* hostfxr_resolve_frameworks_for_runtime_config_fn)(
const char_t* runtime_config_path,
/*opt*/ const hostfxr_initialize_parameters* parameters,
/*opt*/ hostfxr_resolve_frameworks_result_fn callback,
/*opt*/ void* result_context);

#endif //__HOSTFXR_H__
14 changes: 7 additions & 7 deletions DemoApplication/DemoApplication.sln
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32929.385
VisualStudioVersion = 17.11.35222.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DemoApplication", "DemoApplication\DemoApplication.csproj", "{DD0EC8D5-3EFB-433B-85ED-E1A2BF1D0CA6}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DemoApplication", "DemoApplication\DemoApplication.csproj", "{1CF03031-3FF7-43CD-938A-A2AACA5BCB26}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DD0EC8D5-3EFB-433B-85ED-E1A2BF1D0CA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD0EC8D5-3EFB-433B-85ED-E1A2BF1D0CA6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD0EC8D5-3EFB-433B-85ED-E1A2BF1D0CA6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD0EC8D5-3EFB-433B-85ED-E1A2BF1D0CA6}.Release|Any CPU.Build.0 = Release|Any CPU
{1CF03031-3FF7-43CD-938A-A2AACA5BCB26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1CF03031-3FF7-43CD-938A-A2AACA5BCB26}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1CF03031-3FF7-43CD-938A-A2AACA5BCB26}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1CF03031-3FF7-43CD-938A-A2AACA5BCB26}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB3484FA-D003-405E-BA6D-29BF1AAEE847}
SolutionGuid = {BF70B7B2-46B7-4831-9DBC-0CFFDE39916E}
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion DemoApplication/DemoApplication/DemoApplication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion DemoApplication/build.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dotnet publish -c Release -r win10-x64 -o dist --self-contained
dotnet publish -c Release -r win-x64 -p:PublishDir="%cd%/dist" --self-contained
14 changes: 7 additions & 7 deletions RuntimePatcher/RuntimePatcher.sln
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32929.385
VisualStudioVersion = 17.11.35222.181
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RuntimePatcher", "RuntimePatcher\RuntimePatcher.csproj", "{415720BA-D007-418D-B281-ECECB6303465}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RuntimePatcher", "RuntimePatcher\RuntimePatcher.csproj", "{B262C52E-ADBE-4548-8B9B-BDE4A26A67F6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{415720BA-D007-418D-B281-ECECB6303465}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{415720BA-D007-418D-B281-ECECB6303465}.Debug|Any CPU.Build.0 = Debug|Any CPU
{415720BA-D007-418D-B281-ECECB6303465}.Release|Any CPU.ActiveCfg = Release|Any CPU
{415720BA-D007-418D-B281-ECECB6303465}.Release|Any CPU.Build.0 = Release|Any CPU
{B262C52E-ADBE-4548-8B9B-BDE4A26A67F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B262C52E-ADBE-4548-8B9B-BDE4A26A67F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B262C52E-ADBE-4548-8B9B-BDE4A26A67F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B262C52E-ADBE-4548-8B9B-BDE4A26A67F6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C2C65888-D4D9-4EB6-A4CC-7E53A3AC4C92}
SolutionGuid = {3B731D80-E164-4B66-B5CB-F96F42D7C6D6}
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions RuntimePatcher/RuntimePatcher/RuntimePatcher.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<EnableDynamicLoading>true</EnableDynamicLoading>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Lib.Harmony" Version="2.2.2" />
<PackageReference Include="Lib.Harmony" Version="2.3.3" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion RuntimePatcher/build.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dotnet publish -c Release -o dist
dotnet publish -c Release -p:PublishDir="%cd%/dist"
Loading

0 comments on commit 2110152

Please sign in to comment.