Created
August 20, 2015 05:17
-
-
Save amutake/a58acf4121724bf3b10a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env runghc | |
import Distribution.Simple.InstallDirs -- Cabal package | |
( platformTemplateEnv | |
, fromPathTemplate, toPathTemplate | |
, substPathTemplate | |
) | |
import Distribution.System (buildPlatform) -- Cabal package | |
import System.Process -- process package | |
( shell | |
, readCreateProcess | |
) | |
main :: IO () | |
main = do | |
compiler <- filter (/= '\n') . ("ghc-" ++) <$> | |
readCreateProcess (shell "ghc --numeric-version") "" | |
let platform = buildPlatform | |
let env = platformTemplateEnv platform | |
putStrLn $ fromPathTemplate $ substPathTemplate env $ toPathTemplate $ "$arch-$os-" ++ compiler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./abi.hs | |
x86_64-osx-ghc-7.10.2 |
cabal-install の Main から Distribution.Client.Install.install
-> ... -> Distribution.Simple.Program.Db.lookupProgramVersion
まで追っていったけど諦めた
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
System.Info.compilerVersion
が patch level をとってくれないのどうなの