-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
fix: remove python usage in macOS cli wrapper #138582
Conversation
Pending build for verification https://monacotools.visualstudio.com/Monaco/_build/results?buildId=145742&view=results |
@deepak1556 What are your thoughts on #137954 ? |
Thanks for the pointer! I agree with the sentiment in that issue, if there is a simpler non-python way to get the absolute path it would also make this script more resilient. But I have to try it out, to confirm if it covers all cases. Let me try to adjust this PR in that front. |
Hi there! Is there an ETA on this? This would help us with a related issue folks have been hitting on Docker Desktop so appreciate the work on it. |
I don't know the history well enough, but I wonder if we can just drop the dependency on python at all. 🤔 What does if [[ "$OSTYPE" == "darwin"* ]]; then
realpath() { [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"; }
ROOT=$(dirname "$(dirname "$(realpath "$0")")")
else It also seems that Apple doesn't install Python 3 by default in Monterey 12.3. See eg. https://twitter.com/manomarks/status/1486845980527894538?s=21 🤔 |
9a4da49
to
dc25e46
Compare
It does try to achieve the same effect but that won't work for symlink cases, |
dc25e46
to
e9af584
Compare
Change works fine, tested with https://monacotools.visualstudio.com/Monaco/_build/results?buildId=152892&view=results @joaomoreno PTAL, thanks! |
This PR does not handle multiple installation cases for the same bundle identifier, I am sure if there is a wide use case for it. |
Yeah you make a good point. I'm guessing |
I think we can make a safe fallback case with e9af584 if there are multiple results from
thoughts ? |
I don't really know. All I know is we went with Python because no matter how hard I tried, I couldn't find a pure shell solution that worked across shells/macOS versions, at the time. If you have confidence in the fallback logic and are up for taking the theoretical issue stream that might arise from it, then I approve 👌 |
You are right, I found myself in the same path when writing this PR. But given the python2 deprecation makes our cli completely useless on macOS monterey for many users, I will go ahead and try this #138582 (comment), will see if I can improve it later based on user feedback. |
I'm not sure that using I recommend using one of the |
a6bc470
to
2c14bd4
Compare
The pure bash approach seems like the way to go from my perspective. Since there's a bash shebang it should be guaranteed that the script will run under bash, you just need to make sure you support the lowest expected version of bash shipped in macOS. I'm not the best with bash scripts so my review of the actual scripts probably wouldn't be too useful. |
2c14bd4
to
530dae6
Compare
Verified locally, merging for insiders testing. |
related: microsoft/vscode-remote-release#6442 |
Thanks for addressing it @aeschli !! |
Fixes #134635
Fixes #137954