Dynamic load deferred.
beskid import lib command
Platform spec article
beskid import lib command
Spec standingStandard
-
Link-time FFI
Context
Decision
v0.3 maps Extern libraries to link-time providers.
Consequences
C ABI profile.
Verification anchors
Foreign-library import tests.
-
Closed providers
Context
Plugin security.
Decision
v0.3 closed provider registry; plugins deferred.
Consequences
Tier-1 hosts only.
Verification anchors
CLI provider list.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Command (reserved name)
Section titled “Command (reserved name)”beskid import lib <logical> [options]Exact spelling may alias beskid link import in implementation; platform-spec reserves import lib as the user-facing verb.
Responsibilities
Section titled “Responsibilities”The command must:
- Accept a logical library string matching or intended for
ExternLibraryfields. - Select an
ExternalLibraryprovider for the current host (defaultc-posixon tier-1). - Emit or update
project.linkmanifest entries (see project link libraries). - Print resolved linker args and search paths without requiring authors to hand-edit
-lflags.
Options (normative minimum)
Section titled “Options (normative minimum)”| Flag | Meaning |
|---|---|
--provider <id> | Choose ExternalLibrary implementation |
--dry-run | Show resolution only; do not write manifest |
--project <path> | Target Project.proj (default cwd discovery) |
Non-goals (v0.3)
Section titled “Non-goals (v0.3)”- Parsing C headers into
contractdeclarations (future compiler mod / tool). - Downloading SDKs (registry / package manager concerns).
Security
Section titled “Security”Imported libraries must be subject to BESKID_EXTERN_ALLOW / BESKID_EXTERN_DENY at link/run drivers when those variables are set.
Verification anchors
Section titled “Verification anchors”- CLI surface:
compiler/crates/beskid_cli/src/commands/import.rs(Commands::Importincli.rsadvertisesimportinbeskid --help). - Manifest mutation contract:
compiler/crates/beskid_analysis/src/external_library/manifest_merge.rs(idempotent merge; preserves non-linkcontent). - End-to-end behavior:
compiler/crates/beskid_tests/src/cli/import_lib.rs(creates a tempProject.proj, runs the resolve + merge pipeline, asserts the resultinglink.librariesround-trips through the manifest parser). - Closed registry rejection: the same suite asserts unknown providers (for example
msvc) and unknown logical names surface as structuredLibraryResolveErrorvalues instead of panics.