Skip to content

[Embedded] swiftc -print-target-info doesn't print paths under usr/lib/swift/embedded #80570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ADKaster opened this issue Apr 6, 2025 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. embedded Embedded Swift

Comments

@ADKaster
Copy link
Contributor

ADKaster commented Apr 6, 2025

Description

On linux, I use -print-target-info to get paths for inclusion in -L and -I of my swift compile commands.

When using -enable-experiemental-feature Embedded, paths under $PREFIX/usr/lib/swift/embedded are not used, and the resulting paths are nonsensical.

Reproduction

swiftc -enable-experimental-feature Embedded -target x86_64-unknown-none-elf -print-target-info
{
  "compilerVersion": "Swift version 6.2-dev (LLVM 86709865028dc89, Swift 2e6d7f71608bbad)",
  "target": {
    "triple": "x86_64-unknown-none-elf-unknown",
    "unversionedTriple": "x86_64-unknown-none",
    "moduleTriple": "x86_64-unknown-none-elf-unknown",
    "platform": "none",
    "arch": "x86_64",
    "pointerWidthInBits": 64,
    "pointerWidthInBytes": 8,
    "compatibilityLibraries": [ ],
    "librariesRequireRPath": false
  },
  "paths": {
    "runtimeLibraryPaths": [
      "/home/andrew/.local/share/swiftly/toolchains/main-snapshot-2025-04-02/usr/lib/swift/none"
    ],
    "runtimeLibraryImportPaths": [
      "/home/andrew/.local/share/swiftly/toolchains/main-snapshot-2025-04-02/usr/lib/swift/none",
      "/home/andrew/.local/share/swiftly/toolchains/main-snapshot-2025-04-02/usr/lib/swift/none/x86_64"
    ],
    "runtimeResourcePath": "/home/andrew/.local/share/swiftly/toolchains/main-snapshot-2025-04-02/usr/lib/swift"
  }
}

Expected behavior

The output should look more like this:

{
  "compilerVersion": "Swift version 6.2-dev (LLVM 86709865028dc89, Swift 2e6d7f71608bbad)",
  "target": {
    "triple": "x86_64-unknown-none-elf-unknown",
    "unversionedTriple": "x86_64-unknown-none",
    "moduleTriple": "x86_64-unknown-none-elf-unknown",
    "platform": "none",
    "arch": "x86_64",
    "pointerWidthInBits": 64,
    "pointerWidthInBytes": 8,
    "compatibilityLibraries": [ ],
    "librariesRequireRPath": false
  },
  "paths": {
    "runtimeLibraryPaths": [
      "/home/andrew/.local/share/swiftly/toolchains/main-snapshot-2025-04-02/usr/lib/swift/embedded/x86_64-unknown-none-elf"
    ],
    "runtimeLibraryImportPaths": [
      "/home/andrew/.local/share/swiftly/toolchains/main-snapshot-2025-04-02/usr/lib/swift/embedded",
      "/home/andrew/.local/share/swiftly/toolchains/main-snapshot-2025-04-02/usr/lib/swift/embedded/x86_64-unknown-none-elf"
    ],
    "runtimeResourcePath": "/home/andrew/.local/share/swiftly/toolchains/main-snapshot-2025-04-02/usr/lib/swift"
  }
}

Environment

$ swiftc -version
Swift version 6.2-dev (LLVM 86709865028dc89, Swift 2e6d7f71608bbad)
Target: x86_64-unknown-linux-gnu
Build config: +assertions

Additional information

No response

@ADKaster ADKaster added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Apr 6, 2025
@MaxDesiatov MaxDesiatov added embedded Embedded Swift and removed triage needed This issue needs more specific labels labels Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. embedded Embedded Swift
Projects
None yet
Development

No branches or pull requests

2 participants