:doc builtins.derivation errors out since at least 2.93.3 #1191
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
awaiting
author
awaiting
contributors
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
diagnostics
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
Feature/S3
Importance
High
Importance
Low
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
Release Blocking
Non-urgent
Release Blocking
Urgent
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
Urgency
High
Urgency
Low
ux
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lix-project/lix#1191
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
Typing
:doc builtins.derivationin the repl returns the following error, instead of showing the corresponding documentation:Since 2.93.3 is the oldest release still in nixpkgs, so that's as far back as i can test this offhand, but the bug might be older. For reference, CppNix (tested on 2.31.3, the version in current nixpkgs) displays the documentation correctly.
Steps To Reproduce
:doc builtins.derivationExpected behavior
It displays the documentation associated with
builtins.derivation.nix --versionoutputThis happens on 2.95.1, 2.94.1, and 2.93.3, at least on an x86_64 ubuntu.
Additional context
One interesting implementation detail that even CppNix leaks1 is that
builtins.derivationis actually defined at<nix/derivation-internal.nix>, which is lix/libexpr/primops/derivation.nix. Weirdly enough, other builtins defined with nix (such asfetchurl) don't leak that with CppNix, and work correctly with Lix, so it seems there is something really special aboutderivation.nix. If somefew more familiar with the implementation could pitch in or give some hint as to what might be the culprit, I'm very curious; I haven't looked at the code path for:doc builtins.*in a while.Specifically, the output of the
:doc builtins.derivationcommand starts withFunction defined at <nix/derivation-internal.nix>:30:1↩︎builtins.fetchurlis not defined in nix code, it's a proper c++ primop. you have toimport <nix/fetchurl.nix>to get the nix-defined derivation-based fetchurl. both that one andderivationdo not have inspectable documentation via lixdoc because lixdoc expects sources to come only from files, not inline strings. if you define a lambda with docs inline in the repl those docs also don't show up for the same reason.this should be easy enough to fix in the repl hookup of lixdoc, though we will also want to extend the
Hiddensource type to also lug around astring_viewof the source instead of moving the builtins to useStringsources (otherwise they'll show up in backtraces, which is usually not helpful)