Skip to content

Commit 1c1e274

Browse files
authored
Rollup merge of rust-lang#61827 - golddranks:lldb_fix, r=nikomatsakis
Fix rust-lldb wrapper scripts. Currently the `rust-lldb` wrapper provided by Rust project is broken. The error messages it produces on launch are as follows: ``` warning: ignoring unknown option: --one-line-before-file=command script import "/Users/kon/.rustup/toolchains/nightly-2019-05-02-x86_64-apple-darwin/lib/rustlib/etc/lldb_rust_formatters.py" warning: ignoring unknown option: --one-line-before-file=type summary add --no-value --python-function lldb_rust_formatters.print_val -x ".*" --category Rust warning: ignoring unknown option: --one-line-before-file=type category enable Rust (lldb) target create "target/debug/nagare" Traceback (most recent call last): File "<string>", line 1, in <module> File "/Users/kon/.rustup/toolchains/nightly-2019-05-02-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/python2.7/site-packages/lldb/__init__.py", line 1481, in <module> class SBAddress(object): File "/Users/kon/.rustup/toolchains/nightly-2019-05-02-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/python2.7/site-packages/lldb/__init__.py", line 1647, in SBAddress __swig_getmethods__["module"] = GetModule NameError: name '__swig_getmethods__' is not defined Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'run_one_line' is not defined Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'run_one_line' is not defined Traceback (most recent call last): File "<string>", line 1, in <module> NameError: name 'run_one_line' is not defined ...etc. ``` The errors stem from two regressions: one caused by an LLVM upgrade and one caused by unintended upgrade to SWIG 4.0 (SWIG is a wrapper generator that is used to generate Python bindings for LLVM and LLDB.) (Edit: found the exact dates) The SWIG breakage happened because of a Homebrew version upgrade on `nightly-2019-05-01-x86_64-apple-darwin` and the LLVM breakage happened on `nightly-2019-01-27-x86_64-apple-darwin` (likely to have been caused by rust-lang#57675 ). The fix is to update the LLVM parameter syntax and to "downgrade" to SWIG 3.0.x. SWIG 3.0.x is not going to be supported by Homebrew forever, but should be good for now, until LLDB upgrades to support SWIG 4.0.0. Here's some more info about Homebrew support: Homebrew/homebrew-core#39929 & Homebrew/homebrew-core#40882 I'm going to send a bug & fix to LLDB about SWIG 4.0.0 to get the situation fixed in the future. It would be good to also backport this to beta, since it's such a small change, and will fix an obvious regression.
2 parents 04be402 + 267bf7b commit 1c1e274

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.azure-pipelines/steps/run.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ steps:
3737
set -e
3838
brew update
3939
brew install xz
40-
brew install swig
40+
brew install swig@3
4141
displayName: Install build dependencies (OSX)
4242
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'), eq(variables['SCRIPT'],'./x.py dist'))
4343

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ install:
263263
if [[ "$SCRIPT" == "./x.py dist" ]]; then
264264
travis_retry brew update &&
265265
travis_retry brew install xz &&
266-
travis_retry brew install swig;
266+
travis_retry brew install swig@3;
267267
fi &&
268268
travis_retry curl -fo /usr/local/bin/sccache https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-02-sccache-x86_64-apple-darwin &&
269269
chmod +x /usr/local/bin/sccache &&

src/etc/rust-lldb

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ category_definition="type summary add --no-value --python-function lldb_rust_for
3131
category_enable="type category enable Rust"
3232

3333
# Call LLDB with the commands added to the argument list
34-
exec "$lldb" --one-line-before-file="$script_import" \
35-
--one-line-before-file="$category_definition" \
36-
--one-line-before-file="$category_enable" \
34+
exec "$lldb" --one-line-before-file "$script_import" \
35+
--one-line-before-file "$category_definition" \
36+
--one-line-before-file "$category_enable" \
3737
"$@"

0 commit comments

Comments
 (0)