Skip to content

Commit

Permalink
refactor: attempt to improve clarity of env var purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Nov 3, 2023
1 parent 123d332 commit b30faf2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
main:
runs-on: ubuntu-latest
env:
NATIVE_BUILD: true
CANDLEX_NIF_BUILD: true
strategy:
fail-fast: false
matrix:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Nx.default_backend(Candlex.Backend)

More details in [Nx backends](https://hexdocs.pm/nx/Nx.html#module-backends)

#### `NATIVE_BUILD`
#### `CANDLEX_NIF_BUILD`

Defaults to `false`. If `true` the native binary is built locally, which may be useful
if no precompiled binary is available for your target environment. Once set, you
Expand All @@ -50,7 +50,7 @@ Building has a number of dependencies, see *Building from source* below.

## Building from source

To build the native binary locally you need to set `NATIVE_BUILD=true`.
To build the native binary locally you need to set `CANDLEX_NIF_BUILD=true`.
Keep in mind that the compilation usually takes time.

You will need the following installed in your system for the compilation:
Expand Down
2 changes: 1 addition & 1 deletion lib/candlex/native.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule Candlex.Native do
otp_app: :candlex,
features: Application.compile_env(:candlex, :crate_features, []),
base_url: "#{source_url}/releases/download/v#{version}",
force_build: System.get_env("NATIVE_BUILD") in ["1", "true"],
force_build: System.get_env("CANDLEX_NIF_BUILD") in ["1", "true"],
mode: mode,
version: version,
nif_versions: ["2.16"],
Expand Down

0 comments on commit b30faf2

Please sign in to comment.