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

sourcehut: fix build #198586

Closed
wants to merge 1 commit into from
Closed

sourcehut: fix build #198586

wants to merge 1 commit into from

Conversation

winterqt
Copy link
Member

Description of changes

Fixes #198478.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • 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/)
  • 22.11 Release Notes (or backporting 22.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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

Copy link
Contributor

@tjni tjni left a comment

Choose a reason for hiding this comment

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

Thank you so much for tracking this down. It makes a lot of sense once I see the change, but it's quite subtle.

Comment on lines 92 to 97
# "actual" is a misnomer. We need to pass through these inputs to dependent services but we also don't want
# to pass through hooks, because we don't want hooks to run twice (when it's possible for them to do so).
passthru.actualNativeBuildInputs = [
sassc
nodejs
];
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm really impressed by the mental leap you took to realize this was the problem.

Have a few suggestions coming from someone who didn't figure this out, which could be more representative of a future reader of this derivation. Nothing mandatory, just opinion.

  1. What do you think of calling this coreSrhtNativeBuildInputs? This emphasizes that the source of the inputs is the core.sr.ht repo. Or, sharedSrhtNativeBuildInputs, which speaks to the purpose of the core.sr.ht repo as a container for "code shared among all sr.ht projects" (c.f. the README).
  2. Moving this comment to the definition of nativeBuildInputs a few lines above can be better. I feel that, aside from explanation, the main impact of the comment is to discourage depending on nativeBuildInputs directly, which makes sense when next to the property itself. It could offer a warning to not use it because [insert your explanation of non-idempotent hooks being added more than once].

Copy link
Member Author

Choose a reason for hiding this comment

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

  1. What do you think of calling this coreSrhtNativeBuildInputs? This emphasizes that the source of the inputs is the core.sr.ht repo. Or, sharedSrhtNativeBuildInputs, which speaks to the purpose of the core.sr.ht repo as a container for "code shared among all sr.ht projects" (c.f. the README).

I like the sound of sharedNativeBuildInputs (which in usage would be srht.sharedNativeBuildInputs), thanks!

  1. Moving this comment to the definition of nativeBuildInputs a few lines above can be better. I feel that, aside from explanation, the main impact of the comment is to discourage depending on nativeBuildInputs directly, which makes sense when next to the property itself. It could offer a warning to not use it because [insert your explanation of non-idempotent hooks being added more than once].

I've moved the comment and reworded it a bit -- let me know what you think. (Is the passthru fine where it is, though? They're so far apart, so not sure.)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine.

@bjornfor
Copy link
Contributor

Commit (and PR) message typo: sourehut -> sourcehut

@winterqt
Copy link
Member Author

Commit (and PR) message typo: sourehut -> sourcehut

Fixed, thanks.

@winterqt winterqt changed the title sourehut: fix build sourcehut: fix build Oct 30, 2022
@winterqt winterqt requested a review from tjni October 30, 2022 16:42
Copy link
Contributor

@tjni tjni left a comment

Choose a reason for hiding this comment

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

LGTM

@winterqt
Copy link
Member Author

winterqt commented Oct 30, 2022

Made lines on the explanation comment more even.

@winterqt winterqt requested a review from ju1m October 30, 2022 16:59
@winterqt
Copy link
Member Author

(Realized I should probably get @ju1m's input as well before merging.)

@winterqt
Copy link
Member Author

I ran these locally, but just to show it here...
@ofborg test sourcehut

This was referenced Oct 30, 2022
@ju1m
Copy link
Contributor

ju1m commented Oct 30, 2022

@winterqt, many thanks for that fix. I don't know the context in which this manual passing around of dependencies was introduced to begin with, but I think using propagatedNativeBuildInputs is cleaner. Please see #198720 for a proposal

@winterqt
Copy link
Member Author

Closing in favor of #198720.

@winterqt winterqt closed this Oct 30, 2022
@winterqt winterqt deleted the fix-sourcehut branch October 30, 2022 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sourcehut.buildsrht fails to build
4 participants