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(docs): fixes nix build .#docs #166

Merged
merged 1 commit into from
Aug 7, 2024
Merged

Conversation

taliyahwebb
Copy link
Contributor

The Problem

Currently nix build github:rustshop/flakebox#docs and therefore also flakebox docs fails.
With this change the build succeeds nix build github:taliyahwebb/flakebox/docs-fix#docs

Basic Analysis

In my testing i figured out that the stdenv default builder tries to execute the output of the internal optionsDocMd derivation which is added to the docs buildInputs.

From as far as I can tell this only happens when a derivation is created from pkgs.runCommand and writes directly to $out instead of creating a directory and putting a file in that.

Details

I was able to find out that duringsource $stdenv/setup any derivation output that is formed like described above is attempted to be executed by what i assume to be bash.
I was unable to investigate a further cause and didn't find any documentation or mention of this behavior so this might be a nixpkgs.stdenv bug?

Alternative Fix

An alternative fix for the build failure that I attempted was to simply remove optionsDocMd from buildInputs but keep it during build phase, which seemed to work initially.
I am not familiar enough with nix yet to know if that would cause any unwanted side effects and thus decided to make a fixing change to the optionsDocMd derivation instead.

@dpc dpc enabled auto-merge August 7, 2024 17:43
Copy link
Contributor

@dpc dpc left a comment

Choose a reason for hiding this comment

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

Thanks!

@dpc dpc merged commit 54f3fd5 into rustshop:master Aug 7, 2024
4 of 5 checks passed
@taliyahwebb taliyahwebb deleted the docs-fix branch August 8, 2024 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants