From f32f8685ec3e48618bb0d8a05785a8a356a6e80c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 19 Mar 2025 12:27:02 +0100 Subject: Properly handle asdf-installed Elixir --- .github/workflows/ci.yaml | 17 +++++++++++++++++ core/elixir.mk | 7 ++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0ff2e4d..c049f12 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -119,6 +119,23 @@ jobs: path: | test/test_*/ + check-asdf-elixir: + runs-on: ubuntu-latest + steps: + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install asdf along with Erlang/OTP and Elixir + uses: asdf-vm/actions/install@v4 + with: + tool_versions: + erlang latest + elixir latest + + - name: Run tests + run: make check c=core-elixir -j4 -k + check-hex: strategy: fail-fast: false diff --git a/core/elixir.mk b/core/elixir.mk index 8d1dba9..eb5c487 100644 --- a/core/elixir.mk +++ b/core/elixir.mk @@ -10,7 +10,12 @@ export ELIXIR ifeq ($(ELIXIR),system) # We expect 'elixir' to be on the path. -ELIXIR_LIBS ?= $(dir $(shell readlink -f `which elixir`))/../lib +ELIXIR_BIN ?= $(shell readlink -f `which elixir`) +ELIXIR_LIBS ?= $(abspath $(dir $(ELIXIR_BIN))/../lib) +# Fallback in case 'elixir' is a shim. +ifeq ($(wildcard $(ELIXIR_LIBS)/elixir/),) +ELIXIR_LIBS = $(abspath $(shell elixir -e 'IO.puts(:code.lib_dir(:elixir))')/../) +endif ELIXIR_LIBS := $(ELIXIR_LIBS) export ELIXIR_LIBS ERL_LIBS := $(ERL_LIBS):$(ELIXIR_LIBS) -- cgit v1.2.3