Comments (22)
For people still guided here by the Google Search Gods this is the solution:
- Run
xcode-select -p
, see your current Xcode path - Update the name of your current Xcode application to
Xcode.app
, often this name can contain numbers or other characters that cause issues. Copy this new path. - Run
xcode-select -s YOUR_NEW_RENAMED_XCODE_APP_PATH
- Mockolo will work as expected
from mockolo.
Is the dylib in the same dir as the mockolo executable? If it's in a different location, it will throw the above error. Also, can you check what xcode versions are installed in the laptops that work and don't work? It shouldn't matter as the dylib is a compile time dependency, but would be good to narrow down what the differences are.
from mockolo.
from mockolo.
I've attached two binaries to the release, mockolo.tar.gz built with swift 5.2 (xcode 11.4+), and mockolo-swift5.1.tar.gz built with swift 5.1 (< xcode 11.3). Can you try both and see if either one fails? thanks.
from mockolo.
The thing is that in Homebrew we just compile without linking to a dylib
def install
system "swift", "build", "-c", "release", "--disable-sandbox"
bin.install ".build/release/mockolo"
end
from mockolo.
Looks like there's a compatibility issue between Xcode 11.4+ and 11.3- similar to realm/SwiftLint#3105. What happens if you set the depends_on :xcode version to 11.4? If that doesn't work, we might have to dynamically load it, like https://github.com/jpsim/SourceKitten/blob/master/Source/SourceKittenFramework/library_wrapper.swift.
from mockolo.
We can have the brew formula rely on sourcekitten from brew itself, does this solve our issue?
from mockolo.
from mockolo.
Sourcekitten can be installed via Brew
brew install sourcekitten
Can we somehow consume that binary?
from mockolo.
The error is not related to sourcekitten. It's due to swiftsyntax between the xcode versions. If we set the 'depends_on xcode' version to 11.4, this error might be resolved.
from mockolo.
Could this approach work?
swift build --configuration release -Xlinker -weak-l_InternalSwiftSyntaxParser
from mockolo.
I don't think it resolves it, as @rpath
to the internal dylib still shows up if you run otool -L mockolo.
Could you try setting the version to 11.4 and see if it fixes the error? If not, either we'll have to dynamically load the dylib or see if we can use lines 72-74 from install-script.sh (mockolo) in homebrew: def install.
from mockolo.
Can we make another shell script that homebrew can run to do these 2 commands?
cp "$(xcode-select -p)"/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/lib_InternalSwiftSyntaxParser.dylib .
install_name_tool -change @rpath/lib_InternalSwiftSyntaxParser.dylib @executable_path/lib_InternalSwiftSyntaxParser.dylib "$TARGET"
from mockolo.
It will require tarballing both the mockolo executable and the dylib to run the executable. Does homebrew allow that? Also, did you happen to see if requiring Xcode 11.4 fixes the error?
from mockolo.
Revisiting this; @tinder-maxwellelliott if you set the xcode version to 11.4 (now that mockolo requires 11.4+), does this error still repro?
from mockolo.
This has gone away! Thanks!
from mockolo.
@elsh Is there no possible way to avoid a Dylib here at all? Can we make a static framework and avoid this all together?
from mockolo.
from mockolo.
Static? no it required building too many pieces in swift repo the last time tried. We can try dlopen. What's the main issue anyway?
…
On Mon, Jul 20, 2020 at 2:45 PM Maxwell Elliott @.***> wrote: @elsh https://github.com/elsh Is there no possible way to avoid a Dylib here at all? Can we make a static framework and avoid this all together? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#108 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUG5PF3CJDMGQ3P6QYGH5DR4S3GBANCNFSM4MNWJXCA .
People keep getting into issues where Xcode is not where Mockolo expects it to be
from mockolo.
from mockolo.
Closing. Feel free to reopen if this issue arises agin.
from mockolo.
The issues is back, this time on Homebrew itself - it blocks the release of Mockolo 1.8.0.
https://github.com/Homebrew/homebrew-core/actions/runs/3349028971/jobs/5548712516
I've also opened a new issue for this, since I feel like this can be fixed on the build configuration level: #206
from mockolo.
Related Issues (20)
- Incorrect mock generated for composed protocol HOT 2
- support for async properties? HOT 2
- @available attribute on function mocked incorrectly HOT 3
- Consider method that has `some` parameter.
- Support Actor Protocol HOT 6
- Xcode14.2 Fatal error: The operation couldn’t be completed. (SwiftSyntaxParser.ParserError error 1.) HOT 1
- Contributors with admin access
- [bug] Duplicated underlying var declarations generated for protocol mocks with init requirements HOT 2
- Allow output to stdout
- SwiftSyntax 508.0.0 HOT 1
- [BUG] Mocking functions with `for` parameter + include-history
- [BUG] Does not mock protocol requirements from other module HOT 2
- import collection is overly broad
- [Bug] Protocol that inherits from protocols in two different modules with same function name does not produce unique handlers HOT 2
- Mock of class with computed properties causes compile error.
- Add build tool plugin HOT 2
- Uncompilable mock generated for NSObjectProtocol / @objc protocols
- Async functions are unsafe in generated mocks, and can crash if used from multiple threads simultaneously HOT 2
- Skip creation of empty files if there are no mocks to generate HOT 2
- Suppress Sendable protocol warnings HOT 3
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 mockolo.