Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,253
    • Issues 4,253
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 394
    • Merge Requests 394
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #6094

Closed
Open
Opened May 13, 2012 by GregWeber@trac-GregWeber

runInteractiveProcess not using new PATH

run the below program with something like: rm -r foo; ghc env.hs && ./env

import System.Process( runInteractiveProcess, waitForProcess, ProcessHandle )
import System.Directory

main = do
  createDirectory "foo"
  writeFile "foo/bar" "#!/bin/sh\necho baz"
  (inH,outH,errH,procH) <- runInteractiveProcess "chmod" ["+x", "./foo/bar"] Nothing $ Just [("PATH","./foo")]
  ex <- waitForProcess procH
  print ex -- ExitSuccess
  (inH,outH,errH,procH) <- runInteractiveProcess "env" ["PATH=./foo", "bar"] Nothing $ Just [("PATH","./foo")]
  ex <- waitForProcess procH
  print ex -- ExitSuccess
  (inH,outH,errH,procH) <- runInteractiveProcess "bar" [] Nothing $ Just [("PATH","./foo")]
  ex <- waitForProcess procH
  print ex -- ExitFailure 127 (indicates command not found)
Trac metadata
Trac field Value
Version 7.4.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
7.6.1
Milestone
7.6.1
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#6094