Skip to content

Commit

Permalink
Merge branch 'release/8.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabii committed May 14, 2023
2 parents 5484303 + 9871606 commit 72775a3
Show file tree
Hide file tree
Showing 1,097 changed files with 83,290 additions and 67,110 deletions.
120 changes: 65 additions & 55 deletions .github/workflows/IKVM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ on:
jobs:
build-openjdk:
name: Build OpenJDK
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v1
uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache OpenJDK Build
uses: actions/cache@v3
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') }}-8
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@v1
uses: andstor/file-existence-action@v2
with:
files: openjdk/build/linux-x86_64-normal-server-release/stamp
- name: Fetch OpenJDK 7
Expand Down Expand Up @@ -74,13 +74,7 @@ jobs:
- name: Package OpenJDK
run: |
zip -r openjdk-build-linux-x86_64-normal-server-release.zip \
linux-x86_64-normal-server-release/langtools/gensrc \
linux-x86_64-normal-server-release/corba/gensrc \
linux-x86_64-normal-server-release/jdk/gensrc \
linux-x86_64-normal-server-release/jdk/impsrc \
linux-x86_64-normal-server-release/jdk/lib \
linux-x86_64-normal-server-release/jdk/classes \
linux-x86_64-normal-server-release/images
linux-x86_64-normal-server-release/*
working-directory: openjdk/build
- name: Upload OpenJDK
uses: actions/upload-artifact@v3
Expand All @@ -94,7 +88,7 @@ jobs:
key: jtreg-build--${{ runner.os }}--${{ hashFiles('jtreg/**', 'openjdk/build/linux-x86_64-normal-server-release/images/j2sdk-image', '!jtreg/build') }}-6
- name: Check OpenJDK Test Harness Build Stamp
id: jtreg-build-stamp
uses: andstor/file-existence-action@v1
uses: andstor/file-existence-action@v2
with:
files: jtreg/build/stamp
- name: Build OpenJDK Test Harness
Expand All @@ -113,20 +107,30 @@ jobs:
name: Build IKVM
needs:
- build-openjdk
timeout-minutes: 120
timeout-minutes: 240
runs-on: windows-latest
steps:
- name: Set Paths (Windows)
shell: pwsh
run: |
$WORKPATH="C:\work"
mkdir $WORKPATH
mkdir $WORKPATH\temp
mkdir $WORKPATH\dotnet
mkdir $WORKPATH\nuget
mkdir $WORKPATH\nuget\packages
mkdir $WORKPATH\ikvm
Add-Content $env:GITHUB_ENV "`nWORKPATH=$WORKPATH"
Add-Content $env:GITHUB_ENV "`nTMP=$WORKPATH\temp`nTEMP=$WORKPATH\temp`nTMPDIR=$WORKPATH\temp"
Add-Content $env:GITHUB_ENV "`nDOTNET_INSTALL_DIR=$WORKPATH\dotnet"
Add-Content $env:GITHUB_ENV "`nNUGET_PACKAGES=$WORKPATH\nuget\packages"
New-Item -Path "$env:GITHUB_WORKSPACE\work" -ItemType SymbolicLink -Value "$WORKPATH\ikvm"
- name: Checkout Source
uses: actions/checkout@v3
with:
path: work
fetch-depth: 0
submodules: recursive
- name: Move Temporary Directory
shell: pwsh
run: Add-Content $env:GITHUB_ENV "`nTMP=${{ runner.temp }}`nTEMP=${{ runner.temp }}`nTMPDIR=${{ runner.temp }}"
- name: Setup .NET
shell: pwsh
run: Add-Content $env:GITHUB_ENV "`nDOTNET_INSTALL_DIR=${{ runner.temp }}\dotnet"
- name: Setup .NET 3.1
uses: actions/setup-dotnet@v3
with:
Expand All @@ -139,64 +143,67 @@ jobs:
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Cache LLVM and Clang
id: cache-llvm
uses: actions/cache@v3
with:
path: C:/Program Files/LLVM
key: llvm-15.0
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "15.0"
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected].13
uses: gittools/actions/gitversion/[email protected].15
with:
versionSpec: 5.x
- name: Execute GitVersion
uses: gittools/actions/gitversion/[email protected].13
uses: gittools/actions/gitversion/[email protected].15
with:
targetPath: ${{ env.WORKPATH }}\ikvm
useConfigFile: true
configFilePath: ${{ env.WORKPATH }}\ikvm\GitVersion.yml
- name: Setup WSL
uses: Vampire/setup-wsl@v1
uses: Vampire/setup-wsl@v2
with:
additional-packages:
zlib1g-dev
libmpc-dev
libmpfr-dev
libgmp-dev
clang
llvm
llvm-dev
libxml2
gcc
g++
g++-arm-linux-gnueabihf
gcc-arm-linux-gnueabihf
libc6-armhf-cross
gcc-aarch64-linux-gnu
g++-aarch64-linux-gnu
libc6-arm64-cross
- name: Move NuGet Directory
shell: pwsh
run: Add-Content $env:GITHUB_ENV "`nNUGET_PACKAGES=${{ runner.temp }}\nuget\packages"
- name: Cache NuGet
uses: actions/cache@v3
with:
path: ${{ runner.temp }}\nuget\packages
key: ${{ runner.os }}-nuget-${{ hashFiles('IKVM.sln', 'src\**\*.csproj', 'src\**\*.msbuildproj') }}
restore-keys: ${{ runner.os }}-nuget-
path: ${{ env.NUGET_PACKAGES }}
key: ${{ runner.os }}-nuget-2-${{ hashFiles('IKVM.sln', 'src\**\*.csproj', 'src\**\*.msbuildproj') }}
restore-keys: ${{ runner.os }}-nuget-2-
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Download OpenJDK 8 Build
uses: actions/download-artifact@v3
with:
name: openjdk-build-linux-x86_64-normal-server-release
path: openjdk/build
path: ${{ env.WORKPATH }}/ikvm/openjdk/build
- name: Restore OpenJDK 8 Build
shell: pwsh
run: Expand-Archive openjdk-build-linux-x86_64-normal-server-release.zip .
working-directory: openjdk/build
working-directory: ${{ env.WORKPATH }}\ikvm\openjdk\build
- name: Download JTReg Build
uses: actions/download-artifact@v3
with:
name: jtreg-build
path: jtreg
path: ${{ env.WORKPATH }}/ikvm/jtreg
- name: Restore JTReg Build
shell: pwsh
run: Expand-Archive jtreg-build.zip .
working-directory: jtreg
working-directory: ${{ env.WORKPATH }}\ikvm\jtreg
- name: NuGet Restore
run: dotnet restore IKVM.sln
working-directory: ${{ env.WORKPATH }}\ikvm
- name: Build Artifacts
run: |
msbuild /m /bl `
Expand All @@ -217,47 +224,48 @@ jobs:
/p:CreateHardLinksForPublishFilesIfPossible=true `
/p:ContinuousIntegrationBuild=true `
IKVM.dist.msbuildproj
working-directory: ${{ env.WORKPATH }}\ikvm
- name: Upload MSBuild Log
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: msbuild.binlog
path: msbuild.binlog
path: ${{ env.WORKPATH }}\ikvm\msbuild.binlog
- name: Package NuGet Packages
run: tar czvf C:\nuget.tar.gz nuget
working-directory: dist
working-directory: ${{ env.WORKPATH }}\ikvm\dist
- name: Upload NuGet Packages
uses: actions/upload-artifact@v3
with:
name: nuget
path: C:\nuget.tar.gz
- name: Package Binaries
run: tar czvf C:\bin.tar.gz bin
working-directory: dist
working-directory: ${{ env.WORKPATH }}\ikvm\dist
- name: Upload Binaries
uses: actions/upload-artifact@v3
with:
name: bin
path: C:\bin.tar.gz
- name: Package Tools
run: tar czvf C:\tools.tar.gz tools
working-directory: dist
working-directory: ${{ env.WORKPATH }}\ikvm\dist
- name: Upload Tools
uses: actions/upload-artifact@v3
with:
name: tools
path: C:\tools.tar.gz
- name: Package Image
run: tar czvf C:\image.tar.gz image
working-directory: dist
working-directory: ${{ env.WORKPATH }}\ikvm\dist
- name: Upload Image
uses: actions/upload-artifact@v3
with:
name: image
path: C:\image.tar.gz
- name: Package Tests
run: tar czvf C:\tests.tar.gz tests
working-directory: dist
working-directory: ${{ env.WORKPATH }}\ikvm\dist
- name: Upload Tests
uses: actions/upload-artifact@v3
with:
Expand All @@ -267,12 +275,14 @@ jobs:
run: |
git reset --hard
git clean -qfdx
working-directory: ${{ env.WORKPATH }}\ikvm
test:
strategy:
matrix:
run:
- IKVM.ByteCode.Tests
- IKVM.Tests
- ikvmc.Tests
- IKVM.Tools.Importer.Tests
- IKVM.Tools.Exporter.Tests
- IKVM.Tools.Tests
- IKVM.JTReg.TestAdapter.Tests
Expand All @@ -296,7 +306,7 @@ jobs:
sys: linux
- run: IKVM.Tools.Exporter.Tests
tfm: net6.0
- run: ikvmc.Tests
- run: IKVM.Tools.Importer.Tests
tfm: net6.0
- run: IKVM.OpenJDK.Tests?TestPartition=0
tfm: net6.0
Expand Down Expand Up @@ -342,7 +352,7 @@ jobs:
- run: IKVM.NET.Sdk.Tests
tfm: net6.0
sys: linux
name: Test (${{ matrix.run }}:${{ matrix.tfm }}:${{ matrix.sys }}
name: Test (${{ matrix.run }}:${{ matrix.tfm }}:${{ matrix.sys }})
needs:
- build-ikvm
timeout-minutes: 240
Expand All @@ -352,7 +362,7 @@ jobs:
if: runner.os == 'Windows'
shell: pwsh
run: |
$dir="C:\run"
$dir="C:\work"
mkdir $dir
mkdir $dir\temp
mkdir $dir\dotnet
Expand All @@ -368,7 +378,7 @@ jobs:
if: runner.os == 'Linux'
shell: pwsh
run: |
$dir="${{ runner.temp }}/run"
$dir="${{ runner.temp }}/work"
mkdir $dir
mkdir $dir/temp
mkdir $dir/dotnet
Expand All @@ -394,7 +404,7 @@ jobs:
dotnet-version: 7.0.x
- name: Setup WSL
if: matrix.sys == 'windows'
uses: Vampire/setup-wsl@v1
uses: Vampire/setup-wsl@v2
- name: Download Tests
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -464,12 +474,12 @@ jobs:
with:
dotnet-version: 7.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected].13
uses: gittools/actions/gitversion/[email protected].15
with:
versionSpec: 5.x
- name: Execute GitVersion
id: GitVersion
uses: gittools/actions/gitversion/[email protected].13
uses: gittools/actions/gitversion/[email protected].15
with:
useConfigFile: true
- name: Download NuGet Packages
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[submodule "openjdk"]
path = openjdk
url = https://github.com/ikvm-revived/jdk8u.git
url = https://github.com/ikvmnet/jdk8u.git
ignore = dirty
[submodule "jtreg"]
path = jtreg
url = https://github.com/ikvm-revived/jtreg.git
url = https://github.com/ikvmnet/jtreg.git
ignore = dirty
21 changes: 16 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,24 @@

## Build

Project should open within Visual Studio. Project can also be built with MSBuild on a Windows host. Project cannot currently be built on a Linux host, nor with an exclusively .NET Core version of MSBuild.
The project can be opened in Visual Studio, or it can be be built with MSBuild on a Windows host. The project cannot currently be built on a Linux host, nor with an exclusively .NET Core version of MSBuild.

The OpenJDK JDK8u source hierarchy and build results for Linux/x64 is required. These build artifacts cannot be built on Windows, or modern Linux hosts. Instead, they 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.
Prerequisites for building the project:
* A clone of the IKVM repository which includes submodules (e.g. `git clone --recurse-submodules https://github.com/ikvm-revived/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++
* 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`.
* LLVM installed with `clang` available on the path. LLVM is shipped with Visual Studio, but you will need to update your PATH to include the relevant bin directory (typically: `C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\bin`) or you can install a [standalone distribution of LLVM](https://releases.llvm.org/).
* Windows Subsystem for Linux enabled, and a Linux distribution with g++ installed
* 200GB of free disk space

Once the prerequisites are in place, to build IKVM from the command line you will use the following commands:

The GitHub action's generated artifact can simply be extract into the appropriate spot in `openjdk/build` to avoid building it yourself. Navigate to the GitHub Actions, find the latest successfuly build for the branch you're concerned with, and download the `openjdk-build-linux-x86_64-normal-server-release` artifact. Extract this zip file into `openjdk/build`.

IKVM includes a native library named 'ikvm-native' which must be built for the JNI functionality to work. The solution includes `.vcxproj` files that build both the win-x64, linux-x86 and linux-x64 versions of these libraries. However, the linux-* version require WSL to be enabled on your development machine. Within this WSL distribution ensure you have installed the GCC toolset. For Debian based distributions, this should be as simple as typing `apt-get install g++`.
```
dotnet restore IKVM.sln
msbuild IKVM.dist.msbuildproj
```

## Project

Expand Down
10 changes: 6 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
<NoWarn>$(NoWarn);1591;1573;CS8002;NU5100;NU5118;NU5128</NoWarn>
<AutoGenerateBindingRedirects Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net461'))">true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net461'))">true</GenerateBindingRedirectsOutputType>
<CopyRetryCount>15</CopyRetryCount>
<CopyRetryDelayMilliseconds>15000</CopyRetryDelayMilliseconds>
<AddSyntheticProjectReferencesForSolutionDependencies>false</AddSyntheticProjectReferencesForSolutionDependencies>
<CopyRetryCount>30</CopyRetryCount>
<CopyRetryDelayMilliseconds>15000</CopyRetryDelayMilliseconds>
<SupportedRuntimeIdentifiers>win7-x64;win7-x86;win81-arm;linux-x64;linux-arm;linux-arm64;osx-x64</SupportedRuntimeIdentifiers>
<EnabledRuntimeIdentifiers Condition=" '$(EnabledRuntimeIdentifiers)' == '' ">win7-x64;win7-x86;win81-arm;linux-x64;linux-arm;linux-arm64;osx-x64</EnabledRuntimeIdentifiers>
</PropertyGroup>

<ItemGroup>
Expand All @@ -32,9 +34,9 @@
</PropertyGroup>

<PropertyGroup Label="Package Info">
<RepositoryUrl Condition=" '$(RepositoryUrl)' == '' ">https://github.com/ikvm-revived/ikvm.git</RepositoryUrl>
<RepositoryUrl Condition=" '$(RepositoryUrl)' == '' ">https://github.com/ikvmnet/ikvm.git</RepositoryUrl>
<RepositoryType Condition=" '$(RepositoryType)' == '' ">git</RepositoryType>
<PackageProjectUrl Condition=" '$(PackageProjectUrl)' == '' ">https://github.com/ikvm-revived/ikvm</PackageProjectUrl>
<PackageProjectUrl Condition=" '$(PackageProjectUrl)' == '' ">https://github.com/ikvmnet/ikvm</PackageProjectUrl>
<PackageVersion Condition=" '$(PackageVersion)' == '' ">$(Version)</PackageVersion>
</PropertyGroup>

Expand Down
3 changes: 1 addition & 2 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project>

<ItemGroup>
<PackageReference Include="IKVM.Core.MSBuild" Version="0.1.11">
<PackageReference Include="IKVM.Core.MSBuild" Version="0.1.27">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github: [wasabii, NightOwl888, joniles]
github: [wasabii, NightOwl888]
custom: ["https://www.paypal.me/ShadStorhaug"]
Loading

0 comments on commit 72775a3

Please sign in to comment.