Comments (3)
Cabal does make use of the path environment variable. "extra-prog-path" as it says is just an extra path to augment the existing system path. It is not clear to me how your system is configured that this does not work.
Perhaps when you enter the nix-shell the path is overridden?
from cabal.
If $(which happy)
works, then executable is in PATH
. I would consider this a bug, not a user question.
@yaitskov, we need your help to diagnose this, cabal build -v3
or similar prints enviroment variables (starting with with environment
). Can you tel us how ("PATH","…
differs from echo $PATH
?
from cabal.
Cabal does make use of the path environment variable
I started grepping cabal source code - exception is thrown from lookupProgram which looks into a some Db and I assumed that program is referred in such a way is expected to be "cabally installed". I didn't trace all way.
Here is another way to reproduce the issue, which is easier to investigate
$ rm -rf ~/.cabal ~/.local/state/cabal ~/.cache/cabal
$ git clone https://github.com/haskell/happy.git
# commit 78dcc03336d74822d58b8474e9639c6281c1a422
$ cd happy
cat<<EOF > ./default.nix
{ pkgs ? import <nixpkgs> {} }:
let
inherit (pkgs) lib;
hp = pkgs.haskell.packages.ghcHEAD;
sourceRegexes = [
"^src.*"
"^exe.*"
"^package.yaml"
"^.*\\.cabal"
"^LICENSE"
];
shell = hp.shellFor {
packages = p: [];
shellHook = ''echo ok'';
nativeBuildInputs = [ pkgs.cabal-install pkgs.happy ];
};
in
{ inherit shell; }
EOF
$ nix-shell
$ type happy
happy is /nix/store/4z00pcvs075ghpnyhsvg6xg54kzncv5m-happy-1.20.1.1/bin/happy
$ cd packages/frontend # important step
$ cabal build
Warning: Unknown/unsupported 'ghc' version detected (Cabal 3.10.3.0 supports
'ghc' version < 9.10):
/nix/store/z3d4vkisfchw9ydyalax4q32pp5ry0dr-ghc-9.11.20240323/bin/ghc is
version 9.11.20240323
Build profile: -w ghc-9.11.20240323 -O1
In order, the following will be built (use -v for more details):
- happy-frontend-2.0 (lib) (first run)
- happy-3.0 (exe:happy) (first run)
Preprocessing library for happy-frontend-2.0..
Error: .cabal-wrapped: The program 'happy' is required but it could not be
found
Error: cabal: Failed to build happy-frontend-2.0 (which is required by
exe:happy from happy-3.0).
from cabal.
Related Issues (20)
- Why release of support multi-repl takes so much time? HOT 4
- `cabal list-bin` doesn't suppress stdout from other phases HOT 1
- Interrupting `cabal test` may leave test executable running HOT 1
- Does cabal-3.10 impose `setup.Cabal < 3.12`? HOT 12
- Add support to clean build cache of a specific local package HOT 2
- `cabal install` program-suffix is applied to the binary name in the store HOT 2
- Feature request: `cabal check` warn about duplicate entries in `default-extensions` and `other-extensions` HOT 1
- Switch to using a common `.project` file extension for projects? HOT 1
- `cabal build --enable-build-info` doesn't contain options specified via `cabal.project` files HOT 1
- Matching and complete `cabal path` examples
- Mergify 2-level checks? HOT 1
- broken symlinks for configuration files are silently ignored
- Discussion: C++ modules support HOT 1
- Wrong condition for passing --working-dir flag HOT 9
- Weird solver behaviour: doesn't consider installed version first HOT 4
- Gotchas of `[TARGETS]`; implicit vs `all` vs combinations HOT 2
- Build failure with GHC-8.2 HOT 15
- How to alert users of known issues with released `cabal-install`? HOT 5
- Documentation for -fdeveloper HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cabal.