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

Clippy exercises panic in codespaces #1776

Closed
bglebrun opened this issue Nov 16, 2023 · 2 comments
Closed

Clippy exercises panic in codespaces #1776

bglebrun opened this issue Nov 16, 2023 · 2 comments

Comments

@bglebrun
Copy link

bglebrun commented Nov 16, 2023

Hi, I really love rustlings, thank you for this really great tool!

The clippy exercises seem to panic during a watch or run clippy1 inside of codespaces. This does not happen when I run the exercises on a local machine.

⠁ Compiling exercises/22_clippy/clippy1.rs...                                                                                                                                                                                                                                     thread 'main' panicked at src/exercise.rs:138:63:
Failed to write 📎 Clippy 📎 Cargo.toml file.: Os { code: 2, kind: NotFound, message: "No such file or directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I tried to run an install command in order to check that clippy was installed

@bglebrun ➜ /workspaces/rustlings (main) $ rustup component add clippy
info: component 'clippy' for target 'x86_64-unknown-linux-gnu' is up to date

version output

@bglebrun ➜ /workspaces/rustlings (main) $ rustc --version
rustc 1.73.0 (cc66ad468 2023-10-03)
@bglebrun ➜ /workspaces/rustlings (main) $ rustlings --version
rustlings 5.6.1
@bglebrun ➜ /workspaces/rustlings (main) $ ls -la
total 7576
drwxrwxrwx+ 11 codespace root         4096 Nov 16 03:35 .
drwxr-xrwx+  4 codespace root         4096 Nov  9 04:13 ..
-rw-rw-rw-   1 codespace root        68289 Nov  9 04:13 .all-contributorsrc
drwxrwxrwx+  2 codespace root         4096 Nov  9 04:13 .devcontainer
-rw-rw-rw-   1 codespace root          102 Nov  9 04:13 .editorconfig
drwxrwxrwx+  9 codespace root         4096 Nov 16 03:23 .git
drwxrwxrwx+  3 codespace root         4096 Nov  9 04:13 .github
-rw-rw-rw-   1 codespace root          216 Nov  9 04:13 .gitignore
-rw-rw-rw-   1 codespace root          162 Nov  9 04:13 .gitpod.yml
-rw-rw-rw-   1 codespace root           59 Nov  9 04:13 .markdownlint.yml
drwxrwxrwx+  2 codespace root         4096 Nov  9 04:13 .vscode
-rw-rw-rw-   1 codespace root        90232 Nov  9 04:13 AUTHORS.md
-rw-rw-rw-   1 codespace root        48488 Nov  9 04:13 CHANGELOG.md
-rw-rw-rw-   1 codespace root         4171 Nov  9 04:13 CONTRIBUTING.md
-rw-rw-rw-   1 codespace root        25693 Nov 16 03:23 Cargo.lock
-rw-rw-rw-   1 codespace root          629 Nov 16 03:23 Cargo.toml
-rw-rw-rw-   1 codespace root         1095 Nov  9 04:13 LICENSE
-rw-rw-rw-   1 codespace codespace    6554 Nov 16 03:23 README.md
drwxrwxrwx+ 26 codespace root         4096 Nov  9 04:13 exercises
-rw-rw-rw-   1 codespace root         1984 Nov  9 04:13 flake.lock
-rw-rw-rw-   1 codespace root         2338 Nov  9 04:13 flake.nix
-rw-rw-rw-   1 codespace root        43232 Nov  9 04:13 info.toml
-rw-rw-rw-   1 codespace root         3045 Nov  9 04:13 install.ps1
-rwxrwxrwx   1 codespace root         4667 Nov  9 04:13 install.sh
-rw-rw-rw-   1 codespace root          750 Nov  9 04:13 oranda.json
-rw-rw-rw-   1 codespace codespace    9249 Nov 16 03:35 rust-project.json
drwxrwxrwx+ 10 codespace codespace    4096 Nov  9 04:13 rustlings
-rw-rw-rw-   1 codespace root          278 Nov  9 04:13 shell.nix
drwxrwxrwx+  2 codespace root         4096 Nov  9 04:13 src
drwxrwxrwx+  4 codespace codespace    4096 Nov  9 04:13 target
-rwxrwxrwx   1 codespace codespace 7341064 Nov 15 04:59 temp_1719_ThreadId1
drwxrwxrwx+  3 codespace root         4096 Nov  9 04:13 tests
@richardstrnad
Copy link

I ran into the same error. This happened after updating my local Rustlings repo but not rebuilding the Rustlings binary.
This was because the path of the Clippy exercises changed (#1727), so my binary tried to access the old path.

So, reinstalling solved the issue.

cargo install --path .

matthri added a commit to matthri/rustlings that referenced this issue Nov 18, 2023
matthri added a commit to matthri/rustlings that referenced this issue Dec 22, 2023
@Eshan-Sharma
Copy link

I ran into the same error. This happened after updating my local Rustlings repo but not rebuilding the Rustlings binary. This was because the path of the Clippy exercises changed (#1727), so my binary tried to access the old path.

So, reinstalling solved the issue.

cargo install --path .

This solution by @richardstrnad richardstrnad works for the below error too

⠚ Compiling exercises/clippy/clippy1.rs...
thread 'main' panicked at 'Failed to run 'run' command: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/exercise.rs:134:69

@mo8it mo8it closed this as completed May 10, 2024
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.

4 participants