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

SwiftMetrics fails to build with Swift 3.1 #89

Closed
tobespc opened this issue Mar 27, 2017 · 36 comments
Closed

SwiftMetrics fails to build with Swift 3.1 #89

tobespc opened this issue Mar 27, 2017 · 36 comments
Milestone

Comments

@tobespc
Copy link
Member

tobespc commented Mar 27, 2017

No description provided.

@tobespc tobespc added the bug label Mar 27, 2017
@tobespc
Copy link
Member Author

tobespc commented Mar 29, 2017

logs similar to this are the issue

Fetching https://github.com/IBM-Swift/Kitura-Request.git
Fetching https://github.com/IBM-Swift/CloudConfiguration.git
error: fatal error: Error raised at top level: Error Domain=NSCocoaErrorDomain Code=4 ""org.eclipse.paho.mqtt.c" couldn't be moved to "src" because either the former doesn't exist, or the folder containing the latter doesn't exist." UserInfo={NSSourceFilePathErrorKey=/Users/kweinmeister/Documents/Xcode/tmpProj/org.eclipse.paho.mqtt.c, NSUserStringVariant=(
    Move
), NSDestinationFilePath=/Users/kweinmeister/Documents/Xcode/tmpProj/src/paho, NSFilePath=/Users/kweinmeister/Documents/Xcode/tmpProj/org.eclipse.paho.mqtt.c, NSUnderlyingError=0x7fb738efa180 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}: file /Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-802.0.48/src/swift/stdlib/public/core/ErrorType.swift, line 188
Current stack trace:
0    libswiftCore.dylib                 0x000000010903a160 swift_reportError + 129
1    libswiftCore.dylib                 0x0000000109056a70 _swift_stdlib_reportFatalErrorInFile + 100

@tobespc
Copy link
Member Author

tobespc commented Mar 30, 2017

We are looking to embed the omr-agentcore code into SwifMetrics in the short term to resolve the build issues with 3.1

@lroseblade
Copy link

@tobespc as in a fork of omr-agentcore until the custom module layouts are supported in SPM?

@tobespc
Copy link
Member Author

tobespc commented Mar 30, 2017 via email

@sjanuary
Copy link
Contributor

sjanuary commented Apr 3, 2017

SwiftMetrics now works on 3.1 if you use the branch swift-3.1. SwiftMetricsDash is not working yet, currently hitting Kitura/Kitura-WebSocket#5

@cdlliuy
Copy link

cdlliuy commented Apr 7, 2017

@sjanuary @tobespc , Swift 3.1 is uploaded to Dallas YP now, then push swift application to YP with "swiftmetric", the master branch is always used, so the staging failure is observed.

Could you merge the fix into master branch to fix the build break as early as possible ?

@tobespc
Copy link
Member Author

tobespc commented Apr 7, 2017

we will do but until the Kitura/Kitura-WebSocket#5 is fixed the dashboard is not going to work. This means you won't be able to use the SwiftMetrics Dashboard

@cdlliuy
Copy link

cdlliuy commented Apr 7, 2017

I concern more for the staging failure currently for bluemix apps. It is build broken for related users.

@cdlliuy
Copy link

cdlliuy commented Apr 11, 2017

@sjanuary @tobespc , stills failing when push swift metrics apps to bluemix. It is a build broken, and it is not fixed for about 15 days ..

@tobespc
Copy link
Member Author

tobespc commented Apr 11, 2017

We cant merge into master yet as once we do, due to new dependencies required to work for Swift 3.1, Swift 3.0 will be broken. Can the build pack be changed to pull from a difference branch in the short term?

@cdlliuy
Copy link

cdlliuy commented Apr 11, 2017

I don't know how it would be configure through buildpack. I asked in slack @swift channel to find the contact point of swift build pack team

@tobespc
Copy link
Member Author

tobespc commented Apr 11, 2017

We are going to fix the build issue today so that the buildpack will work. The dashboard won't be working until we get an apple bug fixed but at least the build will work

@sjanuary
Copy link
Contributor

@cdlliuy - FYI the bug in Swift core that is blocking us is https://bugs.swift.org/browse/SR-4435.
I think Swift 3.0 can still be used on Bluemix even though 3.1 is the default?

@cdlliuy
Copy link

cdlliuy commented Apr 11, 2017

@sjanuary, it looks like the swift 3.1 is selected by default now. I am expert for swift buildpack, you can check with buildpack team. anyway, I didn't get a name to contact swift buildpack team yet, please help to figure out.

@mattcolegate
Copy link
Member

I think the Swift Buildpack is hosted at https://github.com/IBM-Swift/swift-buildpack. Given the activity in there, @rolivieri seems like someone to contact to start with.

@tunniclm
Copy link
Contributor

IIRC you can configure the version of Swift used by the build pack via the .swift-version file:https://github.com/IBM-Swift/swift-buildpack#specify-a-swift-version

@lroseblade
Copy link

I will speak with the relevant parties today and post back in here. @rolivieri is no longer owner of the buildpack.

@lroseblade
Copy link

This will be discussed at the Swift TSC on Thursday

@cdlliuy
Copy link

cdlliuy commented Apr 12, 2017

@tunniclm , I am not sure whether the workaround of .swift-version is well known workaround by end-user .. What is the release process of swift buildpack? I worked with liberty and node.js buildpack team previously, they will send out release announcement and call for related/dependency team's comments when released on YS1. If no failure detected, will continue to publish to YP. I am not sure whether swift buildpack is following the similar process. The build failure should be detected and reported to Swift buildpack team before the version 3.1 goes to production.

@cdlliuy
Copy link

cdlliuy commented Apr 12, 2017

Is there any build failure monitoring in Swift metrics team? It means compile swift metrics apps, push to bluemix everyday (or more frequently, i.e every 2 hours) to detect any possible failures. The continuous build/test/delivery process will help to detect failure promptly.

@rolivieri
Copy link
Contributor

rolivieri commented Apr 12, 2017

All, I just saw this thread.

Our recommendation is that all Swift apps should contain a .swift-version file with the corresponding Swift version. That should take care of any issues that may be occurring with having 3.1 as the default version in the builpack. If an app should be provisioned on Bluemix using 3.0.2 (or a different version), then having this file will ensure the buildpack uses the corresponding Swift version. Using a .swift-version file has become a best practice in the Swift development world. The buildpack is simply leveraging something that has become a de facto standard for Swift developers (other tools also leverage this file such as swiftenv).

Having SwiftMetrics compiled with the latest version of Swift has not been a requirement for updating the buildpack. They are separate and independent artifacts. One of the main goals that we as a team have been aiming at is the adoption of new Swift versions as soon as they come out. Among the main artifacts that are affected by this goal are the buildpack, our docker images, and package-builder.

@cdlliuy
Copy link

cdlliuy commented Apr 12, 2017

@rolivieri , got it. I found .swift_version related documents in swift buildpack, so that we (auto-scaling) team can add related trouble shooting link as well , so that if end-user has staging error of swiftmetric, they are check SwiftBuildpack documentation to get a solution as well.

@tobespc , I suggest to add a section of "support swift version" in readme.md, so that the user can check the latest supported swift version easily when checking the git project.

On the other hand, although the end-user can downgrade to v3.0.2 with .swift_version, I still suggest to add continuous test to detect whether swift metric & latest swift engine are compatible, and fix the incompatible issue as early as possible.

@sjanuary
Copy link
Contributor

Update: SwiftMetrics @1.0.2 now builds on 3.1 although the dashboard (SwiftMetricsDash) will not work due to the issue referenced above.

@cdlliuy
Copy link

cdlliuy commented Apr 13, 2017

@sjanuary @tobespc , the fix did work to fix the "staging" error, BUT the swift apps keep crashing when running on bluemix.

here is "cf logs --recent " record:

2017-04-13T16:41:14.31+0800 [CELL/0] OUT Creating container
2017-04-13T16:41:15.05+0800 [CELL/0] OUT Successfully created container
2017-04-13T16:41:20.67+0800 [CELL/0] OUT Starting health monitoring of container
2017-04-13T16:41:21.06+0800 [APP/0] ERR [Thu Apr 13 08:41:21 2017] com.ibm.diagnostics.healthcenter.loader INFO: Swift Application Metrics
2017-04-13T16:41:21.06+0800 [APP/0] OUT SwiftMetrics: Error finding install directory
2017-04-13T16:41:22.76+0800 [CELL/0] OUT Container became healthy
2017-04-13T16:43:19.27+0800 [APP/0] ERR [Thu Apr 13 08:43:19 2017] com.ibm.diagnostics.healthcenter.plugins WARNING: [cpu_os] At least one data gathering failure occurred
2017-04-13T16:43:19.27+0800 [APP/0] OUT results: [Optional(CloudFoundryEnv.Service)]
2017-04-13T16:43:25.27+0800 [APP/0] ERR *** Error in `Your-App': double free or corruption (fasttop): 0x00007f72200008e0 ***
2017-04-13T16:43:25.27+0800 [APP/0] OUT Exit status 134
2017-04-13T16:43:25.29+0800 [CELL/0] OUT Exit status 0
2017-04-13T16:43:25.30+0800 [CELL/0] OUT Destroying container
2017-04-13T16:43:25.31+0800 [API/2] OUT App instance exited with guid 147f37dd-ebe9-418a-b756-5331b4e9f205 payload: {"instance"=>"", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 2 error(s) occurred:\n\n* Exited with status 134\n* cancelled\n* cancelled", "crash_count"=>5, "crash_timestamp"=>1492073005301698935, "version"=>"d99f3e4f-f92d-41e6-a2ac-79eab3f8feb0"}
2017-04-13T16:43:25.92+0800 [CELL/0] OUT Successfully destroyed container
2017-04-13T16:45:44.85+0800 [CELL/0] OUT Creating container
2017-04-13T16:45:49.19+0800 [CELL/0] OUT Successfully created container
2017-04-13T16:45:53.33+0800 [CELL/0] OUT Starting health monitoring of container
2017-04-13T16:45:53.50+0800 [APP/0] OUT SwiftMetrics: Error finding install directory
2017-04-13T16:45:53.50+0800 [APP/0] ERR [Thu Apr 13 08:45:53 2017] com.ibm.diagnostics.healthcenter.loader INFO: Swift Application Metrics
2017-04-13T16:45:54.56+0800 [APP/0] OUT results: [Optional(CloudFoundryEnv.Service)]
2017-04-13T16:45:54.56+0800 [APP/0] ERR [Thu Apr 13 08:45:54 2017] com.ibm.diagnostics.healthcenter.plugins WARNING: [cpu_os] At least one data gathering failure occurred
2017-04-13T16:45:55.44+0800 [CELL/0] OUT Container became healthy
2017-04-13T16:47:21.60+0800 [APP/0] OUT Exit status 139
2017-04-13T16:47:21.63+0800 [CELL/0] OUT Exit status 0
2017-04-13T16:47:21.63+0800 [CELL/0] OUT Destroying container
2017-04-13T16:47:21.64+0800 [API/1] OUT App instance exited with guid 147f37dd-ebe9-418a-b756-5331b4e9f205 payload: {"instance"=>"", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 2 error(s) occurred:\n\n* Exited with status 139\n* cancelled\n* cancelled", "crash_count"=>6, "crash_timestamp"=>1492073241637097043, "version"=>"d99f3e4f-f92d-41e6-a2ac-79eab3f8feb0"}

I tried to add .swift-version file with "3.0.2" , then the same application ran correctly. Then change back to 3.1, failed again..

So, I think the fix didn't work as we expected.

@ianpartridge
Copy link
Contributor

Swift 3.1 contains a memory corruption bug and should be considered broken. The memory corruption is known to be triggered by accessing the SwiftMetrics dashboard, but could occur at any time.

It is likely that Swift 3.1.1 will be released soon with a fix for the issue. Until then, please use Swift 3.0.2

@qibobo
Copy link
Contributor

qibobo commented Apr 14, 2017

@ianpartridge is there a target date when the v3.1.1 will be released?

@ianpartridge
Copy link
Contributor

No, this is Apple's decision. Hopefully it will be soon.

@mattcolegate mattcolegate added this to the 1.2 milestone Apr 25, 2017
@mattcolegate
Copy link
Member

3.1.1 is now released. @cdlliuy can you please test again with 3.1.1 and check if the problem still occurs?

@tobespc tobespc added investigate and removed bug labels Apr 25, 2017
@tobespc
Copy link
Member Author

tobespc commented Apr 25, 2017

fyi CPU and Environment is not working currently

@cdlliuy
Copy link

cdlliuy commented Apr 26, 2017

The 3.1.1 version is not released on Bluemix YS1/LYS1.
swift_buildpack 4 true false buildpack_swift_v2.0.5-20170406-2317.zip

So, I will wait until the next swift buildpack released on staging . @rolivieri

@rolivieri
Copy link
Contributor

rolivieri commented Apr 26, 2017

@cdlliuy You don't need to wait for the next version of the buildpack to test. Just make sure you have a .swift-version file in your test application. The buildpack will download the version of Swift that you request in the .swift-version file.

@cdlliuy
Copy link

cdlliuy commented Apr 27, 2017

@rolivieri, my test app is included .swift_version with 3.0.2 now, so it is good. But @mattcolegate is asking me to try on 3.1.1 now, so I would like to wait for the next buildpack

@tobespc
Copy link
Member Author

tobespc commented Apr 27, 2017

@cdlliuy we have an issue with SwiftMetrics on Swift 3.1.1 right now with it crashing. Should have a fix in for that later today

@mattcolegate
Copy link
Member

mattcolegate commented Apr 27, 2017

@tobespc I think this issue has crept beyond it's original purpose. SwiftMetrics now builds on 3.1. Unfortunately it crashes at runtime, but shouldn't that be a separate issue? I believe this issue should be closed.

@tobespc
Copy link
Member Author

tobespc commented Apr 27, 2017

closing as tracked under #104

@tobespc tobespc closed this as completed Apr 27, 2017
@rolivieri
Copy link
Contributor

@cdlliuy My point was more around the following lines: To test SwiftMetrics (when Toby and Matt have a version ready for you for testing) on Bluemix, you can update your .swift-version file to have 3.1.1 instead of 3.0.2 (i.e. testing on Bluemix using 3.1.1 can be done today even though the new version of the buildpack is not there yet).

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

No branches or pull requests

9 participants