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

Fix documenting for non-x86 targets #111394

Closed
wants to merge 1 commit into from
Closed

Fix documenting for non-x86 targets #111394

wants to merge 1 commit into from

Conversation

heiher
Copy link
Contributor

@heiher heiher commented May 9, 2023

These errors occur when cross compiling the LoongArch target on x86:

 Documenting std v0.0.0 (/home/hev/git/rust/rust/library/std)
error[E0412]: cannot find type `WSADATA` in this scope
   --> library/std/src/sys/windows/c/windows_sys.rs:715:63
    |
715 |     pub fn WSAStartup(wversionrequested: u16, lpwsadata: *mut WSADATA) -> i32;
    |                                                               ^^^^^^^ not found in this scope

error[E0412]: cannot find type `CONTEXT` in this scope
    --> library/std/src/sys/windows/c/windows_sys.rs:3034:29
     |
3034 |     pub ContextRecord: *mut CONTEXT,
     |                             ^^^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0412`.
error: could not document `std`

Fixes: e92ee03 ("Generate windows-sys bindings")

@rustbot
Copy link
Collaborator

rustbot commented May 9, 2023

r? @thomcc

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 9, 2023
@rustbot
Copy link
Collaborator

rustbot commented May 9, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-log-analyzer

This comment has been minimized.

@heiher
Copy link
Contributor Author

heiher commented May 9, 2023

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 9, 2023
@Noratrieb
Copy link
Member

@ChrisDenton

These errors occur when cross compiling the LoongArch target on x86:

```
 Documenting std v0.0.0 (/home/hev/git/rust/rust/library/std)
error[E0412]: cannot find type `WSADATA` in this scope
   --> library/std/src/sys/windows/c/windows_sys.rs:715:63
    |
715 |     pub fn WSAStartup(wversionrequested: u16, lpwsadata: *mut WSADATA) -> i32;
    |                                                               ^^^^^^^ not found in this scope

error[E0412]: cannot find type `CONTEXT` in this scope
    --> library/std/src/sys/windows/c/windows_sys.rs:3034:29
     |
3034 |     pub ContextRecord: *mut CONTEXT,
     |                             ^^^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0412`.
error: could not document `std`
```

Fixes: e92ee03 ("Generate windows-sys bindings")
@heiher
Copy link
Contributor Author

heiher commented May 9, 2023

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 9, 2023
@ChrisDenton
Copy link
Member

ChrisDenton commented May 9, 2023

The code in this file is auto-generated so any changes will be overwritten. Instead it'd be better to modify c.rs to add the two missing types for this target (CONTEXT and WSADATA). Edit: Ah I see the problem is they're used within windows-sys itself. Hm.

@ChrisDenton
Copy link
Member

So I think it'd be better to add some dummy types to generate-windows-sys so that it will compile on other targets.

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 9, 2023
@heiher heiher closed this May 10, 2023
@heiher heiher deleted the fix-doc branch May 10, 2023 02:52
bors added a commit to rust-lang-ci/rust that referenced this pull request May 10, 2023
…rkingjubilee

Don't force include Windows goop when documenting

Why do we need to include all the windows bits on non-windows platforms? Let's try not doing that.

Possible alternative to rust-lang#111394, if it works.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants