Skip to content

fix(rustic-babel): disable toolchain when invalid/unneeded#3

Merged
CeleritasCelery merged 3 commits intomainfrom
babel
Jul 8, 2024
Merged

fix(rustic-babel): disable toolchain when invalid/unneeded#3
CeleritasCelery merged 3 commits intomainfrom
babel

Conversation

@CeleritasCelery
Copy link
Contributor

@CeleritasCelery CeleritasCelery commented May 15, 2024

Description by @yuuyins from brotzeit/rustic#499 :
When the user installs Rust tools using a method other than rustup, e.g. using an operating system's package manager, cargo generally has no support for toolchain specification. In such case, the user can then nil, or "", so that the respective functions in rustic-babel will remove the toolchain from params, i.e. only toolchain has a valid value if Cargo has toolchain support.

See also: brotzeit/rustic#279 (comment)

Fixes brotzeit/rustic#498 introduced in 80d05c4

When the user installs Rust tools using a method other than rustup, e.g. using
an operating system's package manager, cargo generally has no support for
toolchain specification. In such case, the user can then `nil', or `""', so that
the respective functions in `rustic-babel' will remove the toolchain from
params, i.e. only toolchain has a valid value if Cargo has toolchain support.

See also: brotzeit/rustic#279 (comment)

Fixes #498 introduced in 80d05c4

Co-authored-by: Sibi Prabakaran <sibi@psibi.in>
@Icy-Thought
Copy link
Contributor

If you need someone with Nix installed to test anything, just ping me!
Thanks for the PR!

We are setting the default to `nil`, which means use the default provided by
cargo and don't specify it explicitly. If overridden with a string value, that
will be used instead and passed as +<toolchain>.
@CeleritasCelery
Copy link
Contributor Author

@Icy-Thought could you please test these changes now on Nix?

@Icy-Thought
Copy link
Contributor

Sure thing! Will do that when I get home.

@Icy-Thought
Copy link
Contributor

Alright, I just tested the changes and they appear to be working exactly as intended! No errors and the results from #+begin_src rustic are generated properly!

Example:

#+begin_src rustic :exports both :tangle "shadowing.rs"
fn main() {
   let x = 2;
   let x = x + 2;

   println!("The value of x is {}", x)
}
#+end_src

generates/outputs the following results:

#+RESULTS:
: The value of x is 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Nix] Error: no such command: +stable...

3 participants