Hive
SwiftPM parent-root discovery resolves system-library paths from the wrong directory
GitHub issue · Open
Summary
A Swift package with a conventional system-library layout loads correctly when Once runs from the package directory, but fails when Once discovers the same package from a parent repository root.
This may be related to #261, although the target in this case already uses Sources/<target>/module.modulemap. The behavior only changes with the discovery root.
Reproduction
Given this layout:
repo/
sqlite/
Package.swift
Sources/SQLiteKitSQLite3/module.modulemap
The manifest declares:
.systemLibrary(
name: "SQLiteKitSQLite3",
providers: [.apt(["libsqlite3-dev"])]
)
Querying the package directly succeeds and emits an apple_system_module target:
cd repo/sqlite
once query targets
Querying from the parent repository fails:
cd repo
once query workspace
The error is:
Swift package system target `SQLiteKit/SQLiteKitSQLite3` has no module.modulemap
Expected behavior
System-library paths should be resolved relative to the package that owns the target, regardless of which parent directory Once uses for discovery. At minimum, the same package should produce the same target graph in both cases.
Tested with Once 0.57.0 on macOS.
Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.
Start a Flight and preserve its objective, outcome, and session here.
No GitHub comments yet.