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

nix: disable documentation on risc-v #242019

Merged
merged 1 commit into from
Aug 9, 2023
Merged

Conversation

fgaz
Copy link
Member

@fgaz fgaz commented Jul 7, 2023

Description of changes

mdbook fails with this error:

GEN    /nix/store/...-nix-2.15.1-doc/share/doc/nix/manual/index.html
[ERROR] (mdbook::renderer): Renderer exited with non-zero return code.
[ERROR] (mdbook::utils): Error: Rendering failed
[ERROR] (mdbook::utils):    Caused By: The "linkcheck" renderer failed
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
    • riscv64-linux
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Jul 7, 2023
@fgaz fgaz mentioned this pull request Jul 7, 2023
Comment on lines 55 to 58
# mdbook errors out on risc-v
!stdenv.buildPlatform.isRiscV
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could get forgotten about and be left here long after the need for it has gone away. It might be better to change mdbook to exclude RiscV as a platform and then tryEval mdbook here. The restriction is then much more likely to be removed in a timely way after mdbook is fixed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mdbook does generally work on risc-v though. I tried building the test book included in the mdbook repo and it works. Not sure why it fails here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make this check based on if mdbook is supported/broken on the platform and change the platform/broken of mdbook accordingly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SuperSandro2000 see my other comment #242019 (comment)

Comment on lines 55 to 58
# mdbook errors out on risc-v
!stdenv.buildPlatform.isRiscV
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make this check based on if mdbook is supported/broken on the platform and change the platform/broken of mdbook accordingly.

@SuperSandro2000
Copy link
Member

[ERROR] (mdbook::utils): Caused By: The "linkcheck" renderer failed

Is this just the linkcheck plugin? Can we just disable that by making mdbook-linkcheck optional?

@fgaz
Copy link
Member Author

fgaz commented Jul 24, 2023

Is this just the linkcheck plugin? Can we just disable that by making mdbook-linkcheck optional?

Yes, but that requires patching. I tried adding

  postPatch = ''
    substituteInPlace doc/manual/book.toml \
      --replace "[output.linkcheck]" "[output_disabled.linkcheck]"
  '';

and I got

GEN    /nix/store/nx3s99mswgzazvl9ccf6fn60rmvdc21g-nix-2.15.1-doc/share/doc/nix/manual/index.html
mv: cannot stat '/nix/store/nx3s99mswgzazvl9ccf6fn60rmvdc21g-nix-2.15.1-doc/share/doc/nix/manual.tmp/html': No such file or directory
make: *** [doc/manual/local.mk:166: /nix/store/nx3s99mswgzazvl9ccf6fn60rmvdc21g-nix-2.15.1-doc/share/doc/nix/manual/index.html] Error 1

I'm not sure why that happens. linkcheck shouldn't produce any file as far as I can tell so why is html missing?

@SuperSandro2000
Copy link
Member

no idea honestly

@MaxHearnden
Copy link
Contributor

The error message is misleading, the build is failing due to a segmentation fault, I have collected some information and filed a bug report with rustc (rust-lang/rust#114473)

@fgaz fgaz force-pushed the nix/riscv-no-docs branch from 3076e2b to 95c77f3 Compare August 5, 2023 16:43
@fgaz
Copy link
Member Author

fgaz commented Aug 5, 2023

Thanks @MaxHearnden. I updated the comment.

Since the bug is in rustc itself I think it's better to merge this rather than throwing the baby out with the bathwater and marking rustc as broken. I subscribed to the rust issue so I'll take care of reverting this when the bug is fixed.

If nobody objects I'll merge this in a couple of days since it's blocking native risc-v builds

@fgaz fgaz merged commit e9297c8 into NixOS:master Aug 9, 2023
@fgaz fgaz deleted the nix/riscv-no-docs branch August 9, 2023 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: riscv64 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants