You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build neuron using plain cabal, instead of via Nix as documented, so I could be missing something. There are a few hacks needed on the way to reproduce the following problem, but basically, if I run cabal install neuron, I get the error that neuron-search could not be found while compiling neuron/src/app/Neuron/CLI/Search.hs.
In neuron/src/app/Neuron/CLI/Search.hs, the function staticWhich from the package "which" is used to find the path to the bash script neuron-search.
I could make it compile using the Paths_neuron module instead, but I'm not sure whether that would work for Nix. Does this look like an acceptable fix?
(Note: I'm actually using tag 0.6.0.0 instead of master, to avoid rib-core, but the relevant line of code hasn't changed so the issue still seems current.)
I don't want to install and learn to use yet another package manager. The required changes to build with vanilla cabal are quite minor; I can volunteer to patch and maintain anything that has to do with this, but I would also understand if you just don't want the extra overhead; this issue is the only one I'm not sure how to fix without breaking stuff.
The linked patch to which doesn't seem it would actually work if the required executable is a data file of the current package, because it depends on that executable being on PATH before the package is built.
Since this is the only place where staticWhich is used (it used to be used in several places), then I suppose we can just get rid of it entirely, and possibly even embed the neuron-search script in haskell (via Text.RawString.QQ).
I don't particularly like seeing unsafePerformIO here (doesn't seem like a conventional solution; is that what all these TH libraries do?).
In any case, whatever change we make should continue to work in nix-build (./result/bin/neuron -d ./guide search should not fail), and should not break the compilation in the bin/run and bin/test scripts (which use ghcid).
Plus, it should not revert the nix install size optimizations done in #193 (comment) (do a nix install on a fresh Ubuntu VM, and check the size of /nix). I vaguely remember seeing an issue with cabal's Paths_neuron adding unnecessary dependencies.
Activity
srid commentedon Sep 13, 2020
May I know the reason for trying to build it with plain cabal, outside of Nix?
Generally speaking, this is best done in the
whichlibrary. There is a PR open for that, but I don't know the status of it: obsidiansystems/which#3Lysxia commentedon Sep 13, 2020
I don't want to install and learn to use yet another package manager. The required changes to build with vanilla cabal are quite minor; I can volunteer to patch and maintain anything that has to do with this, but I would also understand if you just don't want the extra overhead; this issue is the only one I'm not sure how to fix without breaking stuff.
The linked patch to
whichdoesn't seem it would actually work if the required executable is a data file of the current package, because it depends on that executable being on PATH before the package is built.srid commentedon Sep 14, 2020
Since this is the only place where
staticWhichis used (it used to be used in several places), then I suppose we can just get rid of it entirely, and possibly even embed theneuron-searchscript in haskell (viaText.RawString.QQ).I don't particularly like seeing unsafePerformIO here (doesn't seem like a conventional solution; is that what all these TH libraries do?).
In any case, whatever change we make should continue to work in nix-build (
./result/bin/neuron -d ./guide searchshould not fail), and should not break the compilation in thebin/runandbin/testscripts (which use ghcid).srid commentedon Sep 14, 2020
Plus, it should not revert the nix install size optimizations done in #193 (comment) (do a nix install on a fresh Ubuntu VM, and check the size of /nix). I vaguely remember seeing an issue with cabal's Paths_neuron adding unnecessary dependencies.
Lysxia commentedon Sep 14, 2020
The conventional solution is to use
runIO, I didn't remember the name off-hand.Lysxia commentedon Oct 9, 2020
Awesome!
srid commentedon Oct 9, 2020
Had to revert that. If you're interested, please see #432
Enough dealing with non-nix requests for me today.
srid commentedon Aug 8, 2021
Closing per https://neuron.zettel.page/next ... to further discuss this idea, in the context of Emanote, post here