Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for non-standard program search $PATH #1415

Merged
merged 8 commits into from Aug 19, 2013

Commits on Aug 10, 2013

  1. Flesh out the Program run code to cover all cases

    Previously the runProgramInvocation impl only covered the common special
    cases that we currently use. In particular it did not support env vars
    or changing the workind directory.
    
    Also change the ProgramInvocation { progInvokeEnv } to allow unsetting
    env vars, not just setting them to new values.
    
    This stuff would be better if we could use createProcess for all cases
    but that doesn't yet support running programs in the foreground with
    proper ctl-C handling (only rawSystem currently supports that).
    dcoutts committed Aug 10, 2013
    Configuration menu
    Copy the full SHA
    50af0d7 View commit details
    Browse the repository at this point in the history
  2. Add a programOverrideEnv to the ConfiguredProgram

    And use it in programInvocation. So configured programs can have
    environment var overrides that will be used in all invocations, like
    the existing support for default and override arguments.
    dcoutts committed Aug 10, 2013
    Configuration menu
    Copy the full SHA
    b0f08f4 View commit details
    Browse the repository at this point in the history
  3. Allow the Program programPostConf to update all settings, including env

    So rather than only returning the default args it can adjust any of the
    ConfiguredProgram settings, including programDefaultArgs as now but now
    also the programOverrideArgs and the new programOverrideEnv.
    dcoutts committed Aug 10, 2013
    Configuration menu
    Copy the full SHA
    34a2c8c View commit details
    Browse the repository at this point in the history
  4. Add a notion of program search path to the ProgramDb

    Previously we would just use the normal system $PATH for finding
    programs (unless the Program provided some custom method). Now the
    ProgramDb has its own notion of the search path and we use that for
    finding programs (by default). The search path can be either specific
    directories or the system search method (ie $PATH on unix and something
    similar on Win32). The default search path is just the system one.
    
    In addition, this search path is passed on to programs when we invoke
    them as the $PATH env var.
    dcoutts committed Aug 10, 2013
    Configuration menu
    Copy the full SHA
    84c4ddc View commit details
    Browse the repository at this point in the history
  5. Take the opportunity to simplify the ghc tool configuration

    When we configure ghc we have to find a bunch of related tools (like gcc
    on windows). We do that by looking in some extra locations first, and
    that's now simpler to do with the new infrastructure by just tacking an
    extra directory on the front of the search path.
    dcoutts committed Aug 10, 2013
    Configuration menu
    Copy the full SHA
    1648fa4 View commit details
    Browse the repository at this point in the history
  6. Add a configure --extra-prog-path flag

    Can be used to add extra dirs to the end of the program search path.
    This in mainly useful as a config file entry rather than a command line
    flag, but it'll exists as both.
    dcoutts committed Aug 10, 2013
    Configuration menu
    Copy the full SHA
    046c086 View commit details
    Browse the repository at this point in the history
  7. Use the --extra-prog-path flag in cabal-install

    We have to pass it properly in the setupWrapper. For the external build
    method we just set the $PATH rather than passing the flag. This way it
    works when talking to Setup.hs built with an older Cabal lib.
    dcoutts committed Aug 10, 2013
    Configuration menu
    Copy the full SHA
    eb789dc View commit details
    Browse the repository at this point in the history
  8. Add a sensible extra-prog-path to the default ~/.cabal/config

    e.g. extra-prog-path: /home/duncan/.cabal/bin
    
    This should help with the problem that people install tools like alex,
    happy, c2hs etc and then cabal cannot find them.
    
    Arguably we should have this as the default value for extra-prog-path,
    so that it affects existing installations, rather than just affecting
    new installations where we generate the ~/.cabal/config for the first
    time. It's easy to change if we want to do that.
    dcoutts committed Aug 10, 2013
    Configuration menu
    Copy the full SHA
    66a1bbf View commit details
    Browse the repository at this point in the history