Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

swift 3 broken / swift 4 update #3181

Closed

Description

@tanner0101

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.

Activity

  1. msmith-techempower commented on Jan 15, 2018

    @msmith-techempower
    Member

    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.

  2. zloster commented on Jan 15, 2018

    @zloster
    Contributor
  3. twof commented on Jan 15, 2018

    @twof

    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

  4. msmith-techempower commented on Jan 15, 2018

    @msmith-techempower
    Member

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

    Also, what is cmysql?

  5. zloster commented on Jan 15, 2018

    @zloster
    Contributor
  6. msmith-techempower commented on Jan 15, 2018

    @msmith-techempower
    Member

    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?

  7. zloster commented on Jan 15, 2018

    @zloster
    Contributor

    @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.

  8. msmith-techempower commented on Jan 15, 2018

    @msmith-techempower
    Member

    @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.

  9. msmith-techempower commented on Jan 15, 2018

    @msmith-techempower
    Member

    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?

  10. zloster commented on Jan 15, 2018

    @zloster
    Contributor

    @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.

  11. tanner0101 commented on Jan 15, 2018

    @tanner0101
    ContributorAuthor

    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! :)

  12. michaelhixson commented on Feb 1, 2018

    @michaelhixson
    Contributor

    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: vapor/vapor@5a31fc8#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?

  13. msmith-techempower commented on Feb 1, 2018

    @msmith-techempower
    Member

    I'm fine with that.

  14. NateBrady23 commented on Feb 5, 2018

    @NateBrady23
    Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions