Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

beskid import lib command

Platform spec article

beskid import lib command

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki
Terminal window
beskid import lib <logical> [options]

Exact spelling may alias beskid link import in implementation; platform-spec reserves import lib as the user-facing verb.

The command must:

  1. Accept a logical library string matching or intended for Extern Library fields.
  2. Select an ExternalLibrary provider for the current host (default c-posix on tier-1).
  3. Emit or update project.link manifest entries (see project link libraries).
  4. Print resolved linker args and search paths without requiring authors to hand-edit -l flags.
FlagMeaning
--provider <id>Choose ExternalLibrary implementation
--dry-runShow resolution only; do not write manifest
--project <path>Target Project.proj (default cwd discovery)
  • Parsing C headers into contract declarations (future compiler mod / tool).
  • Downloading SDKs (registry / package manager concerns).

Imported libraries must be subject to BESKID_EXTERN_ALLOW / BESKID_EXTERN_DENY at link/run drivers when those variables are set.

  • CLI surface: compiler/crates/beskid_cli/src/commands/import.rs (Commands::Import in cli.rs advertises import in beskid --help).
  • Manifest mutation contract: compiler/crates/beskid_analysis/src/external_library/manifest_merge.rs (idempotent merge; preserves non-link content).
  • End-to-end behavior: compiler/crates/beskid_tests/src/cli/import_lib.rs (creates a temp Project.proj, runs the resolve + merge pipeline, asserts the resulting link.libraries round-trips through the manifest parser).
  • Closed registry rejection: the same suite asserts unknown providers (for example msvc) and unknown logical names surface as structured LibraryResolveError values instead of panics.