jpsim / jpsim/SourceKitten

The framework output during `make install` is not sufficient for development

Open
#232 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
2.4k
Forks
237
PR merge metrics
No merged PRs in 30d

Description

When downloading SourceKitten and running make install, the resulting framework that is output into /usr/local/Frameworks is not sufficient for development as it is missing many important parts of the framework's contents.

Here's the output from tree:

› tree /usr/local/Frameworks/SourceKittenFramework.framework
/usr/local/Frameworks/SourceKittenFramework.framework
├── Resources -> Versions/Current/Resources
├── SourceKittenFramework -> Versions/Current/SourceKittenFramework
└── Versions
    ├── A
    │   ├── Frameworks
    │   │   ├── Commandant.framework
    │   │   │   ├── Commandant -> Versions/Current/Commandant
    │   │   │   ├── Resources -> Versions/Current/Resources
    │   │   │   └── Versions
    │   │   │       ├── A
    │   │   │       │   ├── Commandant
    │   │   │       │   └── Resources
    │   │   │       │       └── Info.plist
    │   │   │       └── Current -> A
    │   │   ├── Result.framework
    │   │   │   ├── Resources -> Versions/Current/Resources
    │   │   │   ├── Result -> Versions/Current/Result
    │   │   │   └── Versions
    │   │   │       ├── A
    │   │   │       │   ├── Resources
    │   │   │       │   │   └── Info.plist
    │   │   │       │   └── Result
    │   │   │       └── Current -> A
    │   │   ├── SWXMLHash.framework
    │   │   │   ├── Resources -> Versions/Current/Resources
    │   │   │   ├── SWXMLHash -> Versions/Current/SWXMLHash
    │   │   │   └── Versions
    │   │   │       ├── A
    │   │   │       │   ├── Resources
    │   │   │       │   │   └── Info.plist
    │   │   │       │   └── SWXMLHash
    │   │   │       └── Current -> A
    │   │   ├── Yaml.framework
    │   │   │   ├── Resources -> Versions/Current/Resources
    │   │   │   ├── Versions
    │   │   │   │   ├── A
    │   │   │   │   │   ├── Resources
    │   │   │   │   │   │   └── Info.plist
    │   │   │   │   │   └── Yaml
    │   │   │   │   └── Current -> A
    │   │   │   └── Yaml -> Versions/Current/Yaml
    │   │   ├── libswiftCore.dylib
    │   │   ├── libswiftCoreGraphics.dylib
    │   │   ├── libswiftDarwin.dylib
    │   │   ├── libswiftDispatch.dylib
    │   │   ├── libswiftFoundation.dylib
    │   │   ├── libswiftIOKit.dylib
    │   │   └── libswiftObjectiveC.dylib
    │   ├── Resources
    │   │   └── Info.plist
    │   └── SourceKittenFramework
    └── Current -> A

30 directories, 22 files

Compare this to the framework that is output of the framework that is built by the SourceKittenFramework target:

├── Headers -> Versions/Current/Headers
├── Modules -> Versions/Current/Modules
├── Resources -> Versions/Current/Resources
├── SourceKittenFramework -> Versions/Current/SourceKittenFramework
└── Versions
    ├── A
    │   ├── Headers
    │   │   ├── BuildSystem.h
    │   │   ├── CXCompilationDatabase.h
    │   │   ├── CXErrorCode.h
    │   │   ├── CXString.h
    │   │   ├── Documentation.h
    │   │   ├── Index.h
    │   │   ├── Platform.h
    │   │   ├── SourceKittenFramework-Swift.h
    │   │   ├── SourceKittenFramework.h
    │   │   └── sourcekitd.h
    │   ├── Modules
    │   │   ├── SourceKittenFramework.swiftmodule
    │   │   │   ├── x86_64.swiftdoc
    │   │   │   └── x86_64.swiftmodule
    │   │   └── module.modulemap
    │   ├── Resources
    │   │   └── Info.plist
    │   └── SourceKittenFramework
    └── Current -> A

10 directories, 16 files

There are two very import sections missing from the framework that gets published in /usr/local/Frameworks:

  1. The Versions/Current/Headers contents
  2. The Versions/Current/Modules contents

Without both of these, attempting to link against this copy of the framework to use for development proves to be fruitless and results in the compiler error:

<path/to/file:line:column> error: no such module 'SourceKittenFramework'
import SourceKittenFramework
       ^

No amount of changing @rpath values or framework search path locations is going to help (unless you happen to change the search path to the location of a valid SourceKittenFramework.framework, which ends up causing a lot of confusing, as I ran into).

I'm working a PR that can address this issue as I don't think you intended to have two different versions of the framework.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the make install packaging path and the SourceKittenFramework target, then compare the installed framework under /usr/local/Frameworks with the target's framework output. Reproduce the missing Headers and Modules contents, and verify that importing SourceKittenFramework works against the installed framework.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
build-system, developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.