Author Topic: Problems with rust projects & not finding cargo executable  (Read 1004 times)

rr0

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
Problems with rust projects & not finding cargo executable
« on: June 20, 2021, 10:01:22 PM »
Hi,

I'm using SlickEdit Pro 25.0.2.0 on MacOS 11.4 and am running into the same problem mentioned here (from December 2018) -- "slickedit says cargo executable not found"

https://community.slickedit.com/index.php/topic,16719.msg64605.html#msg64605

I followed the recommendations there without success.

Also, I tried Project -> Open Workspace directly on the Cargo.toml file (mentioned here: https://community.slickedit.com/index.php/topic,15996.msg61265.html), and it locks SlickEdit with a spinning beachball. I then need to "force quit" and restart the application.

I've had a license for years but am still relatively new with SlickEdit, so it might be something I'm doing wrong. Any suggestions will be appreciated, thanks for your help.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Problems with rust projects & not finding cargo executable
« Reply #1 on: June 21, 2021, 03:27:23 PM »
Interesting. I think I see why this is happening, and can fix it for the next 25.0.2 hotfix.  It looks like only New Projects for cargo have this problem, it's not using the value in the def-cargo-exe-path variable in one place.   So even if you set that variable, it wouldn't prevent that error from popping up.

Until a hotfix is published, the only workaround is to add the directory your cargo executable is in to the PATH environment variable, and restart SlickEdit.  The easiest way to do that is to start SlickEdit from a terminal like this, replacing "/path/to/cargo" with the directory cargo is in on your system: 
Code: [Select]
PATH=$PATH:/path/to/cargo /Applications/SlickEditPro2020.app/Contents/MacOS/vs +new &

You could also modify the PATH in your .bashrc/.zshrc so you don't need to set it in the command line, but you'd still need to start SlickEdit from a terminal that has the updated PATH.
 
For the problem with the lockup, I'm not sure what that could be yet.  When you open an existing toml, it shouldn't be doing anything I would have thought would lock up.  If you can still reproduce this, wait till it seems to be locked, and then press and hold Ctrl-Alt-Shift-S for a few seconds.  This should break the Slick-C interpreter, and give you a stack trace.  Post the stack trace if you get one. 
   

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Problems with rust projects & not finding cargo executable
« Reply #2 on: June 21, 2021, 06:19:16 PM »
I've created a fix for the cargo PATH problem, it will be in the next hotfix.

Also, I may have reproduced the hang when creating new or opening existing Rust projects while testing the fix.  I'm looking into it now, but I think if you close any open projects you have before creating/opening a Rust project, that will prevent you from running into the hang.  I'll update the thread for any fix for that as well.

rr0

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
Re: Problems with rust projects & not finding cargo executable
« Reply #3 on: June 22, 2021, 02:37:45 AM »
Hi Patrick, this is exciting news. Thanks for the awesome support, I appreciate it! I'll post a stack trace next time I run into that problem.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Problems with rust projects & not finding cargo executable
« Reply #4 on: June 23, 2021, 02:30:38 PM »
I've added a fix to the next hotfix for the hang as well.  It was difficult to trigger the bug regularly, but it was specific to the Rust project type, so I suspect it's what you ran into. 

If you do run into it again before the hotfix goes out, it's likely you won't be able to get stack traces out of it, so don't spend a lot of time on it.