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

lldb error: could not build C module 'CNIOBoringSSLShims' (Linux 5.1.3)

    XMLWordPrintable

    Details

      Description

      LLDB on Linux has improved a lot recently, however, there are still some basic, easy to repro failure modes. Here's an example repo:

      # these instructions should work on macOS and Linux, assuming docker is installed
      cd "$(mktemp -d /tmp/repro_XXXXXX)"
      git clone https://github.com/apple/swift-nio-ssl
      cd swift-nio-ssl
      git reset --hard cf54f5c1db1c3740a6c7d662dc8569c150c3846c
      docker run -it --rm -v "$PWD:$PWD" -w "$PWD" swift:5.1.3 swift build --build-tests
      docker run -it --rm --privileged -v "$PWD:$PWD" -w "$PWD" swift:5.1.3 lldb .build/debug/swift-nio-sslPackageTests.xctest
      

      and then within lldb:

      break set -f NIOSSLHandler.swift -l 587
      

      you'll see many errors like

      warning: (x86_64) /Users/johannes/devel/swift-nio-ssl/.build/debug/swift-nio-sslPackageTests.xctest unable to load swift module "NIOSSL" (failed to get module "NIOSSL" from AST context:
      <module-includes>:1:10: note: in file included from <module-includes>:1:
      #include "/Users/johannes/devel/swift-nio-ssl/Sources/CNIOBoringSSLShims/include/CNIOBoringSSLShims.h"
               ^
      
      error: /Users/johannes/devel/swift-nio-ssl/Sources/CNIOBoringSSLShims/include/CNIOBoringSSLShims.h:22:10: error: 'CNIOBoringSSL.h' file not found
      #include <CNIOBoringSSL.h>
               ^
      
      error: could not build C module 'CNIOBoringSSLShims'
      )
      warning: (x86_64) /Users/johannes/devel/swift-nio-ssl/.build/debug/swift-nio-sslPackageTests.xctest unable to load swift module "NIOSSLTests" (failed to get module "NIOSSL" from AST context:
      <module-includes>:1:10: note: in file included from <module-includes>:1:
      #include "/Users/johannes/devel/swift-nio-ssl/Sources/CNIOBoringSSLShims/include/CNIOBoringSSLShims.h"
               ^
      
      error: /Users/johannes/devel/swift-nio-ssl/Sources/CNIOBoringSSLShims/include/CNIOBoringSSLShims.h:22:10: error: 'CNIOBoringSSL.h' file not found
      #include <CNIOBoringSSL.h>
               ^
      
      error: could not build C module 'CNIOBoringSSLShims'
      )
      warning: (x86_64) /Users/johannes/devel/swift-nio-ssl/.build/debug/swift-nio-sslPackageTests.xctest unable to load swift module "NIOTLS" (failed to get module "NIOSSL" from AST context:
      <module-includes>:1:10: note: in file included from <module-includes>:1:
      #include "/Users/johannes/devel/swift-nio-ssl/Sources/CNIOBoringSSLShims/include/CNIOBoringSSLShims.h"
               ^
      
      error: /Users/johannes/devel/swift-nio-ssl/Sources/CNIOBoringSSLShims/include/CNIOBoringSSLShims.h:22:10: error: 'CNIOBoringSSL.h' file not found
      #include <CNIOBoringSSL.h>
               ^
      
      error: could not build C module 'CNIOBoringSSLShims'
      )
      warning: (x86_64) /Users/johannes/devel/swift-nio-ssl/.build/debug/swift-nio-sslPackageTests.xctest unable to load swift module "swift_nio_sslPackageTests" (failed to get module "NIOSSL" from AST context:
      <module-includes>:1:10: note: in file included from <module-includes>:1:
      #include "/Users/johannes/devel/swift-nio-ssl/Sources/CNIOBoringSSLShims/include/CNIOBoringSSLShims.h"
               ^
      
      error: /Users/johannes/devel/swift-nio-ssl/Sources/CNIOBoringSSLShims/include/CNIOBoringSSLShims.h:22:10: error: 'CNIOBoringSSL.h' file not found
      #include <CNIOBoringSSL.h>
               ^
      
      error: could not build C module 'CNIOBoringSSLShims'
      )
      

      Please note, that BoringSSL is fully vendored through SwiftPM so this doesn't rely on any system-installed ssl library!

      when you then run the target, you'll very soon hit the breakpoint and you'll see

          frame #0: 0x00005555558fdb74 swift-nio-sslPackageTests.xctest`closure #1 in NIOSSLHandler.doUnbufferWrites(element=<unavailable>, self=<unavailable>, didWrite=<unavailable>, promises=<unavailable>) at NIOSSLHandler.swift:587:48
      

      note all the unavailable s. Trying to p the variables always leads to

      error: <module-includes>:1:10: note: in file included from <module-includes>:1:
      #include "/Users/johannes/devel/swift-nio-ssl/Sources/CNIOBoringSSLShims/include/CNIOBoringSSLShims.h"
               ^
      
      error: /Users/johannes/devel/swift-nio-ssl/Sources/CNIOBoringSSLShims/include/CNIOBoringSSLShims.h:22:10: error: 'CNIOBoringSSL.h' file not found
      #include <CNIOBoringSSL.h>
               ^
      
      error: could not build C module 'CNIOBoringSSLShims'
      
      Couldn't initialize Swift expression evaluator due to previous errors.
      

        Attachments

        1. types.log
          3 kB
        2. types-more.log
          155 kB

          Activity

            People

            Assignee:
            aciid Ankit Aggarwal
            Reporter:
            jw Johannes Weiss
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated: