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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(null-ls): specify rustfmt manually #852

Merged
merged 3 commits into from
Jul 10, 2023
Merged

fix(null-ls): specify rustfmt manually #852

merged 3 commits into from
Jul 10, 2023

Conversation

Jint-lzxy
Copy link
Collaborator

@Jint-lzxy Jint-lzxy commented Jul 10, 2023

Haven't introduced rustup into the install script(s) yet cause I can't figure out how to automate this process 馃槩

@CharlesChiuGit
Copy link
Collaborator

https://github.com/CharlesChiuGit/dotfiles/blob/main/install_scripts/langs/rust.sh

maybe this would help

@Jint-lzxy
Copy link
Collaborator Author

Thanks for the script! But the problem is we probably need to avoid installing multiple versions of Rust in parallel - so things become much more complex here, as Rust is distributed in multiple ways:

  • Self-hosted distribution (some package managers e.g., brew): the package manager manages version control, rustfmt must be installed via cargo, but this has been deprecated; Besides, Rust is usually NOT installed on a standard path (aka ~/.cargo).
  • The "legacy" official installer: Similar to the official installer, except that rustup won't be installed (by default); rustfmt must be installed via cargo, or via rustup but rustup itself must be installed first.
  • The official installer, or the rustup[-init] package provided by many package mgrs: The recommended approach.

So if we decide to automate this process, the following should be considered:

  • How to cleanup legacy installation(s)? This seems to be far beyond the scope that the install script can handle;
  • How to execute rustup-init? (e.g., on MS Windows) Spawning a child process (the GUI version!) will bring many uncertainties to the install script, as its operation is independent of the terminal. Hence to cover these cases the install script can be much more cumbersome - an unworthy trade-off, IMO.

@CharlesChiuGit
Copy link
Collaborator

CharlesChiuGit commented Jul 10, 2023

aha, I didn't thought about those details, indeed this is important.
But due to it's complexity, I think it's better not to include it in the installation script.
Just put it in prerequisites should be fine IMO.

@Jint-lzxy
Copy link
Collaborator Author

IMO then we can just put a hint here, just like the sqlite one:

info -Msg "Spawning Neovim and fetching plugins... (You'll be redirected shortly)"
info -Msg 'To make sqlite work with lua, manually grab the dlls from "https://www.sqlite.org/download.html" and'
info_ext -Msg 'replace vim.g.sqlite_clib_path with your path at the bottom of `lua/core/options.lua`'
info -Msg 'If lazy.nvim failed to fetch any plugin(s), maunally execute `:Lazy sync` until everything is up-to-date.'

@CharlesChiuGit
Copy link
Collaborator

that would do too. upvote for this

@Jint-lzxy
Copy link
Collaborator Author

Done :D 98e0678

Windows *nix
pwsh zsh

Copy link
Collaborator

@CharlesChiuGit CharlesChiuGit left a comment

Choose a reason for hiding this comment

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

LGTM

@Jint-lzxy Jint-lzxy merged commit 99bc229 into main Jul 10, 2023
4 checks passed
@Jint-lzxy Jint-lzxy deleted the fix/rustfmt branch July 10, 2023 15:07
singlemancombat pushed a commit to singlemancombat/nvim-config that referenced this pull request Jul 10, 2023
* fix(null-ls): specify `rustfmt` manually

* feat(scripts): add notes regarding `rustup`

* fixup! feat(scripts): add notes regarding `rustup`
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.

None yet

2 participants