Why does a vapor "hello" project crush right after start on Sierra? - macos-sierra

I'm trying to run vapor hello project via terminal. Didn't touch any code.
Building is ok, but it doesn't run.
Already tried
clean and rebuild
force reinstall vapor
check that libsqlite3.dylib is loaded
Here's terminal output:
MacBook-Air-Dmitrij:Hello dev$ vapor run
Running Hello ...
[ INFO ] Migrating 'sqlite' database (/Users/dev/Hello/.build/checkouts/fluent.git-6251908308727715749/Sources/Fluent/Migration/MigrationConfig.swift:69)
dyld: lazy symbol binding failed: Symbol not found: _sqlite3_column_table_name
Referenced from: /Users/dev/Hello/.build/debug/Run
Expected in: /usr/lib/libsqlite3.dylib
dyld: Symbol not found: _sqlite3_column_table_name
Referenced from: /Users/dev/Hello/.build/debug/Run
Expected in: /usr/lib/libsqlite3.dylib
Do you have any idea, what's going on?
MacOS 10.12.6
Swift 4.1.3
Xcode 9.3
Vapor Toolbox: 3.1.10
Vapor Framework: 3.3.1

Related

Swift 5.7 "JIT session error: Symbols not found" when using Foundation

I use some swift scripts as Build Phases during the build process of an Xcode project.
Everything is fine on Xcode 13. But when I try to build the project with the Xcode 14 Beta, I get "JIT session error: Symbols not found" errors.
It seems to be a problem with swift 5.7 which is bundled with Xcode 14.
To reproduce, create a file Test.swift with the following content:
import Foundation
print(ProcessInfo.processInfo.globallyUniqueString)
With swift 5.6 this works fine:
% swift --version
swift-driver version: 1.45.2 Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12)
Target: arm64-apple-macosx12.0
% swift Test.swift
594EC474-26AB-4B1B-97AA-56BCC09BE202-29864-00000021D05F7451
But as soon as I switch to swift 5.7 the script breaks:
% swift --version
swift-driver version: 1.55.1 Apple Swift version 5.7 (swiftlang-5.7.0.113.202 clang-1400.0.16.2)
Target: arm64-apple-macosx12.0
% swift Test.swift
JIT session error: Symbols not found: [ _$sSS10FoundationE36_unconditionallyBridgeFromObjectiveCySSSo8NSStringCSgFZ ]
Failed to materialize symbols: { (main, { _main, __swift_FORCE_LOAD_$_swiftXPC_$_Test, _$ss27_finalizeUninitializedArrayySayxGABnlF, __swift_FORCE_LOAD_$_swiftDispatch_$_Test, _$ss5print_9separator10terminatoryypd_S2StFfA1_, _$ss5print_9separator10terminatoryypd_S2StFfA0_, __swift_FORCE_LOAD_$_swiftIOKit_$_Test, __swift_FORCE_LOAD_$_swiftCoreFoundation_$_Test, __swift_FORCE_LOAD_$_swiftDarwin_$_Test, $.Test.__inits.0, _$sSa12_endMutationyyF, __swift_FORCE_LOAD_$_swiftObjectiveC_$_Test }) }
I didn't find anything on this issue during my internet search. But I cannot believe, I'm the only one, running into this issue.
Is this "just" an issue with the swift 5.7/Xcode14 beta or did something change with swift 5.7's handling JIT scripting?

psql error dyld: lazy symbol binding failed: Symbol not found:

When I try to connect PostgreSQL locally by running as below,
$ /usr/local/pg10.11/bin/psql
Throghing below error,
dyld: lazy symbol binding failed: Symbol not found: _PQsetErrorContextVisibility
Referenced from: /usr/local/pg10.11/bin/psql
Expected in: /usr/lib/libpq.5.dylib
dyld: Symbol not found: _PQsetErrorContextVisibility
Referenced from: /usr/local/pg10.11/bin/psql
Expected in: /usr/lib/libpq.5.dylib
Abort trap: 6
This is started when I was upgraded PostgreSQL v10.11 to v11, before that it worked fine.
even I tried steps mentioned here but no luck.
Please help me here and appreciated the response.
Note: I didn't install PostgreSQL through brew, installed from source code.
Enviranment:
psql (PostgreSQL) 10.11
macOS Catalina version 10.15.1

vapor build error: manifest parse error(s)

macOS Height Sierra 10.13.4
Xcode version 9.3
$ swift --version
Apple Swift version 4.1 (swiftlang-902.0.48 clang-902.0.37.1)
Target: x86_64-apple-darwin17.5.0
$ brew info vapor
vapor/tap/vapor: stable 3.1.4.l
https://vapor.codes
/usr/local/Cellar/vapor/3.1.4.l (4 files, 17.0MB) *
Built from source on 2018-04-01 at 23:55:47
From: https://github.com/vapor/homebrew-tap/blob/master/vapor.rb
==> Dependencies
Required: ctls ✔, libressl ✔
$ eval "$(curl -sL check.vapor.sh)"
✅ Xcode 9 is compatible with Vapor 2.
✅ Xcode 9 is compatible with Vapor 3.
✅ Swift 4.1 is compatible with Vapor 2.
✅ Swift 4.1 is compatible with Vapor 3.
$ vapor version
Vapor Toolbox: 3.1.4
I create new project with:
vapor new Hello --template=api
and when I try to build it:
vapor build --verbose
I get the error:
No .build folder, fetch may take a while...
Fetching Dependencies ...
warning: 'fetch' command is deprecated; use 'resolve' instead
/PATH-TO-PROJECT: error: manifest parse error(s):
<module-includes>:5:9: note: in file included from <module-includes>:5:
#import "copyfile.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/copyfile.h:36:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Develo. per/SDKs/MacOSX10.13.sdk
/usr/include/copyfile.h:36:
#include <stdint.h>
^
/usr/local/include/stdint.h:59:11: note: in file included from /usr/local/include/stdint.h:59:
# include <stdint.h>
^
/usr/local/include/stdbool.h:4:10: note: in file included from /usr/local/include/stdbool.h:4:
#include <stdbool.h>
^
<unknown>:0: error: could not build Objective-C module 'Darwin'
Building Project [Failed]
Error: execute(1)
Does anyone have any idea what is going wrong there? Thanks in advance!
I found the solution:
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
/usr/local/include/base.h
/usr/local/include/bcj.h
/usr/local/include/block.h
/usr/local/include/cdefs.h
/usr/local/include/check.h
...
and solved the problem by deleting all "Unbrewed header files" from /usr/local/include/
That is bizarre! Just to confirm you’re in the right folder? If you run swift build does it do the same thing?
I had a similar issue unrelated to brew.
Error: backgroundExecute(code: 1, error: "/path/to/project: error: manifest parse error(s):\nInvalid version string: x.0.0\n", output: "")
My Package file looked like this;
...
.package(url: "https://github.com/../something.git", .upToNextMajor(from: "x.0.0")),
...
Looking into .upToNextMajor(from:) I didn't see any parsing for 'x' so I just went to the github page and found which major version I wanted and replaced it for the placeholder in my package file:
...
.package(url: "https://github.com/../something.git", .upToNextMajor(from: "1.0.0")),
...
This resolved the issue for me, Hope this helps the next person that comes by! upvote if it helps you!

Xcode 8 Beta 5 Strange Error dyld symbol not found

I've updated to the new beta and I for some reason cannot get my framework to run on tvOS anymore with this error:
dyld: Symbol not found: __TMps23ExpressibleByNilLiteral
Referenced from: /Users/xxx/Library/Developer/CoreSimulator/Devices/F88A3B01-2A61-4A7E-89C0-110F1128DB1F/data/Containers/Bundle/Application/37E6A551-D3A6-41B6-938C-C7A203803FFC/TvTestApp01.app/Frameworks/TDatabases.framework/TDatabases
Expected in: /Users/xxx/Library/Developer/CoreSimulator/Devices/F88A3B01-2A61-4A7E-89C0-110F1128DB1F/data/Containers/Bundle/Application/37E6A551-D3A6-41B6-938C-C7A203803FFC/TvTestApp01.app/Frameworks/libswiftCore.dylib
in /Users/xxx/Library/Developer/CoreSimulator/Devices/F88A3B01-2A61-4A7E-89C0-110F1128DB1F/data/Containers/Bundle/Application/37E6A551-D3A6-41B6-938C-C7A203803FFC/TvTestApp01.app/Frameworks/TDatabases.framework/TDatabases
In other projects that uses the same code but on macOS and iOS, those work fine.

'Lazy symbol binding failed: Symbol not found: __OSSwapInt16' on jailbroken iPhone when using gem commands

I'm having issues with Ruby on iOS 5.1.1. Any gem command fails. If I try to gem update:
mobile$ gem update
Updating installed gems
dyld: lazy symbol binding failed: Symbol not found: __OSSwapInt16 Referenced from: /usr/lib/ruby/1.9.1/arm-darwin9/socket.bundle
Expected in: flat namespace
dyld: Symbol not found: __OSSwapInt16
Referenced from: /usr/lib/ruby/1.9.1/arm-darwin9/socket.bundle
Expected in: flat namespace
Trace/BPT trap: 5
What's interesting is ruby -v shows 1.9.2:
mobile$ ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [arm-darwin9]
Any ideas on how to fix? I've tried removing Ruby package via Cydia and reinstalling but it's the same. I figured this might be relevant for people trying to use gems on their iOS device as I am.
I'm having the same issue. Removing (renaming) socket.bundle unsurprisingly yielded the following results:
ERROR: Loading command: update (LoadError)
no such file to load -- socket.so
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::UpdateCommand
Edit: I was able to get gem update to run successfully by downgrading from ruby 1.9.2-p0-10 to ruby 1.9.1-p429-6. When using 1.9.2, there were still references to 1.9.1 that seem to have been causing the error above.