Skip to content

rustfmt fails on build #121

@AceofSpades5757

Description

@AceofSpades5757

While trying to get rustfmt to work, I ran into this error. The rustfmt repo was one I had forked and added a .pre-commit-config.yaml file to, matching Python's black repo for reference. Although this worked great on my machine, it doesn't seem to work when trying to use with pre-commit.ci.

Any suggestions? I saw some similar issues, but thought they'd be handled once the hook file was added to the repository, and the appropriate changes to the options, like language, be made.

If this is intended to fail, could there be a more clear message as to why the hook failed?

Error Output

build attempt 1...
    => error
    [INFO] Installing environment for https://github.com/AceofSpades5757/rustfmt.
    [INFO] Once installed this environment will be reused.
    [INFO] This may take a few minutes...
    An unexpected error has occurred: CalledProcessError: command: ('/opt/rust/cargo/bin/cargo', 'install', '--bins', '--root', '/pc/clone/jWRdRDeaQFyzu2V6YXMHIw/rustenv-default', '--path', '.')
    return code: 1
    expected return code: 0
    stdout: (none)
    stderr:
        info: syncing channel updates for 'nightly-2022-03-27-x86_64-unknown-linux-gnu'
        error: could not create temp file /opt/rust/rustup/tmp/pnvrh6gki54od4te_file: Read-only file system (os error 30)
    
    Check the log at /pc/pre-commit.log
build attempt 2...

Added hook config file

Note: Unsure as to what information would be useful here.

- id: rustfmt
  name: rustfmt
  description: "A tool for formatting Rust code according to style guidelines."
  entry: rustfmt
  language: rust
  types: [rust]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions