Frameworkbenchmarks: swift 3 broken / swift 4 update

Created on 14 Jan 2018  路  15Comments  路  Source: TechEmpower/FrameworkBenchmarks

It looks like the swift3 dependency is installed incorrectly.

Setup vapor: ~/FrameworkBenchmarks/frameworks/Swift/vapor
Setup vapor: databases is installed!
Setup vapor: swift-build: error: /home/techempower/FrameworkBenchmarks/frameworks/Swift/vapor/Package.swift:1:8: error: no such module 'PackageDescription'
Setup vapor: import PackageDescription
Setup vapor:        ^
Setup vapor: exit(1): /home/techempower/FrameworkBenchmarks/installs/swift/usr/bin/swiftc --driver-mode=swift -I /home/techempower/FrameworkBenchmarks/installs/swift/usr/lib/swift/pm -L /home/techempower/FrameworkBenchmarks/installs/swift/usr/lib/swift/pm -lPackageDescription /home/techempower/FrameworkBenchmarks/frameworks/Swift/vapor/Package.swift -fileno 8

http://tfb-logs.techempower.com/round-15/preview-3/vapor/out.txt

The -lPackageDescription lib should be installed and exported when Swift is installed correctly.

Additionally, we should update this to Swift 4 now.

I'd be more than happy to make a PR if someone could point me to the scripts that are responsible for configuring Swift.

Most helpful comment

As long as a Postgres server is available to be connected to over TCP, Vapor 3 should no longer require those C dependencies (for MySQL as well). We have pure-Swift drivers now.

All we should need to fix is the Swift PackageDescription issue as well as updating to Swift >= 4.0 since we depend on features in Swift 4.

@msmith-techempower I will look into that file you linked, thanks! :)

All 15 comments

You can generally find language/servers/etc at toolset/setup/linux as named shell scripts. Specifically, swift.sh is where you would need to update swift.

Also the scripts in the Vapor framework itself need some attention:

Each one of them is requesting PostgreSQL, MySQL and MongoDB to be installed/started. When you build and test against PostgreSQL there is no need to activate another databases and data stores.

So a more appropriate setup-postgresql.sh would look like

#!/bin/bash

fw_depends swift3 ctls cmysql postgresql

swift build -Xswiftc -DNOJSON -c release

.build/release/vapor-tfb-mongodb --env=production &

yeah? @zloster

Why would the release be called vapir-tfb-mongodb if it depends on postgresql.

Also, what is cmysql?

@twof Yes
@msmith-techempower It's Vapor and its DB driver?! https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/toolset/setup/linux/systools/cmysql.sh#L9-L10 This is the referenced shell script. IMO cmysql.sh should be called vapor.sh.

IMO cmysql.sh should be called vapor.sh

Agreed

It's Vapor and something else?! https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/toolset/setup/linux/systools/cmysql.sh#L9-L10

But it doesn't outwardly appear to use mongodb at all; what am I missing?

@msmith-techempower I was too slow to edit the comment. cmysql appears like some sort of bridge to the DB drivers. But I don't have any idea how swift/vapor connects to mongodb.

@zloster I think that the setup scripts are just wrong (potentially); there are three separate source folders for each database type (vapor-tfb-mongodb, vapor-tfb-mysql, vapor-tfb-postgresql), but each setup script relies on the default build process (not selecting one) which creates (I guess) vapor-tfb-mongodb by default.

I would expect each respective setup_...sh files to build their correct application server, and then execute the correct one rather than just the mongodb variant.

You're right and I'm dumb >_<

Well, that's good to know for sure.

I guess let's just clean up cmysql to be vapor?

@twof @msmith-techempower I'm also dumb >_<
In the script that should build the PostgreSQL variant you should declare postgresql as dependency and call postgresql build artifact. Not the mongodb one.
So the code should look like as:

#!/bin/bash

fw_depends swift3 ctls cmysql postgresql

swift build -Xswiftc -DNOJSON -c release

.build/release/vapor-tfb-postgresql --env=production &

With the agreement that fw_depends cmysql should be renamed to fw_depends vapor and the cmysql script renamed to vapor.

As long as a Postgres server is available to be connected to over TCP, Vapor 3 should no longer require those C dependencies (for MySQL as well). We have pure-Swift drivers now.

All we should need to fix is the Swift PackageDescription issue as well as updating to Swift >= 4.0 since we depend on features in Swift 4.

@msmith-techempower I will look into that file you linked, thanks! :)

I think we're running to this problem: https://bugs.swift.org/browse/SR-5800

The build gets much farther if I change toolset/setup/linux/languages/swift3.sh to use the latest swift 4.1 snapshot.

fw_get -O https://swift.org/builds/development/ubuntu1404/swift-DEVELOPMENT-SNAPSHOT-2018-01-30-a/swift-DEVELOPMENT-SNAPSHOT-2018-01-30-a-ubuntu14.04.tar.gz
fw_untar swift-DEVELOPMENT-SNAPSHOT-2018-01-30-a-ubuntu14.04.tar.gz
mv swift-DEVELOPMENT-SNAPSHOT-2018-01-30-a-ubuntu14.04 swift

It eventually runs into an error compiling vapor. The version of vapor we're using is missing this fix: https://github.com/vapor/vapor/commit/5a31fc8c7c6a54a8a98494795e0668666c341a33#diff-4a85e78227146848570c0c42d00d2f17

If I edit frameworks/Swift/vapor/Package.swift to use a more recent version of vapor...

    .Package(url: "https://github.com/vapor/vapor.git", "2.4.4"),

...then it passes all the TFB tests locally.

@msmith-techempower How do you feel about us using a snapshot version of Swift for the time being?

I'm fine with that.

This is solved for now, however as noted in #3242 the vapor tests are not completing queries/updates in a reasonable amount of time.

Was this page helpful?
0 / 5 - 0 ratings