Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

educate Linux LLDB how to find the resource dir #36

Merged
merged 1 commit into from
Jul 21, 2016
Merged

educate Linux LLDB how to find the resource dir #36

merged 1 commit into from
Jul 21, 2016

Conversation

tfiala
Copy link
Contributor

@tfiala tfiala commented Jul 21, 2016

Non-Apple platforms would fail to find the Swift resource dir when
running LLDB from the build dir. This issue was not present when
running LLDB from the install dir.

This change makes one more fallback attempt to synthesize the
Swift resource dir by doing what would be a valid regex-based
manipulation of the LLDB lib path for a build-script-driven
style build. That style build is the prevailing build style for
everywhere except for the Xcode-driven LLDB build.

This change also restores running the LLDB Swift REPL tests
on Linux that run from the build layout.

Fixes:
bugs.swift.org/SR-1300
bugs.swift.org/SR-2136

Non-Apple platforms would fail to find the Swift resource dir when
running LLDB from the build dir.  This issue was not present when
running LLDB from the install dir.

This change makes one more fallback attempt to synthesize the
Swift resource dir by doing what would be a valid regex-based
manipulation of the LLDB lib path for a build-script-driven
style build.  That style build is the prevailing build style for
everywhere except for the Xcode-driven LLDB build.

This change also restores running the LLDB Swift REPL tests
on Linux that run from the build layout.

Fixes:
bugs.swift.org/SR-1300
bugs.swift.org/SR-2136
@tfiala
Copy link
Contributor Author

tfiala commented Jul 21, 2016

@swift-ci Please test

@tfiala
Copy link
Contributor Author

tfiala commented Jul 21, 2016

This change also adds a ton more logging on the '(lldb) enable lldb types' log channel regarding the process that searches for the Swift resource dir.

@tfiala
Copy link
Contributor Author

tfiala commented Jul 21, 2016

Our master-next LLDB PR tester bot looks totally busted. That build didn't even do the build phase.

I'll need to get with Mishal on that when he's back.

Given that, I'm going to merge this into master-next and watch the bots there.

@tfiala tfiala merged commit 7e7b778 into apple:master-next Jul 21, 2016
@tfiala tfiala deleted the fix-linux-resource-dir branch July 21, 2016 19:36
@tfiala
Copy link
Contributor Author

tfiala commented Jul 21, 2016

The solution here worked fine for Ubuntu 15.10 and Ubuntu 16.04; however, it looks like a potentially busted C++ stdlib and or compiler on Ubuntu 14.04 wasn't finding/evaluating the call to std::regex_replace() using the const char* variant. I don't know if that variant --- which the docs claim is in C++11 --- is just missing in the C++ stdlib on Ubuntu 14.04 or if the template selection logic is faulty. But in any event, the template signature it tried to match against was the std::string variant.

I just committed a change which forces the use of the std::string variant, which hopefully fixes the Ubuntu 14.04 issue (which I'll know shortly).

Once that clears, I'll be taking this change into swift-lldb/master and the current Swift-3 preview branch.

@tfiala
Copy link
Contributor Author

tfiala commented Jul 21, 2016

Okay that wasn't good enough. It builds now, but on Ubuntu 14.04 x86_64 the std::regex engine is throwing a regex exception where Ubuntu 15.10 and 16.04 are not. Grrr, this is supposed to be a standard library with consistent results...

So it looks like I may end up manually implementing the little bit I need to parse because Ubuntu 14.04's C++ stdlib can't do regex replace and replace this code here.

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

Successfully merging this pull request may close these issues.

1 participant