2022-06-16 20:10:59 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
Nix: Get the Nix shell working on macOS/aarch64.
Improvements to the Nix configuration so that macOS is supported.
Microsoft SQL Server is still not supported (yet; I have something in mind there), but the rest works. You can still use Homebrew to install the SQL Server drivers.
I had to make the following changes:
* I updated nixpkgs, because it's been a while.
* I made `ODBCINSTINI` optional so that it's not loaded on macOS, as it depends on `msodbcsql17`, which is broken on macOS.
* I upgraded OpenSSL.
* I set `DYLD_LIBRARY_PATH` on macOS so GHC finds OpenSSL; otherwise, it uses the wrong version of `libcrypto`, and fails with a fun error:
> WARNING: ghc is loading libcrypto in an unsafe way
* I patched GHC to fix compilation on macOS (copied from https://github.com/NixOS/nixpkgs/pull/149942).
To test this out, you can run `nix develop` (or install [direnv][] and add `use flake` to _.envrc.local_), and then try building HGE in the shell provided.
Fair warning: GHC needs to be built, and takes _aaages_ the first time. If this becomes useful to others, we can set up a shared cache.
[direnv]: https://direnv.net/
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5989
GitOrigin-RevId: 7130738d47709c37778b31c134061758ce23e959
2022-09-30 22:14:53 +03:00
|
|
|
### This is an example .envrc.local file you can start with. Uncomment the parts
|
|
|
|
### you'd like to use, and copy this to `.envrc.local`.
|
2022-06-16 20:10:59 +03:00
|
|
|
|
2022-10-07 00:04:19 +03:00
|
|
|
### Enable providing tooling with the Nix package manager
|
|
|
|
### (read the commentary in flake.nix first)
|
2022-06-16 20:10:59 +03:00
|
|
|
# use flake
|
|
|
|
|
2022-10-07 00:04:19 +03:00
|
|
|
### Enable providing NodeJS versions with `nvm`
|
2022-09-14 23:38:57 +03:00
|
|
|
# use nvm
|
2022-06-22 14:36:30 +03:00
|
|
|
|
2022-10-07 00:04:19 +03:00
|
|
|
### Enable providing GHC versions with `ghcup`
|
2022-09-14 23:38:57 +03:00
|
|
|
# use ghcup
|
2023-05-31 13:38:06 +03:00
|
|
|
|
|
|
|
### Raise open file limit to stop `api-tests` struggling
|
|
|
|
# ulimit -n 10240
|
|
|
|
|
|
|
|
### Export key for running BigQuery tests locally. This depends on a
|
|
|
|
### `bigquery-service-account-key.json` key living in the directory above
|
|
|
|
### the `graphql-engine` repository.
|
|
|
|
# HASURA_BIGQUERY_PROJECT_ID='regency-polecat-beehive'
|
|
|
|
# export HASURA_BIGQUERY_PROJECT_ID
|
|
|
|
# HASURA_BIGQUERY_SERVICE_KEY=$(cat ../bigquery-service-account.json)
|
|
|
|
# export HASURA_BIGQUERY_SERVICE_KEY
|
|
|
|
|
|
|
|
### Enable to use the correct image for SQLServer on an M1
|
|
|
|
### (the env var is used in our Docker Compose files)
|
|
|
|
# export MSSQL_IMAGE='mcr.microsoft.com/azure-sql-edge'
|
|
|
|
|
|
|
|
### Export EE license key for running pro tests locally
|
|
|
|
### This depends on a `ee-license-key.txt` living in the directory above
|
|
|
|
### the `graphql-engine` repository
|
|
|
|
# HASURA_GRAPHQL_EE_LICENSE_KEY=$(cat ../ee-license-key.txt)
|
|
|
|
# export HASURA_GRAPHQL_EE_LICENSE_KEY
|