Skip to content

test(docker): enable Python→C# integration test in cli image#842

Open
G00dS0ul wants to merge 1 commit into
metacall:developfrom
G00dS0ul:test/enable-python-csharp-integration
Open

test(docker): enable Python→C# integration test in cli image#842
G00dS0ul wants to merge 1 commit into
metacall:developfrom
G00dS0ul:test/enable-python-csharp-integration

Conversation

@G00dS0ul

@G00dS0ul G00dS0ul commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Description

Re-enables the C# section of the Python integration test in
tools/docker/tests/scripts/index.py, which was previously commented out.

The test loads Sum.cs via the C# loader and asserts:

  • sum_cs(3, 4) == 7
  • greet_cs('MetaCall') == 'Hello MetaCall from C#!'

This PR is expected to FAIL in CI. It is intentionally opened to surface the
cs_loader init failure in the metacall/core:cli runtime image so we can track
and fix it separately (coordinated with @viferga).

Root cause of the failure

On C# loader init, netcore_linux::ConfigAssemblyName() builds the Trusted
Platform Assemblies list by iterating the runtime/assembly directory, which is
configured to /usr/local/metacall/build. That path exists in the dev/build
image but not in the stripped runtime/cli image, so the directory scan
fails.

Decoded stack trace from the published metacall/core:cli image:

terminate called after throwing 'std::experimental::filesystem::filesystem_error'
  what(): directory iterator cannot open directory: No such file or directory [/usr/local/metacall/build]
#12 cs_loader_impl.c:236   cs_loader_impl_initialize
#10 netcore_linux.cpp:247  start
#9  netcore_linux.cpp:87    ConfigAssemblyName
#8  netcore_linux.h:100     directory_iterator  → "/usr/local/metacall/build"
#6  __cxa_throw → #5 std::terminate() → #2 abort

Notes:

  • The published :cli image predates Fix cs_loader process crash on missing TPA directory (#789) #831, so it still hits the throwing
    directory_iterator (hard abort / SIGABRT). With Fix cs_loader process crash on missing TPA directory (#789) #831's
    AddFilesFromDirectoryToTpaList error_code guard now on develop, a cli image
    rebuilt from source instead fails gracefully: metacall_load_from_file('cs', ...)
    returns false and the Python assertion fails cleanly. Either way the test is red.
  • The real fix (separate PR) is to point the C# assembly search path at the
    actual install location in the runtime image instead of the build dir.
  • index.js contains the same commented-out C# block; left commented in this
    PR and deferred.

Relates to #123 (Make C# Loader production ready).

Type of change

  • New test (adds/enables test coverage)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change

Checklist

  • I have performed a self-review of my own code
  • I have commented my code where necessary
  • My changes generate no new warnings
  • This change requires follow-up work (cs_loader install-path fix) — tracked under Make C# Loader production ready #123

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.

1 participant