PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, August 20, 2022

[FIXED] How to pass RUST_BACKTRACE=1 when running a Rust binary installed in Debian?

 August 20, 2022     backtrace, debian, environment-variables, rust, rust-cargo     No comments   

Issue

When I run a binary using cargo, I have the option to run it as follows -

bash -c "RUST_BACKTRACE=1 cargo run --bin my_binary"

This gives me a stack trace when the binary hits an error. But when I create a Debian package for the same binary, how do I get stack traces on failure?

Is there some way to enable backtrace there too, if the source is implemented in Rust?

Edit:

I create a debian package for my cargo project using

cargo deb // Produces a my_binary.deb

This my_binary.deb can then be installed on a Debian machine as -

 dpkg -i /tmp/my_binary*.deb || true \
 && apt-get -f -y install

Solution

I had the same issue (error message) on Linux Mint 19 after installation of alacritty (0.5.0-dev).

In terminal just run:

RUST_BACKTRACE=1RUST_BACKTRACE=1 alacritty 

or RUST_BACKTRACE=full for a verbose backtrace.

RUST_BACKTRACE=1RUST_BACKTRACE=full alacritty 


Answered By - Alex.K.
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing