Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Documentation/Contracts/Fonts.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,6 @@ On 2026-12-03:
is right to left is laid out run by run from the right; a line that
mixes directions keeps its runs in logical order. Core Text's lines are
ordered as Core Text orders them.
5. **Not built for Embedded yet.** `DynamicFonts` uses nothing Embedded
lacks, but the toolchain with Embedded Swift wasn't installed, so no
guest slice was built with it.
5. **Built for Embedded unchanged.** `guest.py` compiles `DynamicFonts`
and its dependencies as Embedded Swift for `linux-arm64` with Swift
6.4.2, in the `swift:6.4` image, and needed no changes.
6 changes: 4 additions & 2 deletions Scripts/guest.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,10 @@ def __init__(self, package_path, description):
# Default traits guest builds leave off. swift-embedded-foundation's
# FloatingPointParsingShims supplies the C parsing functions older standard
# libraries call; this toolchain's parses in Swift, and the shims don't
# compile for x86_64 Apple triples, which have no Float16.
GUEST_DISABLED_TRAITS = {"FloatingPointParsingShims"}
# compile for x86_64 Apple triples, which have no Float16. swift-png's
# SystemZlib links the system's zlib, which a guest can't; without it,
# swift-png inflates with swift-zlib, in Swift.
GUEST_DISABLED_TRAITS = {"FloatingPointParsingShims", "SystemZlib"}


def default_traits(manifest, requested=None):
Expand Down
11 changes: 11 additions & 0 deletions Scripts/test_guest_traits.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ def test_guest_disabled_traits_stay_off(self):
self.assertEqual(guest.default_traits(package), set())
self.assertEqual(guest.default_traits(package, {"FloatingPointParsingShims"}), set())

def test_swift_png_inflates_in_swift(self):
# A dependent asking for swift-png's defaults still gets no system zlib,
# and the C module gated on it drops out of the build.
package = manifest(
{"default": ["SystemZlib"], "SystemZlib": []},
[{"target": ["CSystemZlib", {"platformNames": [], "traits": ["SystemZlib"]}]}],
)
enabled = guest.default_traits(package, {"default"})
self.assertEqual(enabled, set())
self.assertEqual(guest.disabled_trait_dependencies(package, enabled), {"Library": {"CSystemZlib"}})


class TraitDependencyTests(unittest.TestCase):

Expand Down
Loading