Skip to content

Commit

Permalink
fix(typegate): fix tmp dir issue, bump to 0.3.4 (#583)
Browse files Browse the repository at this point in the history
- Fixes an issue with the prisma migration code being unable to properly
`mktmpd` when running in the `typegate` images.
- Removes `cross` usage for all but the `aarch64-unknown-linux-gnu`
target in the `meta-cli` release jobs. Deno doesn't like being cross
compiled, doesn't like being built by the cross toolchain in general
(even for the native target). The consequence of all this is that the
`aarch64-unknown-linux-gnu` target will temporarily lack the `full`
version builds.
- This also bumps the version of the 0.3.4 to get the fix out.

#### Motivation and context

The main `TMP_DIR` was not created properly in the `typegate`
`Dockerfile`.

#### Migration notes

_No changes required_

### Checklist

- [ ] The change come with new or modified tests
- [ ] Hard-to-understand functions have explanatory comments
- [ ] End-user documentation is updated to reflect the change
  • Loading branch information
Yohe-Am authored Feb 10, 2024
1 parent efabeae commit 394440a
Show file tree
Hide file tree
Showing 29 changed files with 299 additions and 263 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- os: macos-latest
target: x86_64-apple-darwin
suffix: ""
- os: macos-latest
- os: macos-14
target: aarch64-apple-darwin
suffix: ""
- os: ubuntu-latest
Expand All @@ -102,32 +102,41 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-${{ matrix.target }}
- shell: bash
- run: |
# sometimes, dtolnay/rust-toolchain does not select the correct default target
rustup target add ${{ matrix.target }}
# we use cross for building on this platform
- if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
shell: bash
env:
# arguments for our custom cross.Dockerfile
CROSS_BUILD_OPTS: "--build-arg 'CROSS_TARGET=${{ matrix.target }}'"
# deno won't cross compile unless this var is set
# due to issues with snapshots (not in use currently)
# once we have arm64 linux builders, we won't need to cross compile anymore
DENO_SKIP_CROSS_BUILD_CHECK: 1
run: |
# sometimes, dtolnay/rust-toolchain does not select the correct default target
rustup target add ${{ matrix.target }}
cargo install cross
cross build --release --locked --package meta-cli --target ${{ matrix.target }} --features typegate -v
# NOTE: we only build the thin cli
cross build --release --locked --package meta-cli --target ${{ matrix.target }}
# we cd next to the file so that the its parent dirs
# aren't present in the tar
cd target/${{ matrix.target }}/release/
tar czvf ../../../meta-cli-${{ steps.latest-tag.outputs.tag }}-${{ matrix.target }}.tar.gz "meta${{ matrix.suffix }}"
cd ../../../
- if: ${{ matrix.target != 'aarch64-unknown-linux-gnu' }}
shell: bash
run: |
cargo build --release --locked --package meta-cli --target ${{ matrix.target }} --features typegate -v
cd target/${{ matrix.target }}/release/
tar czvf ../../../meta-cli-full-${{ steps.latest-tag.outputs.tag }}-${{ matrix.target }}.tar.gz "meta${{ matrix.suffix }}"
cd ../../../
cross build --release --locked --package meta-cli --target ${{ matrix.target }}
cargo build --release --locked --package meta-cli --target ${{ matrix.target }}
cd target/${{ matrix.target }}/release/
tar czvf ../../../meta-cli-${{ steps.latest-tag.outputs.tag }}-${{ matrix.target }}.tar.gz "meta${{ matrix.suffix }}"
cd ../../../
- uses: svenstaro/upload-release-action@v2
# full meta-cli is not avail for arm64 linux (waiting on arm64 linux machines for Gh CI)
- if: ${{ matrix.target != 'aarch64-unknown-linux-gnu' }}
uses: svenstaro/upload-release-action@v2
with:
tag: ${{ steps.latest-tag.outputs.tag }}
file: "meta-cli-full-${{ steps.latest-tag.outputs.tag }}-${{ matrix.target }}.tar.gz"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ jobs:
include:
- os: macos-latest
activate: "source .venv/bin/activate"
- os: macos-14
activate: "source .venv/bin/activate"
#- os: windows-latest
# activate: '.venv\Scripts\activate.bat'
steps:
Expand Down Expand Up @@ -179,6 +181,8 @@ jobs:
include:
- platform: linux/amd64
runner: ubuntu-latest
# FIXME: try macos-14 runner once all actions support it
# docker buildx action broken as of 2024-02-09
- platform: linux/arm64
runner: custom-macos
steps:
Expand Down
Loading

0 comments on commit 394440a

Please sign in to comment.