-
-
Notifications
You must be signed in to change notification settings - Fork 187
Add nanoCLR POSIX for MacOS and Linux #3313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Ellerbach
wants to merge
38
commits into
main
Choose a base branch
from
fix-nanoclr-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
4cc95f8
add nanoclr posix
Ellerbach 31e637e
Code style fixes for nanoframework/nf-interpreter PR#3313 (#3314)
nfbot 20e1127
Update src/CLR/Include/nanoCLR_Hardware.h
Ellerbach 9cfd3d6
some changes on PR feedback
Ellerbach 7b5b411
more changes
Ellerbach 81bb833
fix linux pipeline
Ellerbach ed98944
Code style fixes for nanoframework/nf-interpreter PR#3313 (#3318)
nfbot 24c3e54
fixibng build
Ellerbach 44df935
more chqnges
Ellerbach d3a4964
more changes
Ellerbach 889f720
fixing serial port warning and linux build
Ellerbach fc99cf3
Code style fixes for nanoframework/nf-interpreter PR#3313 (#3320)
nfbot 77e9b2c
fixing linux build, hopefully for real
Ellerbach 5334e7f
trying to fix the zin dll build
Ellerbach 55b091e
revert Thread.cpp to main - debug print block used uninitialized hr c…
Ellerbach 4bb6fc1
latest small fixes
Ellerbach 194468c
Merge branch 'main' into fix-nanoclr-update
Ellerbach 8e6830f
Code style fixes for nanoframework/nf-interpreter PR#3313 (#3323)
nfbot 9e54c14
adjusting for building everything and packaging everything properly
Ellerbach 8139a5f
fix: guard smoke-run for cross-compiled POSIX legs
Ellerbach 3fdd33e
fix: use macOS-latest runner for osx-x64 cross-compile leg
Ellerbach 374c747
fix: cross-compile linux-arm64 on ubuntu-22.04 x64 runner
Ellerbach 7e204c4
chore: publish nupkg as pipeline artifact for inspection
Ellerbach bcfc304
fix: use TargetFramework for native lib PackagePath in nupkg
Ellerbach d9d0096
fix: probe portable RID fallback in NativeNanoClrLoader
Ellerbach 78249c6
fixing encoding
Ellerbach fb342ec
last fix
Ellerbach 4a43e01
adjusting pal time for linux
Ellerbach 591ca49
attempt to fix linux run issues
Ellerbach 61ec205
debug for linux
Ellerbach d2f0694
timing fix for linux execution
Ellerbach 82477e0
reverting
Ellerbach f349f9a
fixing linuxfixing properly linux timing
Ellerbach db7b19e
fix git mess
Ellerbach 27508fe
fixing posix for real this time, yeah!
Ellerbach 5fcb759
more linux fixes
Ellerbach efea4e0
more fixes from PR review and cleaning
Ellerbach 94db178
Merge branch 'main' into fix-nanoclr-update
Ellerbach File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| name: posix-nanoclr | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - "targets/posix/**" | ||
| - "src/CLR/**" | ||
| - "src/HAL/**" | ||
| - "src/PAL/**" | ||
| - ".github/workflows/posix-nanoclr.yml" | ||
| pull_request: | ||
| paths: | ||
| - "targets/posix/**" | ||
| - "src/CLR/**" | ||
| - "src/HAL/**" | ||
| - "src/PAL/**" | ||
| - ".github/workflows/posix-nanoclr.yml" | ||
|
|
||
| jobs: | ||
| build-posix-nanoclr: | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - os: macos-14 | ||
| label: macOS-arm64 | ||
| posix_rid: osx-arm64 | ||
| - os: macos-latest | ||
| label: macOS-x64 | ||
| posix_rid: osx-x64 | ||
| - os: ubuntu-22.04 | ||
| label: Linux-x64 | ||
| posix_rid: linux-x64 | ||
| - os: ubuntu-22.04 | ||
| label: Linux-arm64 | ||
| posix_rid: linux-arm64 | ||
| fail-fast: false | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
| name: Build (${{ matrix.label }}) | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install arm64 cross-toolchain | ||
| if: matrix.posix_rid == 'linux-arm64' | ||
| run: sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu | ||
|
|
||
| - name: Install Ninja (if missing) | ||
| run: | | ||
| if ! command -v ninja >/dev/null 2>&1; then | ||
| if command -v apt-get >/dev/null 2>&1; then | ||
| sudo apt-get install -y ninja-build | ||
| else | ||
| brew install ninja | ||
| fi | ||
| fi | ||
|
|
||
| - name: Configure | ||
| run: | | ||
| # Derive cmake arch from the RID matrix variable. | ||
| case "${{ matrix.posix_rid }}" in | ||
| osx-arm64|linux-arm64) NANO_ARCH=arm64 ;; | ||
| osx-x64|linux-x64) NANO_ARCH=x86_64 ;; | ||
| esac | ||
| # For linux-arm64, cross-compile via the aarch64-linux-gnu toolchain. | ||
| TOOLCHAIN_ARG="" | ||
| if [ "${{ matrix.posix_rid }}" = "linux-arm64" ]; then | ||
| TOOLCHAIN_ARG="-DCMAKE_TOOLCHAIN_FILE=$(pwd)/targets/posix/toolchain-aarch64-linux-gnu.cmake" | ||
| fi | ||
| cmake -S targets/posix -B build/posix -G Ninja \ | ||
| -DNANO_POSIX_ARCH=${NANO_ARCH} \ | ||
| -DNANO_POSIX_ENABLE_SMOKE=ON \ | ||
| ${TOOLCHAIN_ARG} | ||
|
|
||
| - name: Build | ||
| run: cmake --build build/posix --verbose | ||
|
|
||
| - name: Smoke Run | ||
| run: | | ||
| set -euo pipefail | ||
| # Normalise host CPU name: Linux arm64 reports 'aarch64'; macOS reports 'arm64'. | ||
| case "$(uname -m)" in | ||
| arm64|aarch64) HOST_CANONICAL=arm64 ;; | ||
| x86_64) HOST_CANONICAL=x86_64 ;; | ||
| *) HOST_CANONICAL="$(uname -m)" ;; | ||
| esac | ||
| case "${{ matrix.posix_rid }}" in | ||
| *-arm64) TARGET_ARCH=arm64 ;; | ||
| *-x64) TARGET_ARCH=x86_64 ;; | ||
| esac | ||
| if [ "${HOST_CANONICAL}" = "${TARGET_ARCH}" ]; then | ||
| ./build/posix/bin/nanoFramework.nanoCLR.test | tee build/posix/smoke.log | ||
| if ! grep -Eq '[0-9]+\.[0-9]+\.[0-9]+' build/posix/smoke.log; then | ||
| echo "ERROR: smoke output validation failed." | ||
| exit 1 | ||
| fi | ||
| else | ||
| echo "Skipping smoke run: host=$(uname -m) (${HOST_CANONICAL}), target=${TARGET_ARCH} (cross-compiled binary cannot execute on this runner)." | ||
| fi | ||
|
|
||
| - name: Upload Artifacts | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: posix-nanoclr-${{ matrix.label }} | ||
| path: | | ||
| build/posix/lib/nanoFramework.nanoCLR.* | ||
| build/posix/bin/nanoFramework.nanoCLR.test | ||
| build/posix/smoke.log | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.