Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Examples

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

Legacy engine-assisted linking declares prototypes on a contract:

[Extern(Abi:"C", Library:"libc.so.6")]
pub contract LibC {
i64 getpid();
}

With extern_dlopen enabled on Linux x86_64, the engine resolves getpid once and registers the address for JIT imports. With the feature disabled, compilation fails unless the symbol is satisfied by link-time layout instead.

New work should attach libraries through the platform link-time linking profile so AOT and production JIT bundles do not depend on dlopen at first run.

A module references LibC.getpid() but the workspace builds beskid_engine without extern_dlopen. Expected outcome: diagnostic listing getpid / libc.so.6 rather than a link to address 0.

Lowering for a typed interop return may emit:

  1. Load tag word at header +8.
  2. call interop_dispatch_ptr(handle) when the result is a pointer-width value.
  3. Branch on runtime-known variant; invalid tags trap or panic per interop policy.

Exact variant tables live in Interop.Contracts; offsets are pinned by ABI versioning.

Legacy harness references:

  • cargo test -p beskid_engine extern_resolution_only_compiles_with_feature --features extern_dlopen
  • cargo test -p beskid_engine extern_real_call_getpid --features extern_dlopen
  • cargo test -p beskid_engine extern_resolution_fails_without_feature