Skip to content

Commit 9edaf28

Browse files
authored
chore: adding support for x86_64-darwin (#1310)
* chore: adding support for x86_64-darwin * fix: handle logic for various darwin platforms * fix: != &&, == || * fix: support system here too * feature: support added for x86_64-darwin * fix: increase timeout so that aws access does not expire * fix: duration was too high * chore: see if 2 hours will work * fix: try more than 2 less than 3 hrs * chore: try a bit lower * chore: bump down lower * chore: set to the apparent max * chore: limit nix build to 15 on x86_64-darwin --------- Co-authored-by: Sam Rose <samuel@supabase.io>
1 parent c2c383b commit 9edaf28

File tree

5 files changed

+24
-14
lines changed

5 files changed

+24
-14
lines changed

.github/workflows/nix-build.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ jobs:
2424
arch: arm64
2525
- runner: macos-latest
2626
arch: arm64
27+
- runner: macos-13
28+
arch: amd64
2729
runs-on: ${{ matrix.runner }}
28-
30+
timeout-minutes: 180
2931
steps:
3032

3133
- name: Check out code
@@ -40,30 +42,31 @@ jobs:
4042
role-to-assume: ${{ secrets.DEV_AWS_ROLE }}
4143
aws-region: "us-east-1"
4244
output-credentials: true
45+
role-duration-seconds: 7200
4346
- name: write secret key
4447
# use python so we don't interpolate the secret into the workflow logs, in case of bugs
4548
run: |
4649
python -c "import os; file = open('nix-secret-key', 'w'); file.write(os.environ['NIX_SIGN_SECRET_KEY']); file.close()"
4750
env:
4851
NIX_SIGN_SECRET_KEY: ${{ secrets.NIX_SIGN_SECRET_KEY }}
4952
- name: Log in to Docker Hub
50-
if: matrix.runner != 'macos-latest'
53+
if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13'
5154
uses: docker/login-action@v2
5255
with:
5356
username: ${{ secrets.DOCKER_USERNAME }}
5457
password: ${{ secrets.DOCKER_PASSWORD }}
5558
- name: Build psql bundle with nix
56-
if: matrix.runner != 'macos-latest'
59+
if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13'
5760
run: docker build -t base_nix -f docker/nix/Dockerfile .
5861
- name: Run build psql bundle
59-
if: matrix.runner != 'macos-latest'
62+
if: matrix.runner != 'macos-latest' && matrix.runner != 'macos-13'
6063
run: |
6164
docker run -e AWS_ACCESS_KEY_ID=${{ env.AWS_ACCESS_KEY_ID }} \
6265
-e AWS_SECRET_ACCESS_KEY=${{ env.AWS_SECRET_ACCESS_KEY }} \
6366
-e AWS_SESSION_TOKEN=${{ env.AWS_SESSION_TOKEN }} \
6467
base_nix bash -c "./workspace/docker/nix/build_nix.sh"
6568
- name: Build psql bundle on macos
66-
if: matrix.runner == 'macos-latest'
69+
if: matrix.runner == 'macos-latest' || matrix.runner == 'macos-13'
6770
run: |
6871
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --no-confirm \
6972
--extra-conf "substituters = https://cache.nixos.org https://nix-postgres-artifacts.s3.amazonaws.com" \

ansible/vars.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ postgres_major:
1111

1212
# Full version strings for each major version
1313
postgres_release:
14-
postgres15: "15.8.1.006"
15-
postgres16: "16.3.1.012"
14+
postgres15: "15.8.1.007"
15+
postgres16: "16.3.1.013"
1616

1717
# Non Postgres Extensions
1818
pgbouncer_release: "1.19.0"

docker/nix/build_nix.sh

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ nix --version
55
if [ -d "/workspace" ]; then
66
cd /workspace
77
fi
8-
nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_15 -L --no-link
9-
nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_16 -L --no-link
10-
nix build .#psql_15/bin -o psql_15
11-
nix build .#psql_16/bin -o psql_16
12-
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_15
13-
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_16
8+
if [ $(nix-instantiate --eval -E builtins.currentSystem | tr -d '"') == "x86_64-darwin" ]; then
9+
nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_15 -L --no-link
10+
nix build .#psql_15/bin -o psql_15
11+
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_15
12+
else
13+
nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_15 -L --no-link
14+
nix build .#checks.$(nix-instantiate --eval -E builtins.currentSystem | tr -d '"').psql_16 -L --no-link
15+
nix build .#psql_15/bin -o psql_15
16+
nix build .#psql_16/bin -o psql_16
17+
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_15
18+
nix copy --to s3://nix-postgres-artifacts?secret-key=nix-secret-key ./psql_16
19+
fi

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
system.x86_64-linux
1818
system.aarch64-linux
1919
system.aarch64-darwin
20+
system.x86_64-darwin
2021
];
2122
in
2223
flake-utils.lib.eachSystem ourSystems (system:

nix/ext/plv8.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ stdenv.mkDerivation (finalAttrs: {
120120
description = "V8 Engine Javascript Procedural Language add-on for PostgreSQL";
121121
homepage = "https://plv8.github.io/";
122122
maintainers = with maintainers; [ samrose ];
123-
platforms = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
123+
platforms = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
124124
license = licenses.postgresql;
125125
};
126126
})

0 commit comments

Comments
 (0)