# Cargo-raze warning message

**URL:** <https://forums.ankiweb.net/t/cargo-raze-warning-message/8280>\
**Category:** Development\
**Created:** [March 13, 2021, 8:10am UTC](https://forums.ankiweb.net/t/cargo-raze-warning-message/8280 "2021-03-13T08:10:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ArthurMilchior](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/arthurmilchior/32/4684_2.png) [@ArthurMilchior](https://forums.ankiweb.net/u/ArthurMilchior)\
**Post date:** [March 13, 2021, 8:10am UTC](https://forums.ankiweb.net/t/cargo-raze-warning-message/8280/1 "2021-03-13T08:10:20Z")

</div>

I tried to add a rust dependency  
`backtrace = "0.3"`

As indicated I tried to use update.py. I went to cargo and run python3 update.py

I get

> python3 update.py  
> Updating [crates.io](http://crates.io) index  
> Updating git repository `https://github.com/ankitects/reqwest.git`  
> Updating git repository `https://github.com/ankitects/hyper-timeout.git`  
> Updating git repository `https://github.com/ankitects/tokio-io-timeout.git`  
> Traceback (most recent call last):  
> File “update.py”, line 127, in   
> run\_cargo\_raze()  
> File “update.py”, line 41, in run\_cargo\_raze  
> subprocess.run([“cargo-raze”], cwd=“…”, check=True)  
> File “/usr/lib/python3.8/subprocess.py”, line 489, in run  
> with Popen(\*popenargs, \*\*kwargs) as process:  
> File “/usr/lib/python3.8/subprocess.py”, line 854, in **init**  
> self.\_execute\_child(args, executable, preexec\_fn, close\_fds,  
> File “/usr/lib/python3.8/subprocess.py”, line 1702, in \_execute\_child  
> raise child\_exception\_type(errno\_num, err\_msg, err\_filename)  
> FileNotFoundError: [Errno 2] No such file or directory: ‘cargo-raze’

What can I do to try to add dependencies?

If I just try to run test now, I get an error message because related to backtrace

The goal would be to get backtrace in error message. Becasue right now, it’s hard to understand error message since the backtrace only show the python part

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [March 15, 2021, 12:50am UTC](https://forums.ankiweb.net/t/cargo-raze-warning-message/8280/2 "2021-03-15T00:50:43Z")

</div>

Did you install cargo-raze as mentioned in the readme?

That said, I don’t really recommend this path. Backtraces are not available in release builds, and are expensive to generate on Macs. In many cases the code that returns an error should be fairly obvious when following the code flow, and when that’s not the case, we should update the code to return a more specific error, or attach some context.

---

<div class="post-metadata">

**Author:** ![ArthurMilchior](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/arthurmilchior/32/4684_2.png) [@ArthurMilchior](https://forums.ankiweb.net/u/ArthurMilchior)\
**Post date:** [March 15, 2021, 1:25am UTC](https://forums.ankiweb.net/t/cargo-raze-warning-message/8280/3 "2021-03-15T01:25:04Z")

</div>

I’ve not re read the readme recently no.

I do understand there is very good reason not to deploy this in every day anki. However, I do believe that keeping it as an extra branch to use when debugging could be really useful. At least for the rust PR I made a few days ago, and more generally when I update add-ons and try to figure out which rust hypothesis I did not respect.

I’ve not yet understood how to understand the code flow in rust honestly. Probably I should figure out how to use a proper IDE for rust and that may be a better solution. But I often loose time figuring out where a function called by python is defined (using grep usually), and, more complex, where the methods called in rust are defined. My current understanding is that sometime the method of a type T is not defined in the same file as T, which makes finding it slightly complex.  
(To be clear, Anki was my only reason to look at rust, so I’m not at ease yet)

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [March 15, 2021, 2:07am UTC](https://forums.ankiweb.net/t/cargo-raze-warning-message/8280/4 "2021-03-15T02:07:35Z")

</div>

development.md briefly describes how to set up VS Code to work with Rust. I recommend you spend a bit of time doing that, as you can then use code navigation features like clicking on a function to jump to its definition.

If you just want to figure out the call tree of a particular inner function in development, throw a panic!() in it and run with RUST\_BACKTRACE=1

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 1, 2023, 3:19am UTC](https://forums.ankiweb.net/t/cargo-raze-warning-message/8280/5 "2023-05-01T03:19:21Z")

</div>

Closed on May 1, 2023, 3:19am UTC


