question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add doctor command to diagnose common problems and print information for further debug

See original GitHub issue

Having more than an instance of scala-cli on PATH creates problems with updates, since an old version might appear sooner on PATH and get executed instead of the newer version!

How should it work:

The user runs scala-cli doctor

Then, if there are any duplicates on PATH it gets reported to the user!

One implementation strategy is

  • first seeing if type -ap scala-cli shows duplicates;
  • then if so, we run ls -l on the result to make sure they are not all symlinks to the same location.
  • Then if they were not symlinks, we cat the contents of them to see if they run the same script. (this is tricky)
  • Now if they weren’t scripts executing the same thing, we produce a PATH duplicates error

Alternatively, this information can be provided by running the update, about, or version commands.

The team decided that the PATH duplicate part of issue #543 should be dealt with as an independent separate issue. It is also related to issue #670

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:19 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
mtkcommented, Mar 21, 2022

re: coursier - i get your point. strategically, i think it should be delivered by coursier, though. if you’re going to pay the climbing-the-learning-curve price for only one tool (e.g. as a student in a class), installing coursier manually gets you more for your money. chris kipp asked me to open a coursier issue requesting that scala-cli move out from under “install --contrib” to just “install”. haven’t done it yet but i will.

re: doctor - that’s a great list of things to-do. speaking only for myself, that won’t fit into two hours. for some reason i didn’t see your post until today. however, i’d be happy to work on this well after the spree ends.

2reactions
SethTisuecommented, Mar 1, 2022

Let’s call it doctor, in imitation of Homebrew (and also Metals, according to @romanowski).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging - DynamoRIO
Use debug builds (pass "-debug" to drrun) with notifications turned on to diagnose errors. In general, it is much easier to debug with...
Read more >
[Learning note] Troubleshooting and Debugging Techniques
Q: A very common method of debugging is to add print statements to our code that display information, such as contents of variables,...
Read more >
21. Error Handling and Debugging - Practical mod_perl [Book]
Chapter 21. Error Handling and Debugging Every programmer needs to know how to debug his programs. It is an easy task with plain...
Read more >
Java HotSpot VM Command-Line Options - Oracle Help Center
This appendix describes some command-line options that can be useful when diagnosing problems with the Java HotSpot VM.
Read more >
Cisco IOS Debug Command Reference - Commands I through L
To troubleshoot HTTP authentication problems, use the debug ip http authentication command in privileged EXEC mode. To disable debugging output, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found