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

rustc_private? #2088

Closed
smoelius opened this issue Mar 27, 2023 · 3 comments · Fixed by #2101
Closed

rustc_private? #2088

smoelius opened this issue Mar 27, 2023 · 3 comments · Fixed by #2101
Labels
A-builds Area: Building the documentation for a crate C-enhancement Category: This is a new feature mentor This has instructions for getting started

Comments

@smoelius
Copy link
Contributor

smoelius commented Mar 27, 2023

Can a crate that uses rustc_private be built on docs.rs?

I have been trying to build this crate: https://docs.rs/crate/dylint_linting

My most recent attempt was to add the relevant rustc components manually from the build script, which didn't work.

Is what I am trying to do possible? If so, what is the "right" way to build a crate that uses rustc_private on docs.rs?

Thank you.

@jyn514
Copy link
Member

jyn514 commented Apr 5, 2023

Hmm. This is definitely not supported today, but it seems ok to run rustup component add rustc_private before building the docs. My only concern is that it seems like most builds will fail anyway because we always build with latest nightly and the API changes so frequently.

@smoelius can you talk a little more about how you were imagining this would work? "only the latest nightly" seems limiting; I guess we could support an arbitrary date but then it will be easy to overload the server just by publishing many crates with different rustc_private toolchains.

cc #506, #228

@jyn514 jyn514 added A-builds Area: Building the documentation for a crate C-enhancement Category: This is a new feature labels Apr 5, 2023
@smoelius1
Copy link

@smoelius can you talk a little more about how you were imagining this would work? "only the latest nightly" seems limiting

"Only the latest nightly" would work for my use case.

Strictly speaking, dylint_linting has always required a nightly compiler. The intent is that it build with every nightly since the one coinciding with it's initial release. Here, for example, is a case where dylint_linting had to adjust for a rustc API change.

dylint_linting has been building successfully on docs.rs because it consists largely of macros. It only started requiring rustc_private recently.

If the latest nightly was not possible, an arbitrary recent nightly chosen by docs.rs also seems workable.

In other words, if docs rs' policy was "we'll give you a nightly with rustc_private from within (say) the past six weeks, the rest is up to you," I could live with that.

(Apologies as I am traveling and don't have access to my normal @smoelius account. If you would prefer, I could reaffirm the above this coming Monday.)

@jyn514
Copy link
Member

jyn514 commented Apr 6, 2023

"Only the latest nightly" would work for my use case

Oh, perfect! that should be quite easy to do on our side then :)

Apologies as I am traveling and don't have access to my normal @smoelius account. If you would prefer, I could reaffirm the above this coming Monday.

No worries, you're perfectly fine :) I'm not worried about someone maliciously pretending to be you to tell us to implement a feature lol (not sure how that would even work).

Mentoring instructions: add a call to toolchain.install_component("rustc_private") around here, following rustfmt's example:

if let Err(err) = self.toolchain.add_component(&self.workspace, "rustfmt") {

@jyn514 jyn514 added the mentor This has instructions for getting started label Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-builds Area: Building the documentation for a crate C-enhancement Category: This is a new feature mentor This has instructions for getting started
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants