Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed Aug 18, 2024
2 parents 80ce56a + db67e8a commit 55e17a5
Show file tree
Hide file tree
Showing 449 changed files with 7,409 additions and 15,955 deletions.
136 changes: 37 additions & 99 deletions .github/workflows/IKVM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,89 +22,37 @@ env:
NATIVE_SDK_VERSION: "20240614.1"

jobs:
build-openjdk:
name: Build OpenJDK
build-jtreg:
name: Build OpenJDK Test Harness
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache OpenJDK Build
uses: actions/cache@v4
with:
path: openjdk/build/linux-x86_64-normal-server-release
key: openjdk-build-linux-x86_64-normal-server-release--${{ runner.os }}--${{ hashFiles('openjdk/**', '!openjdk/build') }}-10
- name: Check OpenJDK Build Stamp
id: openjdk-build-stamp
uses: andstor/file-existence-action@v3
with:
files: openjdk/build/linux-x86_64-normal-server-release/stamp
- name: Fetch OpenJDK 7
if: steps.openjdk-build-stamp.outputs.files_exists != 'true'
run: |
mkdir -p openjdk/build &&
curl -o openjdk/build/openjdk-7u75-b13-linux-x64-18_dec_2014.tar.gz "https://download.java.net/openjdk/jdk7u75/ri/openjdk-7u75-b13-linux-x64-18_dec_2014.tar.gz" &&
tar xzvf openjdk/build/openjdk-7u75-b13-linux-x64-18_dec_2014.tar.gz -C openjdk/build
- name: Build OpenJDK
if: steps.openjdk-build-stamp.outputs.files_exists != 'true'
uses: docker://debian/eol:lenny
with:
args: >
/bin/bash -c "
echo 'deb http://archive.debian.org/debian/ lenny main' > /etc/apt/sources.list &&
apt-get update &&
apt-get install -y \
build-essential \
unzip \
zip \
curl \
gcc-4.3 \
g++-4.3 \
libx11-dev \
libxext-dev \
libxrender-dev \
libxtst-dev \
libxt-dev \
libxi-dev \
libcups2-dev \
libasound2-dev \
libfreetype6-dev \
libfontconfig1-dev &&
cd openjdk &&
JAVA_HOME=build/java-se-7u75-ri bash ./configure &&
make DISABLE_HOTSPOT_OS_VERSION_CHECK=ok images &&
touch build/linux-x86_64-normal-server-release/stamp"
- name: Update OpenJDK Attributes
run: |
sudo chown -R `id -u`:`id -g` linux-x86_64-normal-server-release && \
sudo chmod -R +rwx linux-x86_64-normal-server-release/images/j2sdk-image/bin
working-directory: openjdk/build
- name: Package OpenJDK
run: zip -r /tmp/openjdk-build-linux-x86_64-normal-server-release.zip linux-x86_64-normal-server-release/*
working-directory: openjdk/build
- name: Upload OpenJDK
uses: actions/upload-artifact@v4
with:
name: openjdk-build-linux-x86_64-normal-server-release
path: /tmp/openjdk-build-linux-x86_64-normal-server-release.zip
- name: Cache OpenJDK Test Harness Build
uses: actions/cache@v4
with:
path: jtreg/build
key: jtreg-build--${{ runner.os }}--${{ hashFiles('jtreg/**', 'openjdk/build/linux-x86_64-normal-server-release/images/j2sdk-image', '!jtreg/build') }}-6
path: ext/jtreg/build
key: jtreg-build--${{ runner.os }}--${{ hashFiles('ext/jtreg/**') }}-8
- name: Check OpenJDK Test Harness Build Stamp
id: jtreg-build-stamp
uses: andstor/file-existence-action@v3
with:
files: jtreg/build/stamp
files: ext/jtreg/build/stamp
- name: Install Java
run: |
sudo apt-get update && \
sudo apt-get install -y \
openjdk-8-jdk-headless && \
echo "JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64" >> $GITHUB_ENV
- name: Build OpenJDK Test Harness
if: steps.jtreg-build-stamp.outputs.files_exists != 'true'
run: WGET_OPTS='-U Mozilla/5.0' bash make/build-all.sh `realpath ../openjdk/build/linux-x86_64-normal-server-release/images/j2sdk-image` && touch build/stamp
working-directory: jtreg
run: WGET_OPTS='-U Mozilla/5.0' bash make/build-all.sh $JAVA_HOME && touch build/stamp
working-directory: ext/jtreg
- name: Package OpenJDK Test Harness
run: zip -r /tmp/jtreg-build.zip build
working-directory: jtreg
working-directory: ext/jtreg
- name: Upload OpenJDK Test Harness
uses: actions/upload-artifact@v4
with:
Expand All @@ -113,7 +61,7 @@ jobs:
build-ikvm:
name: Build IKVM
needs:
- build-openjdk
- build-jtreg
timeout-minutes: 720
runs-on: ubuntu-24.04
env:
Expand Down Expand Up @@ -181,6 +129,7 @@ jobs:
with:
crate: apple-codesign
version: latest
locked: false
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1
with:
Expand All @@ -190,20 +139,13 @@ jobs:
with:
useConfigFile: true
configFilePath: GitVersion.yml
- name: Download OpenJDK 8 Build
uses: actions/download-artifact@v4
with:
name: openjdk-build-linux-x86_64-normal-server-release
path: /tmp
- name: Restore OpenJDK 8 Build
run: mkdir -p openjdk/build && cd openjdk/build && unzip /tmp/openjdk-build-linux-x86_64-normal-server-release.zip && rm /tmp/openjdk-build-linux-x86_64-normal-server-release.zip
- name: Download JTReg Build
uses: actions/download-artifact@v4
with:
name: jtreg-build
path: /tmp
- name: Restore JTReg Build
run: mkdir -p jtreg && cd jtreg && unzip /tmp/jtreg-build.zip && rm /tmp/jtreg-build.zip
run: mkdir -p ext/jtreg && cd ext/jtreg && unzip /tmp/jtreg-build.zip && rm /tmp/jtreg-build.zip
- name: Download Native SDKs
uses: robinraju/[email protected]
with:
Expand All @@ -212,6 +154,12 @@ jobs:
fileName: "*.tar.gz"
out-file-path: ext/ikvm-native-sdk
extract: true
- name: Add NuGet Source (GitHub)
shell: pwsh
run: dotnet nuget add source --username USERNAME --password $env:GITHUB_TOKEN --store-password-in-clear-text --name ikvm $env:GITHUB_REPOS
env:
GITHUB_REPOS: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: NuGet Restore
run: dotnet restore IKVM.sln
- name: Build Artifacts
Expand Down Expand Up @@ -282,16 +230,6 @@ jobs:
path: /tmp/jdk.tar.gz
- name: Delete JDK
run: rm /tmp/jdk.tar.gz
- name: Package Tests (IKVM.ByteCode.Tests)
run: tar czvf /tmp/tests--IKVM.ByteCode.Tests.tar.gz tests/IKVM.ByteCode.Tests
working-directory: dist
- name: Upload Tests (IKVM.ByteCode.Tests)
uses: actions/upload-artifact@v4
with:
name: tests--IKVM.ByteCode.Tests
path: /tmp/tests--IKVM.ByteCode.Tests.tar.gz
- name: Delete Tests (IKVM.ByteCode.Tests)
run: rm /tmp/tests--IKVM.ByteCode.Tests.tar.gz
- name: Package Tests (IKVM.Reflection.Tests)
run: tar czvf /tmp/tests--IKVM.Reflection.Tests.tar.gz tests/IKVM.Reflection.Tests
working-directory: dist
Expand Down Expand Up @@ -424,18 +362,23 @@ jobs:
run: |
$sys = @(
"win-x64",
"linux-x64",
"osx-x64"
"linux-x64"
)
if ($env:FULL_TEST -eq "true") {
$sys += @( "osx-x64", "osx-arm64" )
}
$tfm = @(
"net472",
"net6.0",
"net8.0"
)
if ($env:FULL_TEST -eq "true") {
$tfm += @( "net6.0" )
}
$run = @(
"IKVM.ByteCode.Tests",
"IKVM.Reflection.Tests",
"IKVM.Tests",
"IKVM.Java.Tests",
Expand All @@ -459,6 +402,10 @@ jobs:
"tfm" = "net472"
"sys" = "osx-x64"
},
@{
"tfm" = "net472"
"sys" = "osx-arm64"
},
@{
"run" = "IKVM.MSBuild.Tests"
"tfm" = "net472"
Expand Down Expand Up @@ -497,15 +444,6 @@ jobs:
}
)
if ($env:FULL_TEST -ne "true") {
foreach ($_ in (0..15)) {
$exclude += @(@{
"run" = "IKVM.OpenJDK.Tests?TestPartition=$_"
"tfm" = "net8.0"
})
}
}
$include = @(
@{
"run" = "IKVM.Tests"
Expand Down Expand Up @@ -671,7 +609,7 @@ jobs:
"--blame",
"--blame-crash",
"--blame-hang",
"--blame-hang-timeout", "60m",
"--blame-hang-timeout", "120m",
"--blame-hang-dump-type", "full",
"-v:diag",
"--results-directory", "TestResults",
Expand Down
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[submodule "openjdk"]
path = openjdk
[submodule "ext/openjdk"]
path = ext/openjdk
url = https://github.com/ikvmnet/jdk8u.git
ignore = dirty
shallow = true
[submodule "jtreg"]
path = jtreg
[submodule "ext/jtreg"]
path = ext/jtreg
url = https://github.com/ikvmnet/jtreg.git
ignore = dirty
shallow = true
Expand Down
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ Prerequisites for building the project:
* A clone of the IKVM repository which includes submodules (e.g. `git clone --recurse-submodules https://github.com/ikvmnet/ikvm.git`)
* Visual Studio configured for: .NET desktop development, Desktop development with C++ (including C++ Clang tools for Windows), Linux and Embedded Development with C++, and Windows SDK with the appropriate libraries for x86, AMD64 and ARM64 development.
* A JDK 8 installation. The `JAVA_HOME` environment variable needs to be point to the JDK 8 directory, or the version of `javac` available on the path needs to be from JDK 8 (You can download a suitable JDK from [Adoptium](https://adoptium.net/))
* The OpenJDK JDK8u build result for Linux/x64. This build artifact cannot be built on Windows, or modern Linux hosts. Instead, it must be built on a host with GCC 4.3 available. (Debian Lenny is known to work acceptably, the CI/CD GitHub action can serve as a demonstration of this). The easiest way to acquire this artifact without building it yourself is to use one generated by the IKVM respository's [GitHub Actions](https://github.com/ikvm-revived/ikvm/actions). Click on a build result for a relevant branch (typically you'll want to use `develop`) and scroll down to the bottom of the list to locate `openjdk-build-linux-x86_64-normal-server-release`. Download this zip file from this link and unzip into
`openjdk/build`.
* SDK Toolkits: These are located in the `ext/ikvm-native-sdk/` directory, and consist of a Windows SDK (windows), Linux SDK (linux) and Mac OS X SDK (macosx). The SDKs can be retrieved from the releases of the `ikvm-native-sdk` project.
* We use IKVM.Clang projects to build the native libraries. This project type supports inner builds for TargetMachine, much as .NET supports inner builds for TFMs.
* There is an IKVM.Clang Visual Studio extension for these projects to load properly in Visual Studio: https://marketplace.visualstudio.com/items?itemName=ikvm.clang
Expand Down Expand Up @@ -84,7 +82,7 @@ Increases in the major and minor version are accomplished manually by introducin

# Package Layout

The main IKVM package is 'IKVM'. This package contains the IKVM.ByteCode, IKVM.Runtime, IKVM.Java assemblies, and the
The main IKVM package is 'IKVM'. This package contains the IKVM.Runtime, IKVM.Java assemblies, and the
libikvm native library. This is the minimal set of files required to begin bootstrapping the JVM. However, the JVM
itself requires additional files which are present in the IKVM.Image package hierarchy.

Expand Down
12 changes: 4 additions & 8 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
</PropertyGroup>

<PropertyGroup Label="OpenJDK Info">
<OpenJdkDir>$(MSBuildThisFileDirectory)openjdk\</OpenJdkDir>
<OpenJdkDir>$(MSBuildThisFileDirectory)ext\openjdk\</OpenJdkDir>
<OpenJdkMajorVersion>1</OpenJdkMajorVersion>
<OpenJdkMinorVersion>8</OpenJdkMinorVersion>
<OpenJdkMicroVersion>0</OpenJdkMicroVersion>
<OpenJdkUpdateVersion>275</OpenJdkUpdateVersion>
<OpenJdkBuildNumber>b01</OpenJdkBuildNumber>
<OpenJdkUpdateVersion>422</OpenJdkUpdateVersion>
<OpenJdkBuildNumber>b05</OpenJdkBuildNumber>
<OpenJdkVersion>OpenJDK $(OpenJdkMinorVersion)u$(OpenJdkUpdateVersion) $(OpenJdkBuildNumber)</OpenJdkVersion>
<OpenJdkFullVersion>$(OpenJdkMajorVersion).$(OpenJdkMinorVersion).$(OpenJdkMicroVersion)_$(OpenJdkUpdateVersion)-$(OpenJdkBuildNumber)</OpenJdkFullVersion>
<OpenJdkVendor>Oracle</OpenJdkVendor>
Expand Down Expand Up @@ -65,7 +65,7 @@
</PropertyGroup>

<PropertyGroup Label="Build Info">
<LangVersion Condition=" '$(LangVersion)' == '' ">10.0</LangVersion>
<LangVersion Condition=" '$(LangVersion)' == '' ">12.0</LangVersion>
<NoWarn>$(NoWarn);1591;1573;CS8002;NU5100;NU5118;NU5128;MSB3245;NETSDK1023</NoWarn>
<AutoGenerateBindingRedirects Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net461'))">true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net461'))">true</GenerateBindingRedirectsOutputType>
Expand Down Expand Up @@ -103,10 +103,6 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
13 changes: 5 additions & 8 deletions IKVM.deps.targets
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<Project>

<ItemGroup>
<PackageReference Include="IKVM.ByteCode" Version="9.0.0" />
</ItemGroup>

<Choose>
<When Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net461'))">
<ItemGroup>
<Reference Include="System.Configuration" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Security" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.IO.Pipelines" Version="6.0.3" />
<PackageReference Include="System.IO.Pipelines" Version="8.0.0" />
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
Expand All @@ -27,13 +31,6 @@
<PackageReference Include="System.Data.Odbc" Version="6.0.0" />
</ItemGroup>
</When>
<When Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netcoreapp3.1'))">
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="6.0.0" />
<PackageReference Include="System.Data.Odbc" Version="6.0.0" />
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
</ItemGroup>
</When>
</Choose>

</Project>
10 changes: 2 additions & 8 deletions IKVM.refs.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);GetIkvmLibsTfmSpecificContent;GetIkvmLibsTfmSpecificDebugSymbols;GetIkvmJavaTfmSpecificContent;GetIkvmJavaTfmSpecificDebugSymbols</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)src\IKVM.ByteCode\IKVM.ByteCode.csproj">
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)src\IKVM.Runtime\IKVM.Runtime.csproj">
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
Expand All @@ -33,14 +27,14 @@
<OutputItemType>IkvmJavaItem</OutputItemType>
<IkvmJavaRuntimeIdentifier>win</IkvmJavaRuntimeIdentifier>
</ProjectReference>
<ProjectReference Include="$(MSBuildThisFileDirectory)src\IKVM.Java.runtime.linux\IKVM.Java.runtime.linux.csproj" Condition="$(_EnabledRuntimes.Contains(';linux-'))">
<ProjectReference Include="$(MSBuildThisFileDirectory)src\IKVM.Java.runtime.linux\IKVM.Java.runtime.linux.csproj" Condition="$(_EnabledRuntimes.Contains(';linux-')) And $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netcoreapp3.1'))">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<Private>False</Private>
<PrivateAssets>all</PrivateAssets>
<OutputItemType>IkvmJavaItem</OutputItemType>
<IkvmJavaRuntimeIdentifier>linux</IkvmJavaRuntimeIdentifier>
</ProjectReference>
<ProjectReference Include="$(MSBuildThisFileDirectory)src\IKVM.Java.runtime.osx\IKVM.Java.runtime.osx.csproj" Condition="$(_EnabledRuntimes.Contains(';osx-'))">
<ProjectReference Include="$(MSBuildThisFileDirectory)src\IKVM.Java.runtime.osx\IKVM.Java.runtime.osx.csproj" Condition="$(_EnabledRuntimes.Contains(';osx-')) And $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netcoreapp3.1'))">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<Private>False</Private>
<PrivateAssets>all</PrivateAssets>
Expand Down
Loading

0 comments on commit 55e17a5

Please sign in to comment.