Git Product home page Git Product logo

Comments (8)

tgross35 avatar tgross35 commented on July 1, 2024

@rustbot label -needs-triage

from rust.

onur-ozkan avatar onur-ozkan commented on July 1, 2024

FWIW compiletest's lldb_python_dir is derived from the lldb -P command propagated from bootstrap.

from rust.

Rajveer100 avatar Rajveer100 commented on July 1, 2024

I think this should fix the issue:

PYTHONPATH=`/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python`

from rust.

tgross35 avatar tgross35 commented on July 1, 2024

FWIW compiletest's lldb_python_dir is derived from the lldb -P command propagated from bootstrap.

That indeed points to the homebrew version for me, any idea where python is getting launched? I wonder if it is getting invoked as /usr/bin/python3 rather than via path.

I think what may actually be a better solution here is to grab the output from lldb -P and use the python version specified - so try to execute python3.12 directly before falling back to python3.

$ lldb -P
3.12.2 (main, Feb  6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)]
/opt/homebrew/Cellar/llvm/17.0.6_1/libexec/python3.12/site-packages

I can dig into this a bit, just haven't had the chance to look yet.

I think this should fix the issue:

PYTHONPATH=`/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python`

That directory doesn't exist for me, I think it is only for the full xcode install but I only have CLI tools. However, setting PYTHONPATH doesn't seem to work at all - running PYTHONPATH=/opt/homebrew/bin/python3.12 ./x t tests/debuginfo still seems to load LLDB's module with 3.9.

from rust.

tgross35 avatar tgross35 commented on July 1, 2024

I think what may actually be a better solution here is to grab the output from lldb -P and use the python version specified - so try to execute python3.12 directly before falling back to python3.

Actually, this doesn't print the version when not in a TTY. I'm just going to ask on the LLVM forum what the best way to do this is.

from rust.

Rajveer100 avatar Rajveer100 commented on July 1, 2024

That directory doesn't exist for me, I think it is only for the full xcode install but I only have CLI tools. However, setting PYTHONPATH doesn't seem to work at all - running PYTHONPATH=/opt/homebrew/bin/python3.12 ./x t tests/debuginfo still seems to load LLDB's module with 3.9.

I think that's the problem...It's probably worth a try to download full Xcode and also check this:

xcode-select --install

After doing that, if the defaults still use HomeBrew, you can temporarily delete everything from HomeBrew (that's related to this issue) and reinstall after using the command (as that would probably make system one as default)...

from rust.

tgross35 avatar tgross35 commented on July 1, 2024
xcode-select --install

This is the command to install only CLI tools. Full xcode wouldn't make a difference in which paths get selected here.

After doing that, if the defaults still use HomeBrew, you can temporarily delete everything from HomeBrew (that's related to this issue) and reinstall after using the command (as that would probably make system one as default)...

The default executable choice comes from PATH anyway and that can be adjusted (I am able to get this to work by doing so), no need to delete anything from homebrew to try that out. But I'm trying to find a solution that applies to more than just me, since having mixed versions isn't uncommon.

The issue here seems to be that bootstrap is unintentionally making a bad executable choice somewhere, since it seems you can't assume anything about the LLDB python version. I do have /opt/homebrew/opt/llvm/bin which isn't a "necessity", but also not uncommon for anyone who uses LLVM tools like clang-tidy clang-format etc., and again it shouldn't really matter which versions are in PATH.

I asked if there is a way to get a better version requirement here https://discourse.llvm.org/t/how-do-you-get-the-python-version-required-for-lldb/78228. For reference, looks like we launch here https://github.com/rust-lang/rust/blob/master/src/tools/compiletest/src/runtest.rs#L1519-L1540.

from rust.

Rajveer100 avatar Rajveer100 commented on July 1, 2024

I am also putting the locations for my machine here for ref:

> which lldb
/usr/bin/lldb
> which python3
/opt/homebrew/bin/python3
> lldb -P
/Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Resources/Python

from rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.