Commit ab5cd566 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Don't use deprecated getComponentLocalBuildInfo.



Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 69e19add
......@@ -11,6 +11,9 @@
module Distribution.Client.Run ( run, splitRunArgs )
where
import Distribution.Types.TargetInfo (targetCLBI)
import Distribution.Types.LocalBuildInfo (componentNameTargets)
import Distribution.Client.Utils (tryCanonicalizePath)
import Distribution.PackageDescription (Executable (..),
......@@ -23,7 +26,6 @@ import Distribution.Simple.Build.PathsModule (pkgPathEnvVar)
import Distribution.Simple.BuildPaths (exeExtension)
import Distribution.Simple.LocalBuildInfo (ComponentName (..),
LocalBuildInfo (..),
getComponentLocalBuildInfo,
depLibraryPaths)
import Distribution.Simple.Utils (die, notice, warn,
rawSystemExitWithEnv,
......@@ -130,8 +132,10 @@ run verbosity lbi exe exeArgs = do
-- Add (DY)LD_LIBRARY_PATH if needed
env' <- if withDynExe lbi
then do let (Platform _ os) = hostPlatform lbi
clbi = getComponentLocalBuildInfo lbi
(CExeName (exeName exe))
clbi <- case componentNameTargets lbi (CExeName (exeName exe)) of
[target] -> return (targetCLBI target)
[] -> die "run: Could not find executable in LocalBuildInfo"
_ -> die "run: Found multiple matching exes in LocalBuildInfo"
paths <- depLibraryPaths True False lbi clbi
return (addLibraryPath os paths env)
else return env
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment