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

Couldn't install vapor with homebrew "libssl.1.0.0.dylib not loaded" #2104

Closed
lil5 opened this issue Nov 24, 2019 · 28 comments
Closed

Couldn't install vapor with homebrew "libssl.1.0.0.dylib not loaded" #2104

lil5 opened this issue Nov 24, 2019 · 28 comments
Labels
bug Something isn't working

Comments

@lil5
Copy link

lil5 commented Nov 24, 2019

Steps to reproduce

Tried installing vapor with homebrew with the official docs.
Running all commands in zsh:

brew tap vapor/tap
brew install vapor/tap/vapor
vapor --help

Expected behavior

vapor --help running properly without errors

Actual behavior

Screenshot 2019-11-24 at 01 09 41

Environment

  • Vapor Framework version:
  • Vapor Toolbox version: /usr/local/Cellar/vapor/3.1.10
  • OS version: MacOS 10.14.6
@lil5
Copy link
Author

lil5 commented Nov 24, 2019

It looks like there's a hard requirement to openssl@1.0, I have openssl@1.1

@Phzytaylor
Copy link

If you go to usr/local/opt/vapor and look at the readme they have instructions for for installing it manually. The problem though is that you still need two libraries from openssl1.0.0. If you do a search for the two libraries you need there are a couple of projects which have them in their repos. They work. It's not the best way but it will make it work until they change the openssl requirement. Brew no longer has openssl versions below the current one as those versions were phased out earlier this year if you look at the commit history for openssl.

@lil5
Copy link
Author

lil5 commented Nov 25, 2019

Will this issue happen in the future with vapor@4 (say after OpenSSL updated and vapor@4 doesn’t)? Or has this been future proved?

If not might it be an option to package OpenSSL in vapor?

@Phzytaylor
Copy link

Will this issue happen in the future with vapor@4 (say after OpenSSL updated and vapor@4 doesn’t)? Or has this been future proved?

If not might it be an option to package OpenSSL in vapor?

You can find libssl1.0.0 here https://github.com/zoom/zoom-sdk-macos/blob/master/ZoomSDK/libssl.1.0.0.dylib

and you can find libcrypto.1.0.0 here : https://github.com/dathinaios/sc_osx_standalone/blob/master/MacOS/libcrypto.1.0.0.dylib

for both of them just click view raw and they will download.
I have attached vapor's directions
README.txt

@lil5
Copy link
Author

lil5 commented Nov 25, 2019

@Phzytaylor Thanks 👍

@lil5 lil5 closed this as completed Nov 25, 2019
@Phzytaylor
Copy link

@Phzytaylor Thanks 👍

Did it work for you?

@lil5
Copy link
Author

lil5 commented Nov 25, 2019

➜  vapor-4-test git:(master) ✗ /usr/local/Cellar/vapor/3.1.10/bin/vapor
dyld: Library not loaded: /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib
  Referenced from: /usr/local/Cellar/vapor/3.1.10/bin/vapor
  Reason: image not found
[1]    38857 abort      /usr/local/Cellar/vapor/3.1.10/bin/vapor

First received this error then downloaded and added libcrypto aswel:

cp ~/Downloads/lib*.dylib /usr/local/opt/openssl/lib/

@Phzytaylor And now it works! 🎊

Tested:

  • vapor --help
  • vapor new name --template=api
  • vapor xcode

@yoiang
Copy link

yoiang commented Nov 27, 2019

Is there an understanding about how to fix this permanently? Downloading dylibs from two websites, especially dylibs specific to security and encryption, feels like a vulnerability!

@Phzytaylor
Copy link

Is there an understanding about how to fix this permanently? Downloading dylibs from two websites, especially dylibs specific to security and encryption, feels like a vulnerability!

Open ssl has an official website, but I wasn't sure how to compile what they gave you. They just have to update the tool box to use the newer version of openssl because homebrew doesn't have the older one anymore.

@yoiang
Copy link

yoiang commented Nov 27, 2019

Sorry, maybe the question should be is that in the plan? Is the vapor team aware of this issue and is addressing it? @lil5 maybe you should keep this issue open.

@0xTim
Copy link
Member

0xTim commented Nov 30, 2019

@yoiang - the Vapor team are aware of it and I’m sure there’ll be a permanent fix ASAP (especially as it’s blocking things like Vapor Cloud) but Thanksgiving is holding things up at the moment.

@tanner0101 tanner0101 added the bug Something isn't working label Dec 5, 2019
@tanner0101
Copy link
Member

This has been fixed in Vapor Toolbox 3.1.11.

brew upgrade vapor

@quantum-fusion
Copy link

@tanner0101 I tried the brew upgrade vapor to upgrade the dylib dependencies but no cigar (rickwierenga/heartbeat-tutorials#3)

@0xTim
Copy link
Member

0xTim commented Feb 14, 2021

@quantum-fusion do you get this error when running the toolbox? IIRC you're on a Beta version on macOS so you're probably hitting issues because of that

@quantum-fusion
Copy link

@0xTim I tried this solution (aisingapore/TagUI#635), but it did not work.
I discovered, that I can upgrade openssl , like so:
https://stackoverflow.com/questions/56639315/updating-openssl-to-1-1-1-on-macos/56639316

brew install openssl@1.1

brew upgrade openssl@1.1


openssl version
OpenSSL 1.1.1j 16 Feb 2021

--

However, the problem is still that the dependencies for libressl are still wrong with the wrong dylib dependencies.

I tried, % brew install libressl

@quantum-fusion
Copy link

@0xTim see transcript

brew install libressl
==> Downloading https://homebrew.bintray.com/bottles/libressl-3.2.4.big_sur.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/d73d021753a498acafbdbff49a182797487e891628b5106ba6fcf4dcc0148e9f?response-content-disposition=attachment%3Bfilename%3D%22libressl-3.2.4.big_sur.bottle.tar.gz%22&Policy=eyJTdGF0ZW1lbnQiOiB
######################################################################## 100.0%
==> Pouring libressl-3.2.4.big_sur.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/libressl/certs

and run
/usr/local/opt/libressl/bin/openssl certhash /usr/local/etc/libressl/certs

libressl is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have libressl first in your PATH, run:
echo 'export PATH="/usr/local/opt/libressl/bin:$PATH"' >> /Users/hottelet/.bash_profile

For compilers to find libressl you may need to set:
export LDFLAGS="-L/usr/local/opt/libressl/lib"
export CPPFLAGS="-I/usr/local/opt/libressl/include"

For pkg-config to find libressl you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/libressl/lib/pkgconfig"

==> Summary
🍺 /usr/local/Cellar/libressl/3.2.4: 3,201 files, 15.6MB
Removing: /Users/hottelet/Library/Caches/Homebrew/libressl--3.2.3.big_sur.bottle.tar.gz... (5.1MB)

@0xTim
Copy link
Member

0xTim commented Feb 21, 2021

@quantum-fusion as I said, do you get this error when running the toolbox? OpenSSL is no longer a Vapor dependency so you shouldn't need it. What version of the toolbox do you have?

@quantum-fusion
Copy link

@0xTim I tried to check the version of vapor.

brew upgrade vapor
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/cask-versions, homebrew/core and homebrew/cask).
==> Updated Formulae
Updated 20 formulae.
==> Updated Casks
Updated 24 casks.

Warning: Treating vapor as a formula. For the cask, use homebrew/cask/vapor
Warning: vapor 18.3.0 already installed

Question, is vapor 18.3.0 the version number of your build?

Is there a vapor command to check the version on command line?

Can you install like shown with homebrew?


I believe the problem is the wrong version of vapor in the Package.swift build file.

https://github.com/rickwierenga/heartbeat-tutorials/blob/master/CoreML-API/CoreML-API/Package.swift

--
dependencies: [
// 💧 A server-side Swift web framework.
.package(url: "https://github.com/vapor/vapor.git", from: "3.0.0"),

    // 🔵 Swift ORM (queries, models, relations, etc) built on SQLite 3.
    .package(url: "https://github.com/vapor/fluent-sqlite.git", from: "3.0.0")
],

--

Question, what version of vapor and fluent-sqlite do you have, is it version 3.0.0 for both of these?
Why does home-brew think you have version 18.3.0?
Why is there a version mismatch?

@0xTim
Copy link
Member

0xTim commented Feb 22, 2021

@quantum-fusion please confirm, what command causes you to hit the error and what's the full error output?

@quantum-fusion
Copy link

vapor build
Building project...
warning: '--enable-test-discovery' option is deprecated; tests are automatically discovered on all platforms
Fetching https://github.com/vapor/database-kit.git from cache
Fetching https://github.com/vapor/routing.git from cache
Fetching https://github.com/vapor/validation.git from cache
Fetching https://github.com/vapor/console.git from cache
Fetching https://github.com/vapor/vapor.git from cache
Fetching https://github.com/vapor/template-kit.git from cache
Fetching https://github.com/vapor/core.git from cache
Fetching https://github.com/vapor/crypto.git from cache
Fetching https://github.com/vapor/sqlite.git from cache
Fetching https://github.com/vapor/fluent.git from cache
Fetching https://github.com/apple/swift-nio-ssl-support.git from cache
Fetching https://github.com/vapor/http.git from cache
Fetching https://github.com/vapor/multipart.git from cache
Fetching https://github.com/vapor/fluent-sqlite.git from cache
Fetching https://github.com/vapor/service.git from cache
Fetching https://github.com/apple/swift-nio.git from cache
Fetching https://github.com/apple/swift-nio-zlib-support.git from cache
Fetching https://github.com/vapor/sql.git from cache
Fetching https://github.com/apple/swift-nio-ssl.git from cache
Fetching https://github.com/vapor/url-encoded-form.git from cache
Fetching https://github.com/vapor/websocket.git from cache
Cloning https://github.com/vapor/crypto.git
Resolving https://github.com/vapor/crypto.git at 3.3.3
Cloning https://github.com/vapor/fluent.git
Resolving https://github.com/vapor/fluent.git at 3.2.0
Cloning https://github.com/vapor/http.git
Resolving https://github.com/vapor/http.git at 3.2.1
Cloning https://github.com/vapor/vapor.git
Resolving https://github.com/vapor/vapor.git at 3.3.1
Cloning https://github.com/vapor/sql.git
Resolving https://github.com/vapor/sql.git at 2.3.2
Cloning https://github.com/vapor/sqlite.git
Resolving https://github.com/vapor/sqlite.git at 3.2.1
Cloning https://github.com/vapor/url-encoded-form.git
Resolving https://github.com/vapor/url-encoded-form.git at 1.0.6
Cloning https://github.com/apple/swift-nio.git
Resolving https://github.com/apple/swift-nio.git at 1.14.1
Cloning https://github.com/vapor/console.git
Resolving https://github.com/vapor/console.git at 3.1.1
Cloning https://github.com/vapor/service.git
Resolving https://github.com/vapor/service.git at 1.0.2
Cloning https://github.com/vapor/fluent-sqlite.git
Resolving https://github.com/vapor/fluent-sqlite.git at 3.0.0
Cloning https://github.com/vapor/database-kit.git
Resolving https://github.com/vapor/database-kit.git at 1.3.3
Cloning https://github.com/vapor/template-kit.git
Resolving https://github.com/vapor/template-kit.git at 1.4.0
Cloning https://github.com/apple/swift-nio-ssl.git
Resolving https://github.com/apple/swift-nio-ssl.git at 1.4.0
Cloning https://github.com/vapor/multipart.git
Resolving https://github.com/vapor/multipart.git at 3.0.4
Cloning https://github.com/vapor/validation.git
Resolving https://github.com/vapor/validation.git at 2.1.1
Cloning https://github.com/apple/swift-nio-ssl-support.git
Resolving https://github.com/apple/swift-nio-ssl-support.git at 1.0.0
Cloning https://github.com/vapor/core.git
Resolving https://github.com/vapor/core.git at 3.9.2
Cloning https://github.com/vapor/websocket.git
Resolving https://github.com/vapor/websocket.git at 1.1.2
Cloning https://github.com/vapor/routing.git
Resolving https://github.com/vapor/routing.git at 3.1.0
Cloning https://github.com/apple/swift-nio-zlib-support.git
Resolving https://github.com/apple/swift-nio-zlib-support.git at 1.0.0
'swift-nio-ssl-support' /Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio-ssl-support: warning: ignoring declared target(s) 'swift-nio-ssl-support' in the system package
'swift-nio-zlib-support' /Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio-zlib-support: warning: ignoring declared target(s) 'swift-nio-zlib-support' in the system package
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift:120:13: warning: variable 'remainingReads' was never mutated; consider changing to 'let' constant
var remainingReads = 1 + (byteCount / chunkSize)
~~~ ^
let
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift:102:17: warning: variable 'msg' was never mutated; consider changing to 'let' constant
var msg = msghdr(msg_name: addresses.baseAddress! + c,
~~~ ^
let
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift:120:13: warning: variable 'remainingReads' was never mutated; consider changing to 'let' constant
var remainingReads = 1 + (byteCount / chunkSize)
~~~ ^
let
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift:102:17: warning: variable 'msg' was never mutated; consider changing to 'let' constant
var msg = msghdr(msg_name: addresses.baseAddress! + c,
~~~ ^
let
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/NonBlockingFileIO.swift:120:13: warning: variable 'remainingReads' was never mutated; consider changing to 'let' constant
var remainingReads = 1 + (byteCount / chunkSize)
~~~ ^
let
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/PendingDatagramWritesManager.swift:102:17: warning: variable 'msg' was never mutated; consider changing to 'let' constant
var msg = msghdr(msg_name: addresses.baseAddress! + c,
~~~ ^
let
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:69:20: warning: enum case 'const' has one associated value that is a tuple of 2 elements
case .const(let level, let name):
^
( )
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:56:10: note: 'const' declared here
case const(AssociatedValueType)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:69:20: warning: enum case 'const' has one associated value that is a tuple of 2 elements
case .const(let level, let name):
^
( )
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:56:10: note: 'const' declared here
case const(AssociatedValueType)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:69:20: warning: enum case 'const' has one associated value that is a tuple of 2 elements
case .const(let level, let name):
^
( )
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:56:10: note: 'const' declared here
case const(AssociatedValueType)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:69:20: warning: enum case 'const' has one associated value that is a tuple of 2 elements
case .const(let level, let name):
^
( )
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:56:10: note: 'const' declared here
case const(AssociatedValueType)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift:369:17: warning: variable 'val' was never mutated; consider changing to 'let' constant
var val = storage.bindMemory(to: T.self).baseAddress!
~~~ ^
let
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift:369:17: warning: variable 'val' was never mutated; consider changing to 'let' constant
var val = storage.bindMemory(to: T.self).baseAddress!
~~~ ^
let
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift:369:17: warning: variable 'val' was never mutated; consider changing to 'let' constant
var val = storage.bindMemory(to: T.self).baseAddress!
~~~ ^
let
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/BaseSocket.swift:369:17: warning: variable 'val' was never mutated; consider changing to 'let' constant
var val = storage.bindMemory(to: T.self).baseAddress!
~~~ ^
let
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:60:16: warning: static property '_none' produces an empty option set
static let _none = SelectorEventSet(rawValue: 0)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:60:16: note: use [] to silence this warning
static let _none = SelectorEventSet(rawValue: 0)
^ ~~~~~~~~~~~~~
([])
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:89:16: warning: static property '_none' produces an empty option set
static let _none = KQueueEventFilterSet(rawValue: 0)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:89:16: note: use [] to silence this warning
static let _none = KQueueEventFilterSet(rawValue: 0)
^ ~~~~~~~~~~~~~
([])
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:112:16: warning: static property '_none' produces an empty option set
static let _none = EpollFilterSet(rawValue: 0)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:112:16: note: use [] to silence this warning
static let _none = EpollFilterSet(rawValue: 0)
^ ~~~~~~~~~~~~~
([])
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:60:16: warning: static property '_none' produces an empty option set
static let _none = SelectorEventSet(rawValue: 0)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:60:16: note: use [] to silence this warning
static let _none = SelectorEventSet(rawValue: 0)
^ ~~~~~~~~~~~~~
([])
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:89:16: warning: static property '_none' produces an empty option set
static let _none = KQueueEventFilterSet(rawValue: 0)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:89:16: note: use [] to silence this warning
static let _none = KQueueEventFilterSet(rawValue: 0)
^ ~~~~~~~~~~~~~
([])
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:112:16: warning: static property '_none' produces an empty option set
static let _none = EpollFilterSet(rawValue: 0)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:112:16: note: use [] to silence this warning
static let _none = EpollFilterSet(rawValue: 0)
^ ~~~~~~~~~~~~~
([])
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:60:16: warning: static property '_none' produces an empty option set
static let _none = SelectorEventSet(rawValue: 0)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:60:16: note: use [] to silence this warning
static let _none = SelectorEventSet(rawValue: 0)
^ ~~~~~~~~~~~~~
([])
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:89:16: warning: static property '_none' produces an empty option set
static let none = KQueueEventFilterSet(rawValue: 0)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:89:16: note: use [] to silence this warning
static let none = KQueueEventFilterSet(rawValue: 0)
^ ~~~~~~~~~~~~~
([])
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:112:16: warning: static property 'none' produces an empty option set
static let none = EpollFilterSet(rawValue: 0)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Selector.swift:112:16: note: use [] to silence this warning
static let none = EpollFilterSet(rawValue: 0)
^ ~~~~~~~~~~~~~
([])
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift:687:29: warning: enum case 'const' has one associated value that is a tuple of 2 elements
case (.const(let lLevel, let lName), .const(let rLevel, let rName)):
^
( )
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:56:10: note: 'const' declared here
case const(AssociatedValueType)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift:687:60: warning: enum case 'const' has one associated value that is a tuple of 2 elements
case (.const(let lLevel, let lName), .const(let rLevel, let rName)):
^
( )
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:56:10: note: 'const' declared here
case const(AssociatedValueType)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift:687:29: warning: enum case 'const' has one associated value that is a tuple of 2 elements
case (.const(let lLevel, let lName), .const(let rLevel, let rName)):
^
( )
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:56:10: note: 'const' declared here
case const(AssociatedValueType)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift:687:60: warning: enum case 'const' has one associated value that is a tuple of 2 elements
case (.const(let lLevel, let lName), .const(let rLevel, let rName)):
^
( )
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:56:10: note: 'const' declared here
case const(AssociatedValueType)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift:687:29: warning: enum case 'const' has one associated value that is a tuple of 2 elements
case (.const(let lLevel, let lName), .const(let rLevel, let rName)):
^
( )
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:56:10: note: 'const' declared here
case const(AssociatedValueType)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift:687:60: warning: enum case 'const' has one associated value that is a tuple of 2 elements
case (.const(let lLevel, let lName), .const(let rLevel, let rName)):
^
( )
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:56:10: note: 'const' declared here
case const(AssociatedValueType)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift:687:29: warning: enum case 'const' has one associated value that is a tuple of 2 elements
case (.const(let lLevel, let lName), .const(let rLevel, let rName)):
^
( )
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:56:10: note: 'const' declared here
case const(AssociatedValueType)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/Bootstrap.swift:687:60: warning: enum case 'const' has one associated value that is a tuple of 2 elements
case (.const(let lLevel, let lName), .const(let rLevel, let rName)):
^
( )
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/swift-nio/Sources/NIO/ChannelOption.swift:56:10: note: 'const' declared here
case const(AssociatedValueType)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/crypto/Sources/Crypto/Utilities/Base32.swift:17:13: warning: variable 'result' was never mutated; consider changing to 'let' constant
var result = UnsafeMutablePointer.allocate(capacity: maxSize)
~~~ ^
let
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/crypto/Sources/Crypto/Utilities/Base32.swift:38:13: warning: variable 'result' was never mutated; consider changing to 'let' constant
var result = UnsafeMutablePointer.allocate(capacity: maxSize)
~~~ ^
let
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift:20:31: warning: initialization of 'UnsafeMutableRawPointer' results in a dangling pointer
let selfPointer = UnsafeMutableRawPointer(&self)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift:20:55: note: implicit argument conversion from 'String.InlineByteArray' to 'UnsafeMutableRawPointer' produces a pointer valid only for the duration of the call to 'init(
:)'
let selfPointer = UnsafeMutableRawPointer(&self)
^~~~~
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift:20:55: note: use 'withUnsafeMutableBytes' in order to explicitly convert argument to buffer pointer valid for a defined scope
let selfPointer = UnsafeMutableRawPointer(&self)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift:80:31: warning: initialization of 'UnsafeMutableRawPointer' results in a dangling pointer
let resultBytes = UnsafeMutableRawPointer(&resultData)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift:80:55: note: implicit argument conversion from 'String.SixteenBytes' to 'UnsafeMutableRawPointer' produces a pointer valid only for the duration of the call to 'init(
:)'
let resultBytes = UnsafeMutableRawPointer(&resultData)
^~~~~~~~~~~
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift:80:55: note: use 'withUnsafeMutableBytes' in order to explicitly convert argument to buffer pointer valid for a defined scope
let resultBytes = UnsafeMutableRawPointer(&resultData)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift:20:31: warning: initialization of 'UnsafeMutableRawPointer' results in a dangling pointer
let selfPointer = UnsafeMutableRawPointer(&self)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift:20:55: note: implicit argument conversion from 'String.InlineByteArray' to 'UnsafeMutableRawPointer' produces a pointer valid only for the duration of the call to 'init(
:)'
let selfPointer = UnsafeMutableRawPointer(&self)
^~~~~
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift:20:55: note: use 'withUnsafeMutableBytes' in order to explicitly convert argument to buffer pointer valid for a defined scope
let selfPointer = UnsafeMutableRawPointer(&self)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift:80:31: warning: initialization of 'UnsafeMutableRawPointer' results in a dangling pointer
let resultBytes = UnsafeMutableRawPointer(&resultData)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift:80:55: note: implicit argument conversion from 'String.SixteenBytes' to 'UnsafeMutableRawPointer' produces a pointer valid only for the duration of the call to 'init(
:)'
let resultBytes = UnsafeMutableRawPointer(&resultData)
^~~~~~~~~~~
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/template-kit/Sources/TemplateKit/Utilities/HTMLEscape.swift:80:55: note: use 'withUnsafeMutableBytes' in order to explicitly convert argument to buffer pointer valid for a defined scope
let resultBytes = UnsafeMutableRawPointer(&resultData)
^
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/websocket/Sources/WebSocket/WebSocketHandler.swift:37:13: warning: variable 'frame' was never mutated; consider changing to 'let' constant
var frame = self.unwrapInboundIn(data)
~~~ ^
let
/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/.build/checkouts/websocket/Sources/WebSocket/WebSocketHandler.swift:111:17: warning: using '
' to ignore the result of a Void-returning function is redundant
_ = ctx.close(promise: nil)
^~~~

/Users/hottelet/Desktop/heartbeat-tutorials-master/CoreML-API/CoreML-API/Sources/App/Controllers/Classifier.swift:22:45: error: cannot find 'Resnet50' in scope
let model = try! VNCoreMLModel(for: Resnet50().model)
^~~~~~~~
[682/683] Compiling App ClassificationRequest.swift
VaporToolbox/exec.swift:55: Fatal error: result 1
Illegal instruction: 4

@quantum-fusion
Copy link

@0xTim I was able to get the ResNet50 model installed like this ticket (rickwierenga/heartbeat-tutorials#3).

I was able to download the Resnet model and create the xcodeproject file.
% swift package generate-xcodeproj
% xcodebuild -list -project CoreML-API.xcodeproj
% xcodebuild -scheme Run build

Once, the Resnet50 model is installed, then it builds in Xcode.

Even with the upgrade to openssl to version 1.1:
openssl version
OpenSSL 1.1.1j 16 Feb 2021

The build still fails. The error message is:
ld: warning: dylib (/usr/local/Cellar/openssl@1.1/1.1.1j/lib/libssl.dylib) was built for newer macOS version (11.0) than being linked (10.10)
ld: warning: dylib (/usr/local/Cellar/openssl@1.1/1.1.1j/lib/libcrypto.dylib) was built for newer macOS version (11.0) than being linked (10.10)
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_CIContext", referenced from:
objc-class-ref in Classifier.o
"OBJC_CLASS$_CIImage", referenced from:
objc-class-ref in routes.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Screen Shot 2021-02-22 at 7 51 43 AM

@0xTim
Copy link
Member

0xTim commented Feb 22, 2021

Ok, the actual error has nothing to do with OpenSSL. You haven't linked whatever includes CIContext and CIImage to your project.

As for the answer - I'm not sure. this isn't a Vapor issue. I would however recommend upgrading to Vapor 4 - you'll get better support and there are no dependencies on OpenSSL

@quantum-fusion
Copy link

0xTim I tried to upgrade vapor, however I don't see the vapor 4 version number. Is there a command that upgrades and then checks for the vapor version?

%brew upgrade vapor
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/cask-versions, homebrew/core and homebrew/cask).
==> New Formulae
open-adventure
==> Updated Formulae
Updated 121 formulae.
==> New Casks
pika
==> Updated Casks
Updated 71 casks.

Warning: Treating vapor as a formula. For the cask, use homebrew/cask/vapor
Warning: vapor 18.3.0 already installed

@0xTim
Copy link
Member

0xTim commented Feb 22, 2021

@quantum-fusion theres a difference between the toolbox and framework. The toolbox is the CLI that you do vapor new ... with - that's at version 18.3 or something.

The framework is version 4 and that's defined in the Package.swift file. Upgrading from 3 to 4 is not a simple task but there are docs for it.

I suggest if you hit any more problems you should post them on the Vapor Discord as there are more people to help and it avoids crowding this issue.

@quantum-fusion
Copy link

0xTim I just upgraded to vapor4, and have attached the Package.swift file.

// swift-tools-version:5.2
import PackageDescription

let package = Package(
name: "CoreML-API",
platforms: [
.macOS(.v10_15),
],
products: [
.library(name: "CoreML-API", targets: ["App"]),
],
dependencies: [
// 💧 A server-side Swift web framework.
// .package(url: "https://github.com/vapor/fluent.git", from: "4.0.0-rc"),
.package(url: "https://github.com/vapor/fluent-kit.git", .branch("master")),
.package(url: "https://github.com/vapor/fluent-postgres-driver.git", from: "2.0.0-rc"),
// .package(url: "https://github.com/vapor/jwt.git", from: "4.0.0-rc"),
.package(url: "https://github.com/vapor/vapor.git", from: "4.3.0"),
],
targets: [
.target(name: "App", dependencies: [
// .product(name: "Fluent", package: "fluent"),
.product(name: "FluentPostgresDriver", package: "fluent-postgres-driver"),
.product(name: "Vapor", package: "vapor"),
// .product(name: "JWT", package: "jwt"),
]),
.target(name: "Run", dependencies: [
.target(name: "App"),
]),
.testTarget(name: "AppTests", dependencies: [
.target(name: "App"),
])
]
)

The results of the build are below, and show a dependency on fluent-kit, even thought the project does not depend on it.

Screen Shot 2021-02-22 at 9 18 50 AM

@0xTim
Copy link
Member

0xTim commented Feb 22, 2021

As I said, please move any questions for upgrading to Vapor Discord

@quantum-fusion
Copy link

0xTim I joined discord as quantum-fusion , and It doesn't let me chat.

@quantum-fusion
Copy link

0xTim your discord channel is read only, so I sent you a question about fluent-kit , which repo is it in? on Discord chat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants