Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When trying to compile, I get a String error #22

Closed
felix91gr opened this issue Apr 5, 2018 · 10 comments
Closed

When trying to compile, I get a String error #22

felix91gr opened this issue Apr 5, 2018 · 10 comments

Comments

@felix91gr
Copy link

I'm on Linux, under Swift 4.1

This is what I ran:

felix@felix-X550LD ~/D/P/A/beak> swift build
Compile Swift Module 'BeakCore' (15 sources)
/home/felix/Documents/Programming/AwesomeSystemSwift/beak/Sources/BeakCore/SourceKit.swift:86:54: error: value of type 'String' has no member 'substringWithByteRange'
        let substring = range(for: source).flatMap { contents.substringWithByteRange(start: Int($0.offset), length: Int($0.length)) }
                                                     ^~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
error: terminated(1): /home/felix/Documents/Programming/Binaries/swift/swift-4.1-snapshot/usr/bin/swift-build-tool -f /home/felix/Documents/Programming/AwesomeSystemSwift/beak/.build/debug.yaml main output:
    

This line's the one causing the error. Maybe the library hasn't been updated to Swift 4.1?

Anyway. Thanks for your help, and I hope you have a good day :)

@felix91gr felix91gr changed the title When trying to compile, I get a String error When trying to compile, I get a String error Apr 5, 2018
@yonaskolb
Copy link
Owner

Hi @felix91gr
Did it work before in Swift 4.0 on Linux?
It works on Swift 4.1 on macOS. Beak hasn't actually been tested on Linux, but it's something that can be looked at

@felix91gr
Copy link
Author

Beak hasn't actually been tested on Linux, but it's something that can be looked at

Ohh! You can try to do it in a sandbox with Docker. Benedikt Terhechte did that for SourceKittenDaemon so that Mac users can run the tests locally for Linux as well. The setup is super easy :)

Did it work before in Swift 4.0 on Linux?

Haven't tried. I'm gonna see if I still have the 4.0 toolchain somewhere. If not, I'll download another one and test it. Maybe the 4.0 -> 4.1 transition broke it somehow.

@felix91gr
Copy link
Author

Yup, it doesn't work under 4.0 either. I'm gonna investigate further.

@yonaskolb
Copy link
Owner

Thanks @felix91gr

@felix91gr
Copy link
Author

Hmm. Is substringWithByteRange a property provided by Foundation? Since Foundation is incomplete on Linux, maybe therein lies the problem 🤔

@felix91gr
Copy link
Author

felix91gr commented Apr 5, 2018

It's provided by SourceKittenFramework! Jesus, I never would've guessed. Of course I'd have a hard time looking it up in Apple's documentation 😆

Now then... why does the compiler fail to see it in Linux? 🤔 this is gonna need some digging around.

@yonaskolb
Copy link
Owner

Any updates on this @felix91gr?

@felix91gr
Copy link
Author

felix91gr commented Jun 2, 2018

No! I'm sorry, I've been away at other projects and studying. I will put it on my to-do list to debug this someday :) (maybe in July, when I have winter holidays)

In the meantime, you can try to run the tests in Linux with a more polished docker utility: this one which is new and really nice.

Again, sorry for disappearing. I must've closed the tab I had Beak on, and then it slipped through my fingers 😅

@yonaskolb
Copy link
Owner

All good! Got swift-docker up and running now, it's great!

@yonaskolb
Copy link
Owner

Fixed here #33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants