Giter Club home page Giter Club logo

Comments (3)

gbaz avatar gbaz commented on June 8, 2024

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.

ffaf1 avatar ffaf1 commented on June 8, 2024

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.

yaitskov avatar yaitskov commented on June 8, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.