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

doc: Prevent evaluation warnings #328269

Merged
merged 1 commit into from
Jul 21, 2024
Merged

Conversation

infinisil
Copy link
Member

@infinisil infinisil commented Jul 18, 2024

Description of changes

Building the manual using nix-build doc previously gave a bunch of warnings because it inspects lib to figure out where all the symbols are. This relates to nix-community/nixdoc#128.

This is not great, because these warnings are not something that can be fixed by the caller, so anybody that depends on the manual build will see them for every evaluation (e.g. as reported here).

This PR solves this by moving the step of figuring out where the symbols are to a Nix evaluation inside a derivation instead, such that the warnings only trigger during build time, and the result of it can be cached too.

Things done

  • Successfully ran nix-build doc on x86_64-linux

This work is sponsored by Antithesis

Add a 👍 reaction to pull requests you find important.

Problem: `nix-build doc` gives a bunch of warnings because it inspects
`lib` to figure out where all the symbols are.

Solution: Move the step of figuring out where the symbols are to
a Nix evaluation inside a derivation instead.
@github-actions github-actions bot added the 8.has: documentation This PR adds or changes documentation label Jul 18, 2024
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/suppress-warnings-for-a-derivation/49271/4

@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 18, 2024
@infinisil infinisil requested a review from hsjobeki July 19, 2024 05:23
Copy link
Contributor

@hsjobeki hsjobeki left a comment

Choose a reason for hiding this comment

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

Looking good. Doesn't fix the warnings though, only suppresses them through chached result which i think is lgtm.

@infinisil infinisil merged commit 949797e into NixOS:master Jul 21, 2024
28 checks passed
@infinisil infinisil deleted the doc-no-warnings branch July 21, 2024 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: documentation This PR adds or changes documentation 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.

3 participants