Skip to content

Add support for s390x (IBM Z) architecture#119

Merged
chtenb merged 4 commits intoRubjerg:masterfrom
Jawahars:s390x-support
Mar 9, 2026
Merged

Add support for s390x (IBM Z) architecture#119
chtenb merged 4 commits intoRubjerg:masterfrom
Jawahars:s390x-support

Conversation

@Jawahars
Copy link
Contributor

@Jawahars Jawahars commented Mar 5, 2026

Add support for s390x (IBM Z) architecture

Summary

This PR adds support for s390x architecture (IBM Z/zLinux) to the Graphviz.NetWrapper library.

Problem

Currently, when running on s390x architecture, the library doesn't recognize it and falls back to "unknown", resulting in incorrect runtime identifier paths (linux-unknown instead of linux-s390x).

Solution

Added Architecture.S390x case to the architecture detection switch statement in GraphvizCommand.cs.

Changes

  • Modified Rubjerg.Graphviz/GraphvizCommand.cs to include s390x architecture detection

Compatibility

  • No breaking changes
  • Backward compatible with existing architectures
  • Uses standard .NET Architecture.S390x enum value (available since .NET 6)

Additional Context

  • This enables the library to work properly on IBM Z systems without workarounds

Fixes #118

@chtenb
Copy link
Member

chtenb commented Mar 6, 2026

Can you please make sure to test this change, and explain how you tested it, before I merge and release a new version?
The generated package can be downloaded from the CI, or you can build it yourself.

Uses a numeric cast for the S390x enum value to maintain compatibility with .NET Standard 2.0 while supporting newer .NET 6+ environments.
@Jawahars
Copy link
Contributor Author

Jawahars commented Mar 9, 2026

Test Environment

  • Platform: IBM Z Linux (s390x architecture)
  • OS: Red Hat UBI 10.1 (ubi-minimal)
  • Runtime: .NET 8.0 (ASP.NET Core)
  • Package Tested: Rubjerg.Graphviz 3.0.4-dev-20260309141834
  • Application: Production ASP.NET Core application with graph rendering features

How I Tested

  1. Since the NuGet package doesn't include pre-built native binaries for s390x, I compiled libGraphvizWrapper.so from source using gcc on s390x hardware.
  2. Updated project to use the dev NuGet package via local source
  3. Deployed the wrapper to runtimes/linux-s390x/native/ directory
  4. Ran application in Docker container on s390x hardware and the charts are rendered using Graphviz

Key Improvement

Before this PR: The package would look for binaries in linux-unknown/native/ on s390x systems, requiring workarounds with symlinks.

After this PR: The package now correctly recognizes s390x architecture and searches linux-s390x/native/ directly, eliminating the need for linux-unknown fallback.

@chtenb
Copy link
Member

chtenb commented Mar 9, 2026

Since our automated tests only run against .NET 8.0, I've verified manually that this causes no runtime issues in .NET versions prior to version 6.0.

@chtenb chtenb merged commit a85d97a into Rubjerg:master Mar 9, 2026
7 checks passed
@Jawahars Jawahars deleted the s390x-support branch March 9, 2026 17:09
@Jawahars
Copy link
Contributor Author

Jawahars commented Mar 9, 2026

Thank you @chtenb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for s390x (IBM Z) architecture

2 participants