Comments (12)
I think you edited the PromiseKit specification instead of adding the PMKFoundation specification line I provided.
Anyway it still fails due to a limitation specified in the README. (The PMKFoundation module name is not the same as Package.swift name).
I recommend testing with more conventional libraries, I'll amend the README so it works.
from swift-sh.
K I have fixed the issue that meant importing PMKFoundation
wouldn't work, coming in 1.1.3
from swift-sh.
Does swift build
work independently of swift-sh
?
from swift-sh.
Yep, we've got oneSwift package depending on Result package, running swift build
from command line outputs this:
╰─$ swift build
Fetching https://github.com/antitypical/Result.git
Completed resolution in 4.81s
Cloning https://github.com/antitypical/Result.git
Resolving https://github.com/antitypical/Result.git at 3.2.4
The error I get with swift-sh
is this at the moment:
╰─$ swift-sh swiftsh.swift
Fetching /Users/bigmac/Library/Developer/swift-sh.cache/swiftsh/mxcl/PromiseKit
error: failed to clone; fatal: repository '/Users/bigmac/Library/Developer/swift-sh.cache/swiftsh/mxcl/PromiseKit' does not exist
'swiftsh' /Users/bigmac/Library/Developer/swift-sh.cache/swiftsh: error: product dependency 'PromiseKit' not found
That's why I assumed that cloning failed, though I'm not 100% sure about that.
I can see Process
class being used to run the swift build
.
Is that part of Foundation
framework or a 3rd party dependency?
from swift-sh.
This is a bug I fixed a few hours ago, please update.
You will also need to delete the cache:
rm -rf /Users/bigmac/Library/Developer/swift-sh.cache
from swift-sh.
I see, I'm on 1.1.1 while there's 1.1.2.
I guess I have to wait until it gets populated?
Running brew install or brew upgrade for mxcl/made/swift-sh tells me 1.1.1 is the latest.
I'll try later anyways, thanks for the help 👍
from swift-sh.
Ugh, sorry I didn't push to my homebrew tap. It's live now, brew upgrade swift-sh
should do it.
I intend to automate the brew part.
Thanks for your patience for the error on my part, thanks for bringing it to my attention!
from swift-sh.
Looks good now, get all the source downloaded.
I'm trying to run an example with PromiseKit
.
First I had to add Foundation
import, since all the basic types would not be found by compiler.
Got it down to this so far:
#!/usr/bin/swift sh
import Foundation
import PromiseKit // @mxcl ~> 6.5
let url = URL(string: "https://github.com/mxcl/swift-sh")!
let request = URLRequest(url: url)
firstly {
URLSession.shared.dataTask(.promise, with: request)
}.then {
after(.seconds(2))
}.done {
print("Scripts with package dependencies!")
exit(0)
}
RunLoop.main.run()
However, the PromiseKit extensions for URLSession
are note there (according to compiler).
╰─$ swift-sh swiftsh.swift
Compile Swift Module 'swiftsh' (1 sources)
/Users/bigmac/Library/Developer/swift-sh.cache/swiftsh/main.swift:8:23: error: argument labels '(_:, with:)' do not match any available overloads
URLSession.shared.dataTask(.promise, with: request)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bigmac/Library/Developer/swift-sh.cache/swiftsh/main.swift:8:23: note: overloads for 'dataTask' exist with these partially matching parameter lists: (with: URLRequest, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void), (with: URL, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void)
URLSession.shared.dataTask(.promise, with: request)
^
error: terminated(1): /Applications/Xcode-10.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/bigmac/Library/Developer/swift-sh.cache/swiftsh/.build/debug.yaml swiftsh.exe output:
Compile Swift Module 'swiftsh' (1 sources)
/Users/bigmac/Library/Developer/swift-sh.cache/swiftsh/main.swift:8:23: error: argument labels '(_:, with:)' do not match any available overloads
URLSession.shared.dataTask(.promise, with: request)
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/bigmac/Library/Developer/swift-sh.cache/swiftsh/main.swift:8:23: note: overloads for 'dataTask' exist with these partially matching parameter lists: (with: URLRequest, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void), (with: URL, completionHandler: @escaping (Data?, URLResponse?, Error?) -> Void)
URLSession.shared.dataTask(.promise, with: request)
This is unlrelated to the original issue though.
from swift-sh.
Oh my bad, the example script needs:
import PMKFoundation // PromiseKit/Foundation ~> 3
from swift-sh.
Cool, though doesn't look like v3 has SPM manifest:
Updating https://github.com/mxcl/PromiseKit.git
https://github.com/mxcl/PromiseKit.git @ 3.5.3: error: https://github.com/mxcl/PromiseKit.git has no manifest for version 3.5.3
from swift-sh.
Sorry for the issues, I literally started this project about 30 hours ago. Heh. LMK if you have any other troubles.
from swift-sh.
Like here's a simple example script that works:
#!/usr/bin/swift sh
import Foundation
import Result // @antitypical ~> 4.1
print(Result<Int, CocoaError>.success(3))
from swift-sh.
Related Issues (20)
- Scripts don't run on M1 w/ Xcode 12.3 (x86 Homebrew) HOT 2
- Something odd about the 2.2.0 release brew record HOT 2
- Error: reference to member 'v11_1' cannot be resolved without a contextual type.macOS(.v11_1) HOT 3
- Change version to 11 HOT 1
- Fail to import when the package-name and repo-name are not identical HOT 1
- CI won't build linux with swift 5.1
- Brew complaining about outdated formula syntax HOT 1
- Error during installation: Invalid bottle tag symbol HOT 1
- Support scripts w/ `@main` HOT 1
- Dashes in product name breaks dependency resolving HOT 1
- Does not build for release with the Xcode 13 GM HOT 4
- PathKit dependency needs to be updated to 1.0.1 HOT 1
- Error reference to member `v12_1` cannot be resolved HOT 1
- Expose an option that prints the cached build directory? HOT 2
- CI and test failures update & PR links HOT 2
- Editing using `swift sh edit` eventually fails with "The file doesn't exist" HOT 2
- Configurable templates/context HOT 4
- Package not regenerated if you change the import reference HOT 1
- error: The operation couldn’t be completed. (NSPOSIXErrorDomain.13) HOT 6
- Missing support for async entry points HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-sh.