Uploaded image for project: 'Swift'
  1. Swift
  2. SR-14001

Missing static library of libSwiftSyntaxParser for static build

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: swift-format, SwiftSyntax
    • Labels:
      None

      Description

      I would like to use apple/swift-format in GitHub Actions.

      github/super-linter is famous GitHub Action, which supports many programming languages.

      https://github.com/github/super-linter#supported-linters

       

      super-linter runs on Docker with Alpine Linux: https://github.com/github/super-linter/blob/v3.14.3/Dockerfile#L28

      Swift does not release for Alpine Linux. So I try to create swift-format static binary in Ubuntu and copy it to super-linter docker image.

      My Dockerfile

      FROM swiftlang/swift:nightly-bionic
      WORKDIR /swift-format
      RUN git clone --branch 0.50300.0 --depth 1 https://github.com/apple/swift-format.git .
      RUN swift build --static-swift-stdlib --configuration release

      It causes compile error (linker error):

      #9 26.28 [24/93] Compiling SwiftSyntax AbsolutePosition.swift
      #9 26.28 /swift-format/.build/checkouts/swift-syntax/Sources/SwiftSyntax/SyntaxParser.swift:17:8: error: no such module '_InternalSwiftSyntaxParser'
      #9 26.28 import _InternalSwiftSyntaxParser

      I find dynamic library of _InternalSwiftSyntaxParser, but I miss to find static library.

      https://github.com/apple/swift/tree/main/tools/libSwiftSyntaxParser

      $ docker run -it --rm swiftlang/swift:nightly-bionic /bin/bash
      root@a10b2d6fc367:/# swift --version
      Swift version 5.3-dev (LLVM bcee1b98f3b26c5, Swift dbcf7fe1bf76226)
      Target: x86_64-unknown-linux-gnu
      root@a10b2d6fc367:/# ls /usr/lib/swift/linux/lib_InternalSwiftSyntaxParser.so

      Please enclose static library version of libSwiftSyntaxParser.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            mtgto Satoshi Goto
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: