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

[SR-39] Unable to start REPL on Linux #42662

Closed
swift-ci opened this issue Dec 4, 2015 · 15 comments
Closed

[SR-39] Unable to start REPL on Linux #42662

swift-ci opened this issue Dec 4, 2015 · 15 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Dec 4, 2015

Previous ID SR-39
Radar None
Original Reporter nitingupta (JIRA User)
Type Bug
Status Closed
Resolution Done
Environment

Linux x86_64:

  • Ubuntu 15.10

  • Fedora 23

Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee nitingupta (JIRA)
Priority Medium

md5: fd86c22c281bf15d4abce7ab7c984033

Issue Description:

I build swift from source on both Ubuntu 15.10 and Fedora 23 with:
utils/build-script -R
to get a release build.

But when I try to start REPL from build directory I'm getting following error (on both Linux flavors):

LLVM ERROR: Compiler-internal integrated REPL unimplemented for this platform

However I can run ./swiftc without errors.

Output of tests run with 'build-scripts -R -t':

Testing Time: 46.07s
Expected Passes : 1667
Expected Failures : 92
Unsupported Tests : 573

    • check-swift-linux-x86_64 finished --

      • Finished tests for swift ---
@gribozavr
Copy link
Collaborator

To run the REPL, the 'swift' and 'lldb' binaries need to be next to each other. This is not the case in the build tree. Either create a symlink, or build the package using 'build-script --preset=buildbot_linux_1404 installable_package=/tmp/swift.tar.gz install_destdir=/tmp/swift-install', and try again from the package.

@octoploid
Copy link
Mannequin

octoploid mannequin commented Dec 4, 2015

I initially had the same issue initially.
But if you run "lldb/scripts/build-swift-cmake.py --release --update",
it will install everything to ./install/usr/bin and the error goes away.

I think this should be documented more prominently.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Dec 4, 2015

Comment by Nitin Gupta (JIRA)

(tested on Fedora 23 x86_64):

Dmitri:
'build-script --preset=buildbot_linux_1404 installable_package=/tmp/swift.tar.gz install_destdir=/tmp/swift-install' terminates with following error:

Foundation/NSArray.swift:347:13: error: invalid character in source file
guard idx < count && idx >= 0 else {
Foundation/NSArray.swift:347:15: error: invalid character in source file
guard idx < count && idx >= 0 else {
Foundation/NSArray.swift:347:17: error: invalid character in source file
guard idx < count && idx >= 0 else {
Foundation/NSArray.swift:347:19: error: invalid character in source file
guard idx < count && idx >= 0 else {
Foundation/NSArray.swift:348:13: error: invalid character in source file
fatalError("(self): Index out of bounds")
Foundation/NSArray.swift:348:15: error: invalid character in source file
fatalError("(self): Index out of bounds")

octopid:
'lldb/scripts/build-swift-cmake.py --release --update' gives:

+ /usr/bin/cmake --build /scratch/src/swift/build/Ninja-ReleaseAssert/swift-linux-x86_64 – install
ninja: error: unknown target 'install'

However lldb did get created which I symlinked along with swift binary (as suggest by Dmitry) and the swift REPL works now. Still would have like a single clean build command.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Dec 4, 2015

Comment by Nitin Gupta (JIRA)

I also had to apply this patch to REPL.cpp:
https://gist.github.com/aktowns/2adf0f252c97d140c766

@gribozavr
Copy link
Collaborator

For the Foundation issue, please run `utils/update-checkout -a` and rebuild. I fixed the issue in apple/swift-corelibs-foundation@7d77b31

For the REPL.cpp patch, please propose it as a pull request. Thank you!

@octoploid
Copy link
Mannequin

octoploid mannequin commented Dec 4, 2015

The REPL.cpp patch isn't necessary when you use the default swift-lldb based REPL.

@gribozavr
Copy link
Collaborator

It isn't, but we still would like to get the integrated REPL working, it is useful for engineers working on the compiler and standard library.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Dec 4, 2015

Comment by Nitin Gupta (JIRA)

checked out the latest sources and tried building again with Dmitri's method and now I get this:

CMake Error at scripts/cmake_install.cmake:36 (file):
file INSTALL cannot find
"/scratch/src/swift/build/buildbot_linux/lldb-linux-x86_64/lib/python2.7".
Call Stack (most recent call first):
cmake_install.cmake:42 (include)

FAILED: cd /scratch/src/swift/build/buildbot_linux/lldb-linux-x86_64 && /usr/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.
utils/build-script: command terminated with a non-zero exit status 1, aborting
utils/build-script: command terminated with a non-zero exit status 1, aborting

@octoploid
Copy link
Mannequin

octoploid mannequin commented Dec 4, 2015

I had the same issue first. Just adjust the path. The correct path is:

/scratch/src/swift/build/buildbot_linux/lldb-linux-x86_64/lib64/python2.7

@swift-ci
Copy link
Collaborator Author

swift-ci commented Dec 4, 2015

Comment by Nitin Gupta (JIRA)

Markus: now it goes a bit further but then bails out with this error:

      • Creating installable package ---
    • Package file: /tmp/swift.tar.gz --
      /tmp/swift_package_sandbox /scratch/src/swift/swift
      /scratch/src/swift/swift

      • cd /scratch/src/swift/swift-package-tests
        /scratch/src/swift/swift/utils/build-script-impl: line 2238: cd: /scratch/src/swift/swift-package-tests: No such file or directory
        utils/build-script: command terminated with a non-zero exit status 1, aborting
        utils/build-script: command terminated with a non-zero exit status 1, aborting

@gribozavr
Copy link
Collaborator

I see. Unfortunately, the package preset depends on the swift-package-tests directory, which is currently missing from the repository. As a temporary workaround, please disable those tests by commenting out "test-installable-package=1" from utils/build-presets.ini. This will allow build-script to exit with success.

I actually think the package file should have been created, could you check?

@swift-ci
Copy link
Collaborator Author

swift-ci commented Dec 4, 2015

Comment by Nitin Gupta (JIRA)

Yes swift.tar.gz was created and I have now disable tests on installable package as you suggested. However, I pulled all repos and now I see swift.tar.gz did not get updated. Looking at the logs, I see that the build now fails on this test:
{{
FAIL: Swift :: stdlib/StringSlicesConcurrentAppend.swift (7003 of 7257)
> ******************** TEST 'Swift :: stdlib/StringSlicesConcurrentAppend.swift' FAILED ********************
Script:

rm -rf /scratch/src/swift/build/buildbot_linux/swift-linux-x86_64/validation-test-linux-x86_64/stdlib/Output/StringSlicesConcurrentAppend.swift.tmp && mkdir -p /scratch/src/swift/build/buildbot_linux/swift-linux-x86_64/validation-test-linux-x86_64/stdlib/Output/StringSlicesConcurrentAppend.swift.tmp && /scratch/src/swift/build/buildbot_linux/swift-linux-x86_64/bin/swiftc -target x86_64-unknown-linux-gnu -module-cache-path '/tmp/swift-testsuite-clang-module-cache7RtjVi' -module-cache-path '/tmp/swift-testsuite-clang-module-cache7RtjVi' /scratch/src/swift/swift/validation-test/stdlib/StringSlicesConcurrentAppend.swift -o /scratch/src/swift/build/buildbot_linux/swift-linux-x86_64/validation-test-linux-x86_64/stdlib/Output/StringSlicesConcurrentAppend.swift.tmp/a.out -module-name main && /scratch/src/swift/build/buildbot_linux/swift-linux-x86_64/validation-test-linux-x86_64/stdlib/Output/StringSlicesConcurrentAppend.swift.tmp/a.out

Exit Code: 1

Command Output (stderr):

/scratch/src/swift/swift/validation-test/stdlib/StringSlicesConcurrentAppend.swift:37:7: warning: variable 'ret' was never mutated; consider changing to 'let' constant
var ret = _stdlib_pthread_barrier_wait(barrierVar)
~~~ ^
let
/scratch/src/swift/swift/validation-test/stdlib/StringSlicesConcurrentAppend.swift:69:16: error: type of expression is ambiguous without more context
if tid == .Master {
^~~~~

--

********************
Testing Time: 182.27s
********************
Failing Tests (1):
Swift :: stdlib/StringSlicesConcurrentAppend.swift

Expected Passes : 6540
Expected Failures : 102
Unsupported Tests : 614
Unexpected Failures: 1

      • Failed while running tests for swift (check-swift-all-linux-x86_64)
        utils/build-script: command terminated with a non-zero exit status 1, aborting
        utils/build-script: command terminated with a non-zero exit status 1, aborting

}}

@swift-ci
Copy link
Collaborator Author

swift-ci commented Dec 4, 2015

Comment by Nitin Gupta (JIRA)

I now tried building with buildbot_linux_1510 preset on Ubuntu 15.10 and everything works fine. I will retry on Fedora 23 later.

Thanks for all the replies. Closing the issue.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Dec 5, 2015

Comment by Nitin Gupta (JIRA)

I had the same issue first. Just adjust the path. The correct path is:
/scratch/src/swift/build/buildbot_linux/lldb-linux-x86_64/lib64/python2.7

Markus,

By any chance would you know a permanent fix for this? This extra step of modifying an auto generated file during build is stopping me from getting automated builds on Fedora 23. This problem does not exist on Ubuntu 15.10 but that's not what I usually use.

Thanks.

@octoploid
Copy link
Mannequin

octoploid mannequin commented Dec 5, 2015

Nitin,

This is a very old lldb issue. I think it was there from the start...

(I never bothered to report it. But the right thing to do would be to open a new bug on the llvm bugzilla.)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

2 participants