Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation on how to enable compilation of binary dependencies. #1625

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions docs/common-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,36 @@ in {
];
}
```

### Compile x86 dependencies on ARM Macs via Rosetta

If you want to also compile dependencies for x86, you can add dependencies to `packages`:

```nix
packages = with rosettaPkgs; [
# these are the packages required for pymssql
freetds
krb5
openssl
];
```

And switch the compiler to x86:

```nix
stdenv = rosettaPkgs.stdenv;
```

Then, in the generated shell, you can compile software for x86, like `pymssql` or `ibm_db`. However some creative DYLD_FALLBACK_LIBRARY_PATH may be required to make some dependency libraries available to the x86 binaries:

```sh
export DYLD_FALLBACK_LIBRARY_PATH="${rosettaPkgs.lib.makeLibraryPath [ rosettaPkgs.gcc14.cc] }:$DYLD_FALLBACK_LIBRARY_PATH"
git clone [email protected]:pymssql/pymssql.git
${rosettaPkgs.python312Full}/bin/python3 -m venv venv
source venv/bin/activate
(
cd pymssql
pip install -e .
)
pip install ibm_db
```