diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-07-07 10:46:29 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-07-27 12:01:51 -0400 |
commit | f481c1890066b4dac78d981ca680fb01cfff9a11 (patch) | |
tree | 5dd9288934f3ae2497e22cd75d8a5c505e79fdcc /hadrian/bindist | |
parent | 172fd5d1b2a88ce77a6d75ca0d96e5b28ad59f7c (diff) | |
download | haskell-f481c1890066b4dac78d981ca680fb01cfff9a11.tar.gz |
packaging: Create both versioned and unversioned executables
Before we would just copy the unversioned executable into the bindist.
Now the actual executable is copied into the bindist and a version
suffix is added. Then a wrapper or symlink is added which points to the
versioned executable.
Fixes #20074
Diffstat (limited to 'hadrian/bindist')
-rw-r--r-- | hadrian/bindist/version-wrapper.hs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/hadrian/bindist/version-wrapper.hs b/hadrian/bindist/version-wrapper.hs new file mode 100644 index 0000000000..dc7c344c5c --- /dev/null +++ b/hadrian/bindist/version-wrapper.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE CPP #-} +module Main (main) where + +import System.Environment (getArgs, getExecutablePath) +import System.Exit (exitWith) +import System.Process (spawnProcess, waitForProcess) +import System.FilePath (replaceFileName) + +exe = EXE_PATH + +main :: IO () +main = do + args <- getArgs + exe_name <- getExecutablePath + ph <- spawnProcess (replaceFileName exe_name exe) args + code <- waitForProcess ph + exitWith code |