Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Jul 8, 2024

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

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

Sure thing! Will do that when I get home.

@Icy-Thought
Copy link

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

@CeleritasCelery CeleritasCelery merged commit c189352 into main Jul 8, 2024
4 checks passed
@CeleritasCelery CeleritasCelery deleted the babel branch July 8, 2024 21:06
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