tools icon indicating copy to clipboard operation
tools copied to clipboard

fix(rome_cli): Allow to run on read-only file systems

Open realtimetodie opened this issue 1 year ago • 3 comments

Fixes an issue where Rome could not process files on read-only file systems during traversal, where write access to the file system was not required.

This is required to execute Rome in isolated environments (sandboxes).

Example - Error message when running the check command on a read-only file system

$ rome check .
/test.js internalError/io ━━━━━━━━━━

  × Read-only file system (os error 30)
  

Checked 0 file(s) in 939µs
Skipped 1 file(s)
Rome encountered an unexpected error

This is a bug in Rome, not an error in your code, and we would appreciate it if you could report it to https://github.com/rome/tools/issues/ along with the following information to help us fixing the issue:

Source Location: crates/rome_cli/src/traversal.rs:210:8
Thread Name: main
Message: attempt to subtract with overflow

References

realtimetodie avatar Nov 24 '22 22:11 realtimetodie

Deploy Preview for docs-rometools ready!

Built without sensitive environment variables

Name Link
Latest commit ac18d624769f505def47c1edb6465bb1c4faac76
Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/6387bec0ae1b3e00080bbc42
Deploy Preview https://deploy-preview-3851--docs-rometools.netlify.app/playground
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Nov 24 '22 22:11 netlify[bot]

The additional variant increased the complexity of the implementation. I am working on tests for this. Please do not merge yet.

realtimetodie avatar Nov 25 '22 21:11 realtimetodie

I added integration tests for the check and format commands.

realtimetodie avatar Nov 27 '22 13:11 realtimetodie

I replaced the std::fs tests with the MemoryFileSystem in read-only mode. There was another bug, where unnecessary write access to the underlying file system was required to read the rome.json configuration file. It is good that we have the tests.

realtimetodie avatar Nov 30 '22 20:11 realtimetodie