Re: [swift-corelibs-dev] [XCTest] Cannot build using XCode

2016-07-01 Thread Madhu Samuel via swift-corelibs-dev
Hi Brian,

Thanks for you response.

Still I cannot compile corelibs-xctest with xcode-beta. It seems the error
is too generic to debug! If xctest is not yet configured against xcode 8
beta, probably, I will wait. At this point, I am lazy to create my own
toolchain, since my last attempt went bust!


The steps I followed

1. delete swift/build
2. utils/update-checkout
3. sudo  xcode-select -s
/Applications/Xcode-beta.app/Contents/Developer
4. utils/build-script -r -t   (success)
5. utils/build-script -R.(success)
6.
$ cd swift-corelibs-xctest
$ ../swift/utils/build-script --preset corelibs-xctest


Environment

*Swift Version: Swift version 3.0 (swiftlang-800.0.30 clang-800.0.24)*
Xcode Environment: Version 8.0 beta (8S128d)
Python Version: Python 2.7.10



The Error

CompileSwift normal x86_64
/Users/madhusamuel/dev/swift/swift-corelibs-xctest/Sources/XCTest/Public/XCTestExpectation.swift

.



:0: error: unable to execute command: Illegal instruction: 4
:0: error: compile command failed due to signal (use -v to see
invocation)
** BUILD FAILED **


The following build commands failed:
CompileSwift normal x86_64
/Users/madhusamuel/dev/swift/swift-corelibs-xctest/Sources/XCTest/Public/XCTestMain.swift
CompileSwift normal x86_64
/Users/madhusamuel/dev/swift/swift-corelibs-xctest/Sources/XCTest/Private/TestListing.swift
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
(3 failures)
Traceback (most recent call last):
  File
"/Users/madhusamuel/dev/swift/swift-corelibs-xctest/build_script.py", line
445, in 
main()
  File
"/Users/madhusamuel/dev/swift/swift-corelibs-xctest/build_script.py", line
441, in main
parsed_args.func(parsed_args)
  File
"/Users/madhusamuel/dev/swift/swift-corelibs-xctest/build_script.py", line
64, in build
source_dir=SOURCE_DIR))
  File
"/Users/madhusamuel/dev/swift/swift-corelibs-xctest/build_script.py", line
30, in run
subprocess.check_call(command, shell=True)
  File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py",
line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'xcodebuild -workspace
/Users/madhusamuel/dev/swift/swift-corelibs-xctest/XCTest.xcworkspace
-scheme SwiftXCTest
SWIFT_EXEC="/Users/madhusamuel/dev/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/bin/swiftc"
SWIFT_LINK_OBJC_RUNTIME=YES
SYMROOT="/Users/madhusamuel/dev/swift/build/Ninja-ReleaseAssert/xctest-macosx-x86_64"
OBJROOT="/Users/madhusamuel/dev/swift/build/Ninja-ReleaseAssert/xctest-macosx-x86_64"'
returned non-zero exit status 65
../swift/utils/build-script: fatal error: command terminated with a
non-zero exit status 1, aborting
../swift/utils/build-script: fatal error: command terminated with a
non-zero exit status 1, aborting


Regards,
Madhu

On Thu, Jun 30, 2016 at 11:38 PM, Brian Gesiak  wrote:

> Madhu,
>
> Sorry for the late reply to this -- I obviously need to update my email
> settings! :(
>
> Could you pull down the latest changes to Swift, and let me know if you're
> still experiencing difficulties compiling corelibs-xctest?
>
> - Brian Gesiak
>
>
> On Tue, Jun 21, 2016 at 12:03 AM, Madhu Samuel 
> wrote:
>
>> Wow, the swift build is a success. Though there are a few warnings at the
>> end. I guess the issue was with cached values in the build directory.
>>
>> But, in the next step to build xctest using "/utils/build-script --preset
>> corelibs-xctest", the build fails. The build error log is given below.
>>
>> 
>>
>> CompileSwift normal x86_64
>> /Users/madhusamuel/dev/swift/swift-corelibs-xctest/Sources/XCTest/Public/XCTestExpectation.swift
>> 
>> 
>>
>> :0: error: unable to execute command: Illegal instruction: 4
>> :0: error: compile command failed due to signal (use -v to see
>> invocation)
>> ** BUILD FAILED **
>>
>>
>> The following build commands failed:
>> CompileSwift normal x86_64
>> /Users/madhusamuel/dev/swift/swift-corelibs-xctest/Sources/XCTest/Private/TestListing.swift
>> CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
>> (2 failures)
>> Traceback (most recent call last):
>>   File
>> "/Users/madhusamuel/dev/swift/swift-corelibs-xctest/build_script.py", line
>> 445, in 
>> main()
>>   File
>> "/Users/madhusamuel/dev/swift/swift-corelibs-xctest/build_script.py", line
>> 441, in main
>> parsed_args.func(parsed_args)
>>   File
>> "/Users/madhusamuel/dev/swift/swift-corelibs-xctest/build_script.py", line
>> 64, in build
>> source_dir=SOURCE_DIR))
>>   File
>> "/Users/madhusamuel/dev/swift/swift-corelibs-xctest/build_script.py", line
>> 30, in run
>> subprocess.check_call(command, shell=True)
>>   File
>> "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py",
>> line 540, in check_call
>> raise CalledProcessError(retcode, cmd)
>> subprocess.CalledProcessError: Command 'xcodebuild -workspace
>> /Users/madhusamuel/dev/swift/swift-corelibs-xctest/

Re: [swift-corelibs-dev] [XCTest] Cannot build using XCode

2016-07-01 Thread Madhu Samuel via swift-corelibs-dev
I just found more error details in the log. You can find it below. Hope
this helps.

Error 1
--

CompileSwift normal x86_64
/Users/madhusamuel/dev/swift/swift-corelibs-xctest/Sources/XCTest/Public/XCTestMain.swift
cd /Users/madhusamuel/dev/swift/swift-corelibs-xctest
...
...
/Users/madhusamuel/dev/swift/swift-corelibs-xctest/Sources/XCTest/Public/XCTestMain.swift:65:71:
error: 'lastPathComponent' is unavailable: Use lastPathComponent on URL
instead.
currentTestSuite = XCTestSuite(name:
"\(testBundle.bundlePath.lastPathComponent).xctest")

^
SwiftFoundation.String:173:16: note: 'lastPathComponent' has been
explicitly marked unavailable here
public var lastPathComponent: String { get }
   ^


Error 2
--
CompileSwift normal x86_64
/Users/madhusamuel/dev/swift/swift-corelibs-xctest/Sources/XCTest/Private/TestListing.swift
cd /Users/madhusamuel/dev/swift/swift-corelibs-xctest
...
...
/Objects-normal/x86_64/TestListing.swiftdeps -o
/Users/madhusamuel/dev/swift/build/Ninja-ReleaseAssert/xctest-macosx-x86_64/XCTest.build/Debug/SwiftXCTest.build/Objects-normal/x86_64/TestListing.o
/Users/madhusamuel/dev/swift/swift-corelibs-xctest/Sources/XCTest/Private/TestListing.swift:45:46:
error: cannot convert value of type 'String.Encoding' to expected argument
type 'UInt'
print(NSString(data: json, encoding: NSUTF8StringEncoding)!)
 ^~~~
 .rawValue
Assertion failed: (!failed && "Call arguments did not match up?"), function
coerceCallArguments, file
/Users/madhusamuel/dev/swift/swift/lib/Sema/CSApply.cpp, line 4655.
0  swift0x00010b6a6d5b
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43
1  swift0x00010b6a5f86
llvm::sys::RunSignalHandlers() + 70
2  swift0x00010b6a7631 SignalHandler(int) + 641
3  libsystem_platform.dylib 0x7fff8ecf552a _sigtramp + 26
4  swift0x00010c290579 cmark_strbuf__initbuf + 73960
5  swift0x00010b6a727e abort + 14
6  swift0x00010b6a7261 __assert_rtn + 81
7  swift0x000108ff5bae (anonymous
namespace)::ExprRewriter::coerceCallArguments(swift::Expr*, swift::Type,
llvm::PointerUnion >, swift::constraints::ConstraintLocatorBuilder) + 6190
8  swift0x000108fe4b0d (anonymous
namespace)::ExprRewriter::finishApply(swift::ApplyExpr*, swift::Type,
swift::constraints::ConstraintLocatorBuilder) + 541
9  swift0x000108ff638e (anonymous
namespace)::ExprRewriter::visitApplyExpr(swift::ApplyExpr*) + 78
10 swift0x000108fe2325 (anonymous
namespace)::ExprRewriter::walkToExprPost(swift::Expr*) + 21
11 swift0x000109180db0 (anonymous
namespace)::Traversal::visit(swift::Expr*) + 160
12 swift0x000109182969 (anonymous
namespace)::Traversal::visit(swift::Expr*) + 7257
13 swift0x000109180145
swift::Expr::walk(swift::ASTWalker&) + 53
14 swift0x000108fdedcb
swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&,
swift::Expr*, swift::Type, bool, bool, bool) + 475
15 swift0x000109081e53
swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*,
swift::TypeLoc, swift::ContextualTypePurpose,
swift::OptionSet,
swift::ExprTypeCheckListener*) + 739
16 swift0x0001090f9fc4 swift::ASTVisitor<(anonymous
namespace)::StmtChecker, void, swift::Stmt*, void, void, void,
void>::visit(swift::Stmt*) + 4820
17 swift0x0001090f8e3e swift::ASTVisitor<(anonymous
namespace)::StmtChecker, void, swift::Stmt*, void, void, void,
void>::visit(swift::Stmt*) + 334
18 swift0x0001090f93d3 swift::ASTVisitor<(anonymous
namespace)::StmtChecker, void, swift::Stmt*, void, void, void,
void>::visit(swift::Stmt*) + 1763
19 swift0x0001090f8e3e swift::ASTVisitor<(anonymous
namespace)::StmtChecker, void, swift::Stmt*, void, void, void,
void>::visit(swift::Stmt*) + 334
20 swift0x0001090f81f9 (anonymous
namespace)::StmtChecker::typeCheckBody(swift::BraceStmt*&) + 25
21 swift0x0001090f74df
swift::TypeChecker::typeCheckFunctionBodyUntil(swift::FuncDecl*,
swift::SourceLoc) + 383
22 swift0x0001090f7303
swift::TypeChecker::typeCheckAbstractFunctionBodyUntil(swift::AbstractFunctionDecl*,
swift::SourceLoc) + 35
23 swift0x0001090f7e84
swift::TypeChecker::typeCheckAbstractFunctionBody(swift::AbstractFunctionDecl*)
+ 180
24 swift0x0001090b3116
typeCheckFunctionsAndExternalDecls(swift::TypeChecker&) + 166
25 swif