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

Babel: Toolchain support via :toolchain #279

Merged
merged 4 commits into from
Oct 12, 2021

Conversation

fosskers
Copy link
Contributor

@fosskers fosskers commented Oct 4, 2021

This PR allows the user to specify the toolchain via a new :toolchain keyword when writing Org snippets.

Note: This PR was built off #278, so that should be merged first.

Closes #277

This allows one to specify `'(foo . "path/to/dependency")` so that Cargo
will look locally for the dependency, instead of pulling from crates.io.
This is very useful for testing local Rust code in Org snippets.
This allows the user to use the Beta or Nightly toolchains in snippets.
@fosskers fosskers changed the title Babel: Toolchain support via :nightly Babel: Toolchain support via :toolchain Oct 4, 2021
@brotzeit
Copy link
Owner

I ran the tests manually(there seem to be some issues with cask again). Sorry for the delay and thanks for the contribution!

@brotzeit brotzeit merged commit 80d05c4 into brotzeit:master Oct 12, 2021
@fosskers fosskers deleted the colin/nightly branch October 12, 2021 16:19
Comment on lines -57 to +59
(params '("cargo" "build" "--quiet"))
(toolchain (cond ((eq toolchain-kw 'nightly) "+nightly")
((eq toolchain-kw 'beta) "+beta")
(t "+stable")))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only allows nightly/beta/stable channels by keyword.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As opposed to?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see the issue. We could expand the accepted format of toolchain-kw to allow for more free-form strings, and pass those as-is (or parse them?) down to the cargo line.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does d71fbf5 work for you ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should do the trick.

@yuuyins
Copy link

yuuyins commented Dec 3, 2022

how to disable this? i didn't install rust tools with rustup; i use my systems' package manager. setting rustic-babel-default-toolchain to nil won't work.

error: no such subcommand: `+stable`
error: no such subcommand: `+nil`

@fosskers
Copy link
Contributor Author

fosskers commented Dec 5, 2022

That use-case never occurred to me so I wasn't aware that +stable, etc., wouldn't be accepted. I suppose this should be considered a bug.

yuuyins added a commit to yuuyins/rustic that referenced this pull request Feb 13, 2023
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 rescpective functions in `rustic-babel' will remove the toolchain from
params, that is only toolchain has a valid value it uses toolchain.

See also: brotzeit#279 (comment)
yuuyins added a commit to yuuyins/rustic that referenced this pull request Feb 13, 2023
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 rescpective functions in `rustic-babel' will remove the toolchain from
params, that is only toolchain has a valid value it uses toolchain.

See also: brotzeit#279 (comment)
yuuyins added a commit to yuuyins/rustic that referenced this pull request Apr 22, 2023
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#279 (comment)

Fixes brotzeit#498 introduced in 80d05c4

Co-authored-by: Sibi Prabakaran <[email protected]>
yuuyins added a commit to yuuyins/rustic that referenced this pull request May 22, 2023
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#279 (comment)

Fixes brotzeit#498 introduced in 80d05c4

Co-authored-by: Sibi Prabakaran <[email protected]>
CeleritasCelery pushed a commit to emacs-rustic/rustic that referenced this pull request May 17, 2024
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 <[email protected]>
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.

Specifying toolchain in org-babel snippets
4 participants