lib.trivial.pipe "does not have documentation", but it actually does #1110
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
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
Feature/S3
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lix-project/lix#1110
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
The function
lib.trivial.pipeclearly has documentation in<nixpkgs>/lib/trivial.nixalongside other functions, yet innix repl, running:doc lib.trivial.pipereturns an error.Steps To Reproduce
$ nix repl> :l <nixpkgs>> :doc lib.trivial.pipeExpected behavior
The documentation should appear in the repl, like the other functions in
trivial.nixdo.nix --versionoutputAdditional context
Latest cppnix shows the documentation in repl, including the source code location. However, it fails to find the source code when using
:e lib.trivial.pipe, which is curious. (Editing works for other functions intrivial.nixjust fine.)Noogle claims that
lib.trivial.pipeis a builtin, indicating it is a primop in their evaluation. This is even more curious, since AFAICT the definition of pipe is quite clear in trivial.nix.I think what is happening is that
lib.trivial.pipeis somehow evaluated to be a primop (isPrimOp() -> true), so thev.isLambda()branch doesn't get taken.Neither cppnix nor lix are handling this correctly. I suspect it's related to the pipe-operator somehow, though enabling or disabling the feature makes no difference. Also, as a casual observer, nothing in the merge commits for both lix and cppnix pipe-operator PRs look like they can cause this issue.
I'm going to keep investigating this because I find it interesting and I need the excuse to look into nix internals and get a lix development env set up. Any pointers appreciated however
pipeis a builtin, just a partially applied one. you're right about the branch not taken as a result, but at least in this case we have an attrpath we can still extract a position from to pass to the documentation extractor. should be pretty straight-forward if you want to try :)