Hive Hive
Sign in

SwiftPM parent-root discovery resolves system-library paths from the wrong directory

GitHub issue · Open

Metadata
Source
tuist/once #285
Updated
Sep 18, 2026
Details

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.

Flights

Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.

New Flights are paused Configure model inference, GitHub, and a sandbox provider to start another Flight. Existing results remain available below.
No Flights yet

Start a Flight and preserve its objective, outcome, and session here.

Comments

No GitHub comments yet.