Skip to content

[SR-3280] Package manager should link main swiftmodule in executables #5164

Closed
@swift-ci

Description

@swift-ci
Previous ID SR-3280
Radar rdar://problem/29228963
Original Reporter nerakhon (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 5
Component/s Package Manager
Labels Bug
Assignee @aciidb0mb3r
Priority Medium

md5: cd20a7b4bf80be0100567d8c27f63fe5

is blocked by:

  • SR-2660 Teach the driver to accept multiple swiftmodules as linker inputs, for static linking

is duplicated by:

  • SR-2192 Swift's LLDB cannot import system modules and prevents debugging
  • SR-11543 lldb doesn't work in tests: error: warning: failed to get module "NIO" from AST context

relates to:

  • SR-3863 swift emits a temporary swiftmodule when swiftmodule of main module is passed with -emit-executable
  • SR-11543 lldb doesn't work in tests: error: warning: failed to get module "NIO" from AST context

Issue Description:

Upon creation of empty packgage of type --executable when I build the package via swift build. I receive a binary that works, but isn't debuggable.

lldb .build/debug/lldb-test

(lldb) target create ".build/debug/lldb-test"
Current executable set to '.build/debug/lldb-test' (x86_64).
(lldb) breakpoint set -f main.swift -l 3
Breakpoint 1: where = lldb-test`main + 81 at main.swift:3, address = 0x0000000000400e81
(lldb) r
Process 30195 launched: '/home/janpaul/src/lldb-test/.build/debug/lldb-test' (x86_64)
Process 30195 stopped

  • thread Add missing steps to creating a C library package. #1: tid = 30195, 0x0000000000400e81 lldb-test`main + 81 at main.swift:3, name = 'lldb-test', stop reason = breakpoint 1.1
    frame #0: 0x0000000000400e81 lldb-test`main + 81 at main.swift:3
    1 import Foundation
    2
    -> 3 let swifty="Swift is cool"
    4
    5 print(swifty)
    6
    7 exit(0)
    (lldb) n
    Process 30195 stopped

  • thread Add missing steps to creating a C library package. #1: tid = 30195, 0x0000000000400ea4 lldb-test`main + 116 at main.swift:5, name = 'lldb-test', stop reason = step over
    frame #0: 0x0000000000400ea4 lldb-test`main + 116 at main.swift:5
    2
    3 let swifty="Swift is cool"
    4
    -> 5 print(swifty)
    6
    7 exit(0)
    (lldb) po swifty
    error: in auto-import:
    failed to get module 'lldb_test' from AST context

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions