ci: Reduce file size of cabal and stack based builds
By passing -split-sections to all dependencies, GHC will link only the modules we actually use and not the full package for each dependency. This does neither work on MacOS nor Windows, thus we don't do it for stack right now. Stripping unused symbols in CI will further decrease the size of those files.
This commit is contained in:
committed by
Wolfgang Walther
parent
cc9b725005
commit
0eca2954b3
@@ -55,10 +55,14 @@ cd ~/$SCRIPT_DIR
|
||||
git clone https://github.com/PostgREST/postgrest.git
|
||||
cd postgrest
|
||||
git checkout $PGRST_GITHUB_COMMIT
|
||||
cp cabal.project.non-nix cabal.project
|
||||
cabal v2-update && cabal v2-build
|
||||
|
||||
# Copy the built binary to the Dockerfile directory
|
||||
# Strip unused symbols from executable
|
||||
PGRST_BIN=$(cabal exec which postgrest | tail -1)
|
||||
strip $PGRST_BIN
|
||||
|
||||
# Copy the built binary to the Dockerfile directory
|
||||
cp $PGRST_BIN ~/$DOCKER_BUILD_DIR
|
||||
|
||||
# Move and compress the built binary
|
||||
|
||||
Reference in New Issue
Block a user