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

Build container doesn't install rustfmt #409

Closed
hulto opened this issue Dec 19, 2023 · 4 comments · Fixed by #412
Closed

Build container doesn't install rustfmt #409

hulto opened this issue Dec 19, 2023 · 4 comments · Fixed by #412
Assignees
Labels
bug Something isn't working dev-ops good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@hulto
Copy link
Collaborator

hulto commented Dec 19, 2023

Describe the bug
The automatic code formatting that the dev container does requires rustfmt
This results in an error every time a rust file is saved.

[Error - 12:36:26 AM] Request textDocument/formatting failed.
  Message: rustfmt exited with:
                           Status: exit status: 1
                           stdout: 
                           stderr: error: 'rustfmt' is not installed for the toolchain 'nightly-2023-09-04-x86_64-unknown-linux-gnu'
To install, run `rustup component add rustfmt --toolchain nightly-2023-09-04-x86_64-unknown-linux-gnu`

To Reproduce

Expected behavior

Screenshots

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context
Add the rustfmt component as a part of the dev container build.

@hulto hulto added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers dev-ops labels Dec 19, 2023
@hulto hulto added this to the v0.1.0 milestone Dec 19, 2023
@ankit-pn
Copy link
Contributor

Hey I want to work on this issue, it would be great if anyone assign this to me. thanks

@hulto
Copy link
Collaborator Author

hulto commented Dec 19, 2023

Awesome! Thanks @ankit-pn 🙂

@ankit-pn
Copy link
Contributor

I am new to realm, can you please specify how to reproduce this error?

@hulto
Copy link
Collaborator Author

hulto commented Dec 21, 2023

To reporoduce the error.
Clone the repo to your device system.
Open the project folder "realm" with VScode.

Once the projects open press Ctrl-P and search for "repo in dev container" if that option doesn't exist you'll have to install the dev containers extension in vscode.
Here's the VSCode docs just in case

https://code.visualstudio.com/docs/devcontainers/containers#_installation

VScode will take a while to build the dev container. Once the dev container finishes building navigate in the file explorer to realm > implants > imix > main.rs (or any rust file)
And press ctrl-S or File > save

This should trigger the autoformatting and raise the error as a pop up in the bottom left corner of VSCode.
If the files doesn't autoformat press ctrl-p and search for "format".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dev-ops good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants