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

Self-contained installation #1919

Closed
mo8it opened this issue Mar 26, 2024 · 5 comments · Fixed by #1931
Closed

Self-contained installation #1919

mo8it opened this issue Mar 26, 2024 · 5 comments · Fixed by #1931
Assignees
Milestone

Comments

@mo8it
Copy link
Contributor

mo8it commented Mar 26, 2024

I was thinking about the possibility of installing Rustlings without the installation scripts that are piped into a shell. Wouldn't it be nice if we could just offer cargo install rustlings?

Why?

  • No piping of a script from the internet into a shell. This is often perceived as a security threat. Yes, the script is tiny and can be read, but avoiding it altogether would not scare anyone off.
  • No requirement on git
  • No requirement on Python
  • No shell scripts to maintain
  • One installation method for all platforms (currently, there is a separate script for Windows)
  • Less to download (no cloning of the whole repository)
  • No need to look for the latest git tag during installation
  • Make beginners familiar with cargo install
  • Reduce the confusion with files not related to the exercises (I observed this during my course).
  • Reduce the countless PRs of people submitting their solutions by mistake.

How?

My suggestion is to include the exercises in the binary using something like include_bytes! on the whole exercises directory. Then, the directory is extracted to the filesystem on first run. Something similar to this. This initialization would also automatically generate the rust-project.json file for Rust-Analyzer. So the lsp command would be eliminated and users don't forget to run it.

Many of the students in my course forgot to run the lsp command and got no language server support until I noticed it.

Changes

Resetting an exercise would not be done using git stash push -- EXERCISE anymore. The exercise would be completely nuked and replaced by the original file in the binary.

crates.io

Currently, rustlings is taken on crates.io… But we can try to contact the author.


@shadows-withal what do you think? I would take care of the implementation. That would be version 6.0

@mo8it
Copy link
Contributor Author

mo8it commented Mar 27, 2024

I found another positive effect in case we go in this direction: #293 (comment)

@mo8it mo8it self-assigned this Mar 30, 2024
@mo8it mo8it added this to the v6 milestone Mar 30, 2024
@mo8it mo8it changed the title Installation with Cargo Self-contained installation Mar 30, 2024
@mo8it mo8it linked a pull request Mar 30, 2024 that will close this issue
@mo8it
Copy link
Contributor Author

mo8it commented Apr 4, 2024

Done in the v6 branch :D

@mo8it mo8it closed this as completed Apr 4, 2024
@jsejcksn
Copy link

Reduce the countless PRs of people submitting their solutions by mistake

🥲

@jsejcksn
Copy link

@mo8it Just curious: is there an available estimation on when you might publish the initial v6 to https://crates.io/crates/rustlings? It looks like some additional feature ideas have been added to that milestone v6 since I last checked.

@mo8it
Copy link
Contributor Author

mo8it commented Apr 11, 2024

Hi @jsejcksn, thanks for your interest 🥰
My estimate for releasing a stable version 6 is about 2 weeks.

I should finish development at the end of this week. Then, I will publish a beta version and invite people to test it for about a week because I did almost a complete rewrite of the Rustlings program (not the exercises) and some bugs might exist. While people are testing, I will start working on the exercise solutions that will also be part of version 6.

If you are interested in the progress so far, check out my writing from today on Zulip 😃 https://rust-lang.zulipchat.com/#narrow/stream/334454-rustlings/topic/v6/near/432731528

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 a pull request may close this issue.

2 participants