Can't install CoreStore via Swift Package Manager 3.1 #131

Closed
opened 2025-12-29 15:25:12 +01:00 by adam · 4 comments
Owner

Originally created by @TimothyMDean on GitHub (Apr 12, 2017).

I'm trying to set up a project with Swift Package Manager 3.1, and I'd like to include CoreStore as a dependency.

I get the following error when I execute the swift package fetch command:

error: the package has an unsupported layout, unexpected source file(s) found:
/Path/SwiftProject/.build/checkouts/CoreStore.git--3311833321589799163/Sources/CoreDataNativeType.swift,
/Path/SwiftProject/.build/checkouts/CoreStore.git--3311833321589799163/Sources/CoreStore.swift,
/Path/SwiftProject/.build/checkouts/CoreStore.git--3311833321589799163/Sources/CoreStoreError.swift
fix: move the file(s) inside a module
Originally created by @TimothyMDean on GitHub (Apr 12, 2017). I'm trying to set up a project with Swift Package Manager 3.1, and I'd like to include CoreStore as a dependency. I get the following error when I execute the `swift package fetch` command: ``` error: the package has an unsupported layout, unexpected source file(s) found: /Path/SwiftProject/.build/checkouts/CoreStore.git--3311833321589799163/Sources/CoreDataNativeType.swift, /Path/SwiftProject/.build/checkouts/CoreStore.git--3311833321589799163/Sources/CoreStore.swift, /Path/SwiftProject/.build/checkouts/CoreStore.git--3311833321589799163/Sources/CoreStoreError.swift fix: move the file(s) inside a module ```
adam added the fixed label 2025-12-29 15:25:12 +01:00
adam closed this issue 2025-12-29 15:25:13 +01:00
Author
Owner

@JohnEstropia commented on GitHub (Apr 16, 2017):

Hi, do you have an idea why this error occurs? The files in the error are all included in the module so I'm not sure what

fix: move the file(s) inside a module

means here.

@JohnEstropia commented on GitHub (Apr 16, 2017): Hi, do you have an idea why this error occurs? The files in the error are all included in the module so I'm not sure what ``` fix: move the file(s) inside a module ``` means here.
Author
Owner

@TimothyMDean commented on GitHub (Apr 18, 2017):

I suspect the problem is due to SPM's convention-based source layout assumption. According to the documentation, each subfolder under the Source folder is assumed to be its own module. If you are creating a single module, you can put all the source directly under Sources.

It seems like your source code layout is mixing up the tool by including source files both at the root level under Sources, as well as subdirectories that contain more source files. It seems likely that SPM sees the subdirectories and assumes this is a multi-module source layout, but then it doesn't know what to do with the Swift files directly under Sources.

That's just my theory though - I haven't dug through the SPM source code to see if my theory is correct.

@TimothyMDean commented on GitHub (Apr 18, 2017): I suspect the problem is due to SPM's convention-based source layout assumption. According to the [documentation](https://github.com/apple/swift-package-manager/blob/master/Documentation/Reference.md#source-layouts), each subfolder under the Source folder is assumed to be its own module. If you are creating a single module, you can put all the source directly under `Sources`. It seems like your source code layout is mixing up the tool by including source files both at the root level under `Sources`, as well as subdirectories that contain more source files. It seems likely that SPM sees the subdirectories and assumes this is a multi-module source layout, but then it doesn't know what to do with the Swift files directly under `Sources`. That's just my theory though - I haven't dug through the SPM source code to see if my theory is correct.
Author
Owner

@JohnEstropia commented on GitHub (Apr 18, 2017):

Ah, that must be it. I've been looking for this documentation.

Hmm... I need to look for a way to tell the package manager to flatten the directories. I don't want to move all files in a single directory.

If anyone finds a way to do this, please let me know.

@JohnEstropia commented on GitHub (Apr 18, 2017): Ah, that must be it. I've been looking for this documentation. Hmm... I need to look for a way to tell the package manager to flatten the directories. I don't want to move all files in a single directory. If anyone finds a way to do this, please let me know.
Author
Owner

@JohnEstropia commented on GitHub (May 10, 2017):

@TimothyMDean Sorry for the wait. I've pushed a fix in CoreStore 3.1.1. Tell me if it works for you.

@JohnEstropia commented on GitHub (May 10, 2017): @TimothyMDean Sorry for the wait. I've pushed a fix in CoreStore 3.1.1. Tell me if it works for you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#131