Skip to content

Please install rustfmt to the docs.rs doc build environment #357

@Lokathor

Description

@Lokathor

My crate builds bindings, and the bindings output comes out as all one line without rustfmt available.

Activity

jyn514

jyn514 commented on Dec 7, 2019

@jyn514
Member

@Lokathor It looks like this is fixed in new versions of fermium, probably because of #407. Can you take a look at https://docs.rs/fermium/0.1.4/src/fermium/SDL2-v2.0.8-x86_64-pc-windows-msvc.rs.html#4692-4695 and make sure it looks about right?

Lokathor

Lokathor commented on Dec 7, 2019

@Lokathor
Author

Well, that's correct, but probably because I have since stopped using bindgen on docs.rs. The file you linked is just permanently in the repo: https://github.com/Lokathor/fermium/blob/master/src/SDL2-v2.0.8-x86_64-pc-windows-msvc.rs

but i guess we can close this and someone else will report if it's still a problem later.

jyn514

jyn514 commented on Dec 7, 2019

@jyn514
Member

I'd actually rather keep it open until I know it's fixed, sorry we took so long you found a workaround instead.

reopened this on Dec 7, 2019
jyn514

jyn514 commented on Mar 23, 2020

@jyn514
Member

Mentoring instructions:

If you have any questions, feel free to reach out here or on Discord.

elmurci

elmurci commented on Mar 23, 2020

@elmurci

add_component requires two parameters:

self.toolchain.add_component(&self.workspace, "rustfmt")?;

elmurci

elmurci commented on Mar 24, 2020

@elmurci

@jyn514 the solution above didn't work...

jyn514

jyn514 commented on Mar 24, 2020

@jyn514
Member

What do you mean by didn't work? Can you put up a draft branch?

elmurci

elmurci commented on Mar 24, 2020

@elmurci

adding the command:

self.toolchain.add_component(&self.workspace, "rustfmt")?;

to update_toolchain

jyn514

jyn514 commented on Mar 24, 2020

@jyn514
Member

@elmurci can you join the discord so I can help you debug without spamming notifications for people watching the issue? https://discord.gg/f7mTXPW

elmurci

elmurci commented on Mar 24, 2020

@elmurci

I managed to fix it. Putting it here as it may help others.
The problem was due to a dependency (tonic-build) having rustfmt in its features section in cargo.toml:

...
[features]
default = ["transport", "rustfmt", "prost"]
...

I solved it by disabling tonic-build's rustfmt dependency in my project's cargo.toml:

...
[build-dependencies]
tonic-build = { version = "0.1.1", default-features = false, features = ["transport"] }
...

After doing this it built correctly.

jyn514

jyn514 commented on Mar 30, 2020

@jyn514
Member

@pietroalbini if rustfmt isn't available on the latest nightly, should we refuse to update the toolchain or instead remove the rustfmt component? I lean towards not updating but I could be convinced otherwise.

pietroalbini

pietroalbini commented on Mar 31, 2020

@pietroalbini
Member

I'd prefer not updating as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @pietroalbini@elmurci@Lokathor@jyn514

      Issue actions

        Please install `rustfmt` to the docs.rs doc build environment · Issue #357 · rust-lang/docs.rs