diff --git a/.cirrus.yml b/.cirrus.yml index 6f01cf669..02fce0ff2 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -10,6 +10,9 @@ build_task: fingerprint_script: cat postgrest.cabal stack.yaml.lock reupload_on_changes: false - build_script: stack build -j 1 --local-bin-path . --copy-bins + build_script: | + stack build -j 1 --local-bin-path . --copy-bins + strip postgrest + bin_artifacts: path: postgrest diff --git a/.github/scripts/arm/build.sh b/.github/scripts/arm/build.sh index 989a3cdaf..ea9e349b7 100644 --- a/.github/scripts/arm/build.sh +++ b/.github/scripts/arm/build.sh @@ -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 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a8b8ab357..11a239b5d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -207,6 +207,8 @@ jobs: run: ${{ matrix.deps }} - name: Build with Stack run: stack build --local-bin-path result --copy-bins + - name: Strip Executable + run: strip result/postgrest* - name: Save built executable as artifact uses: actions/upload-artifact@v4 with: diff --git a/cabal.project.non-nix b/cabal.project.non-nix index f37e81ef1..a18204e74 100644 --- a/cabal.project.non-nix +++ b/cabal.project.non-nix @@ -4,6 +4,9 @@ packages: . +package * + ghc-options: -split-sections + -- Example of depending on a forked repository (the same dependency -- would be mentioned in nix/overlays/haskell-packages.nix and -- stack.yaml, and should refer to a main branch commit of the