From df369f426f9470dfa05f0010f53eb0181903ff29 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 10 May 2021 03:38:51 -0700 Subject: [PATCH] Clearer docs for building Summary: Per title. Reviewed By: fabiomassimo Differential Revision: D28284707 fbshipit-source-id: 60dde8653acd6bc05a570d622490f4632fc9f59a --- scripts/bump/README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/scripts/bump/README.md b/scripts/bump/README.md index 2a97c1dfe..7f01e6f41 100644 --- a/scripts/bump/README.md +++ b/scripts/bump/README.md @@ -54,3 +54,43 @@ can be quite effective in reducing it: build: split-objs: true ``` + +## Updating the binaries + +The platform-specific binaries in the parent directory (`bump.lnx64` and `bump.mac`) +need to be manually updated after every change to the source here. + +To do this, first build the binary for Mac: + +``` +stack build +cp .stack-work/install/x86_64-osx//8.6.5/bin/bump ../bump.mac +``` + +(The build ID is printed as part of the stack build run.) + +Then, add this to the options from above to produce static binaries on Linux +(otherwise, there's a good chance Sandcastle won't run it). The binary section +should then look like this: + +*package.yaml* +```diff +diff --git a/xplat/sonar/scripts/bump/package.yaml b/xplat/sonar/scripts/bump/package.yaml +--- a/xplat/sonar/scripts/bump/package.yaml ++++ b/xplat/sonar/scripts/bump/package.yaml +@@ -12,3 +12,4 @@ + bump: + source-dirs: . + main: bump.hs ++ ghc-options: -optl-static -optl-pthread -fPIC + +``` + +With the docker daemon running, execute: + +``` +stack build --docker +cp .stack-work/install/x86_64-linux-//8.6.5/bin/bump ../bump.lnx64 +``` + +Commit the changes, done.