-
Notifications
You must be signed in to change notification settings - Fork 17
Linux support #95
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
Merged
Linux support #95
Changes from 78 commits
Commits
Show all changes
101 commits
Select commit
Hold shift + click to select a range
6b6b5c2
wip
chtenb 105b334
Restore some windows props
chtenb e352956
Fix copying behavior
chtenb 3f48ca7
fix copy command
chtenb 4951e66
Remove .exe and .dll suffixes
chtenb b361458
Do not check all files for crlf
chtenb e4e67ac
typo
chtenb b979afa
Also patch rpath of executables
chtenb bf02b33
Renable some windows includes
chtenb 5c72e88
test
chtenb 642b37a
Fix build issues on windows
chtenb 65aacf0
remove debug output
chtenb 5f92aa8
guard kernel32 refs
chtenb 01ab875
fixup
chtenb 8fdf181
Comment test sources
chtenb 8ea18d6
Merge remote-tracking branch 'github/linux' into linux
chtenb d21aea2
Adjust patching
chtenb 3dc946d
Make tests pass when never deallocating graphs
chtenb 0a6cf86
Clean up scripts and update upgrade instructions
chtenb 533b142
Update readme
chtenb ae6c959
Update readme
chtenb cb28c52
Use version 11.0.0
chtenb d7801e9
Test agclose in ConsoleApplication
chtenb ceaf6e1
Implement Close() in RootGraph to be able to manually trigger destruc…
chtenb d3ef45b
Add two agclose reproductions
chtenb 750dd8b
Add native test
chtenb da6891b
simplify repros
chtenb 8758c7b
temp
chtenb 1813b47
attempt linux ci
chtenb 0c5db62
fix
chtenb f05d778
whitespace fix
chtenb c1ebf83
formatting
chtenb 1913eca
fix
chtenb 06d5c45
debug
chtenb c29705b
debug
chtenb d8ea78f
debug
chtenb 3e80082
debug
chtenb 9ba9b7c
Merge remote-tracking branch 'origin/master' into linux
chtenb 394db7f
Build twice
chtenb c9d0b0e
test
chtenb c68a2a6
Add libgts install
chtenb c4ee3c5
update
chtenb 3d50fd0
fix
chtenb 1b51991
minor fix
chtenb 06463dd
minor fix
chtenb ff429da
reenable free in marshaling
chtenb c643205
Fix symlinks in linux files
chtenb 70797bb
reenable closing graphs
chtenb cb1470f
make more consistent
chtenb 5a718d8
replace cp -r with cp -a
chtenb 70aa94a
Normalize .so versions
chtenb 9286b9d
fixup
chtenb a47b82b
update
chtenb 244c65c
change ci
chtenb d5c07c3
update
chtenb 87cd93c
rename
chtenb 74e5191
update
chtenb 72522c2
rename
chtenb 1dd5635
rename
chtenb 31c4d0c
update
chtenb e5b1b18
add rid logic
chtenb bf69601
Remove net48
chtenb 3cc4a30
Rename NugetTest to NugetOrgTest
chtenb 3b6e075
.
chtenb 5f9d25f
update readme
chtenb 770be1d
Split tests into separate sln
chtenb 641e806
update ci
chtenb 2bc0e42
Move nuget org tests to subdir
chtenb 8df58fc
Fix nuget org tests
chtenb 20c5cea
Disable nuget.org tests for now
chtenb e6395ab
format
chtenb 10051ff
format tests
chtenb 74853e6
Upload correct artefact
chtenb e60e51e
fix
chtenb cb7cef9
Move checks to workflow
chtenb b4f7f3e
update
chtenb a50feeb
run static checks on windows
chtenb 3fe94a8
crlf
chtenb cf864ac
Introduce justfile
chtenb 266b41e
use justfile in actions
chtenb bb390af
fix
chtenb ccdd383
simplify
chtenb 009a951
.
chtenb 61d46cd
.
chtenb 11b6dcb
.
chtenb fb7892a
asdf
chtenb 45ee40a
change checks
chtenb 7330bae
update
chtenb ef4e4ee
remove all bash scripts
chtenb 415b0b7
Embed debug symbols
chtenb 5d3bb75
naming convention
chtenb 04c0e59
package version logic
chtenb 581853d
fixup
chtenb 41138c2
fix
chtenb 67de038
fix
chtenb 03d52ba
fix
chtenb 374518f
fix
chtenb c52bf54
fix
chtenb d7aea6e
use exit
chtenb ea7175c
trim
chtenb 317407c
add readme
chtenb 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,40 @@ | ||
name: Static checks | ||
|
||
on: | ||
push: { branches: [ master ] } | ||
pull_request: { branches: [ master ] } | ||
release: { types: [published] } # runs on “Publish release” button | ||
workflow_dispatch: # lets you run it by hand | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
name: Checkout Code | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 8.0.x | ||
|
||
- name: Restore Tools | ||
run: dotnet tool restore | ||
|
||
- name: Check if line endings are CRLF | ||
run: | | ||
bash -c "git grep -rlIP -- ':!GraphvizWrapper/graphvizfiles/*' ':!*.sh' | xargs unix2dos" | ||
git diff --exit-code | ||
|
||
- name: Check if README is up-to-date | ||
run: git diff --exit-code -- README.md | ||
|
||
- name: Check if code is formatted | ||
run: dotnet format whitespace --verify-no-changes -v diag Rubjerg.Graphviz.sln | ||
|
||
- name: Check if code is formatted | ||
run: dotnet format whitespace --verify-no-changes -v diag Rubjerg.Graphviz.Tests.sln | ||
|
||
- name: Check for loose ends | ||
run: | | ||
bash -c "! git grep 'FIX''NOW'" |
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,77 @@ | ||
# .github/workflows/ci-pack.yml | ||
name: CI-Pack | ||
|
||
on: | ||
push: { branches: [ master ] } | ||
pull_request: { branches: [ master ] } | ||
release: { types: [published] } # runs on “Publish release” button | ||
workflow_dispatch: # lets you run it by hand | ||
|
||
jobs: | ||
win-build: | ||
uses: ./.github/workflows/win-build.yml | ||
|
||
linux-build: | ||
uses: ./.github/workflows/linux-build.yml | ||
|
||
pack: | ||
needs: [win-build, linux-build] # ← the two workflow_call jobs | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
# 1) bring the two per-OS packages into this job -------------------- | ||
- uses: actions/download-artifact@v4 | ||
with: { name: win-bits, path: artifacts/win } | ||
- uses: actions/download-artifact@v4 | ||
with: { name: linux-bits, path: artifacts/linux } | ||
|
||
# 2) unzip → merge → zip ------------------------------------------ | ||
- name: Merge NuGet packages | ||
id: merge | ||
shell: pwsh | ||
run: | | ||
# locate both nupkgs (Rubjerg.Graphviz.<ver>.nupkg) | ||
$winPkg = Get-ChildItem artifacts/win -Filter *.nupkg | Select -First 1 | ||
$linuxPkg = Get-ChildItem artifacts/linux -Filter *.nupkg | Select -First 1 | ||
if (-not $winPkg -or -not $linuxPkg) { throw "Packages missing" } | ||
|
||
# extract <id> and <version> from the file name | ||
if ($winPkg.Name -notmatch '^(.+?)\.(\d+\.\d+\.\d+(?:-[A-Za-z0-9\.-]+)?)\.nupkg$') { | ||
throw "Unexpected package file name $($winPkg.Name)" | ||
} | ||
$id = $Matches[1] # Rubjerg.Graphviz | ||
$version = $Matches[2] # 2.0.2 (or 2.0.2-beta etc.) | ||
|
||
$stage = "stage" | ||
Remove-Item $stage -Recurse -Force -ErrorAction SilentlyContinue | ||
New-Item -ItemType Directory -Path $stage | Out-Null | ||
|
||
Expand-Archive $winPkg.FullName -DestinationPath $stage -Force | ||
Expand-Archive $linuxPkg.FullName -DestinationPath $stage -Force | ||
|
||
$outFile = "$id.$version.nupkg" | ||
Compress-Archive "$stage\*" $outFile -Force | ||
|
||
# expose the path for later steps | ||
"outfile=$outFile" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | ||
|
||
# 3) upload the merged package as a build artefact ------------------ | ||
- name: Upload final package as artefact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: merged-nupkg | ||
path: ${{ steps.merge.outputs.outfile }} | ||
retention-days: 30 | ||
|
||
# 4) push to NuGet only on a GitHub Release ------------------------- | ||
# - name: Push to NuGet.org | ||
# if: github.event_name == 'release' | ||
# env: | ||
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | ||
# run: | | ||
# nuget push "${{ steps.merge.outputs.outfile }}" ` | ||
# -Source https://api.nuget.org/v3/index.json ` | ||
# -ApiKey $env:NUGET_API_KEY | ||
|
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,73 @@ | ||
name: linux-build | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
artifact-name: | ||
description: "Linux bits" | ||
value: linux-bits | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
name: Checkout Code | ||
|
||
# Necessary for running neato | ||
- name: Install libgts | ||
run: sudo apt-get update && sudo apt-get install -y libgts-0.7-5 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 8.0.x | ||
|
||
- name: Restore Tools | ||
run: dotnet tool restore | ||
|
||
- name: Restore NuGet Packages | ||
run: dotnet restore Rubjerg.Graphviz.sln | ||
|
||
- name: Print PWD | ||
run: pwd | ||
|
||
- name: Build App | ||
run: dotnet build Rubjerg.Graphviz.sln --configuration Release --no-restore | ||
|
||
- name: Build App Another Time because dot net sucks and cannot see the native dependencies the first time | ||
run: dotnet build Rubjerg.Graphviz.sln --configuration Release --no-restore | ||
|
||
- name: Debug Intermediate Output | ||
run: ls -la /home/runner/work/Graphviz.NetWrapper/Graphviz.NetWrapper/Rubjerg.Graphviz/Resources | ||
|
||
- name: Debug Build Output | ||
run: ls -la /home/runner/work/Graphviz.NetWrapper/Graphviz.NetWrapper/Rubjerg.Graphviz/bin/x64/Release/netstandard2.0/ | ||
|
||
- name: Restore (just built) NuGet Packages for Tests | ||
run: dotnet restore Rubjerg.Graphviz.Tests.sln | ||
|
||
- name: Build Tests | ||
run: dotnet build Rubjerg.Graphviz.Tests.sln --configuration Release --no-restore | ||
|
||
- name: Debug Test Build Output | ||
run: ls -la /home/runner/work/Graphviz.NetWrapper/Graphviz.NetWrapper/Rubjerg.Graphviz.Test/bin/x64/Release/net8.0/ | ||
|
||
- name: Run Unittests | ||
run: bash run-tests-netcore.sh Rubjerg.Graphviz.Test/Rubjerg.Graphviz.Test.csproj | ||
|
||
- name: Run Transitive Tests | ||
run: bash run-tests-netcore.sh Rubjerg.Graphviz.TransitiveTest/Rubjerg.Graphviz.TransitiveTest.csproj | ||
|
||
- name: Locate nupkg | ||
id: pkg | ||
run: | | ||
pkg=$(find . -name "Rubjerg.Graphviz.*.nupkg" | head -1) | ||
echo "package=$pkg" >> "$GITHUB_OUTPUT" | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: linux-bits | ||
path: ${{ steps.pkg.outputs.package }} | ||
retention-days: 3 |
This file was deleted.
Oops, something went wrong.
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,69 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: win-build | ||
|
||
# Controls when the action will run. Triggers the workflow on push or pull request | ||
# events but only for the master branch | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
artifact-name: | ||
description: "Windows bits" | ||
value: win-bits | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
name: Checkout Code | ||
|
||
- name: Add msbuild to PATH | ||
uses: microsoft/setup-msbuild@v1.0.2 | ||
|
||
- name: Setup NuGet.exe for use with actions | ||
uses: NuGet/setup-nuget@v1.0.5 | ||
|
||
- name: Restore Tools | ||
run: dotnet tool restore | ||
|
||
- name: Restore NuGet Packages | ||
run: nuget restore Rubjerg.Graphviz.sln | ||
|
||
- name: Build App | ||
run: msbuild Rubjerg.Graphviz.sln /p:Configuration=Release | ||
|
||
- name: Restore (just built) NuGet Packages for Tests | ||
run: nuget restore Rubjerg.Graphviz.Tests.sln | ||
|
||
- name: Build Tests | ||
run: msbuild Rubjerg.Graphviz.Tests.sln /p:Configuration=Release | ||
|
||
- name: Run Unittests (.NET 8) | ||
run: bash run-tests-netcore.sh Rubjerg.Graphviz.Test\Rubjerg.Graphviz.Test.csproj | ||
|
||
- name: Run Transitive Tests (.NET 8) | ||
run: bash run-tests-netcore.sh Rubjerg.Graphviz.TransitiveTest\Rubjerg.Graphviz.TransitiveTest.csproj | ||
|
||
|
||
# Locate the package that GeneratePackageOnBuild just produced | ||
- name: Locate nupkg | ||
id: pkg | ||
shell: pwsh | ||
run: | | ||
# search everywhere under Rubjerg.Graphviz\bin\ for the first package | ||
$pkg = Get-ChildItem Rubjerg.Graphviz\bin -Recurse -Filter "Rubjerg.Graphviz.*.nupkg" -File | | ||
Where-Object { $_.Name -notlike "*.symbols.nupkg" } | | ||
Select-Object -First 1 | ||
|
||
if (-not $pkg) { throw "Rubjerg.Graphviz nupkg not found" } | ||
|
||
"package=$($pkg.FullName)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | ||
|
||
# Upload that single file | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: win-bits | ||
path: ${{ steps.pkg.outputs.package }} | ||
retention-days: 3 |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
bin | ||
x64 | ||
*.vcxproj.user | ||
*.svg |
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 |
---|---|---|
@@ -1,20 +1,30 @@ | ||
#include <iostream> | ||
#include <conio.h> | ||
#include "GraphvizWrapper.h" | ||
#include <string.h> | ||
|
||
#ifdef _WIN32 | ||
#include <windows.h> | ||
#else | ||
#include <dlfcn.h> | ||
#endif | ||
|
||
#include "../GraphvizWrapper/GraphvizWrapper.h" | ||
|
||
using namespace std; | ||
|
||
int main() | ||
{ | ||
int main() { | ||
cout << "Make sure to set the current working directory to the repository root!" << endl; | ||
cout << "Running tests..." << endl; | ||
|
||
cout << test_agread() << endl; | ||
cout << test_agmemread() << endl; | ||
cout << test_rj_agmemread() << endl; | ||
cout << missing_label_repro() << endl; | ||
cout << stackoverflow_repro() << endl; | ||
|
||
cout << "Press key to exit.."; | ||
auto c = _getch(); | ||
cout << agclose_repro() << endl; | ||
|
||
cout << "Press Enter to exit..."; | ||
cin.get(); // Portable replacement for _getch() | ||
|
||
return 0; | ||
} | ||
|
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.