Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15
ghc
reproducible-tmp-names.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File reproducible-tmp-names.patch of Package ghc
This is an attempt to make GHC build reproducible. The name of .c files may end up in the resulting binary (in the debug section), but not the directory. Instead of using the process id, create a hash from the command line arguments, and assume that is going to be unique. Index: ghc-8.0.2/compiler/main/SysTools.hs =================================================================== --- ghc-8.0.2.orig/compiler/main/SysTools.hs +++ ghc-8.0.2/compiler/main/SysTools.hs @@ -65,6 +65,7 @@ import Util import DynFlags import Exception +import Fingerprint import LlvmCodeGen.Base (llvmVersionStr, supportedLlvmVersion) @@ -1145,8 +1146,8 @@ mapping <- readIORef dir_ref case Map.lookup tmp_dir mapping of Nothing -> do - pid <- getProcessID - let prefix = tmp_dir </> "ghc" ++ show pid ++ "_" + pid <- getStableProcessID + let prefix = tmp_dir </> "ghc" ++ pid ++ "_" mask_ $ mkTempDir prefix Just dir -> return dir where @@ -1562,6 +1563,13 @@ getProcessID = System.Posix.Internals.c_getpid >>= return . fromIntegral #endif +-- Debian-specific hack to get reproducible output, by not using the "random" +-- pid, but rather something determinisic +getStableProcessID :: IO String +getStableProcessID = do + args <- getArgs + return $ take 4 $ show $ fingerprintString $ unwords args + -- Divvy up text stream into lines, taking platform dependent -- line termination into account. linesPlatform :: String -> [String]
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor