aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2025-03-19 12:27:02 +0100
committerLoïc Hoguin <[email protected]>2025-03-19 17:07:01 +0100
commitf7bc2bd13f32af13af1a8e37745b935068c45671 (patch)
treec419277fe14545eeb2bde85621d6e1889844d4ee
parenta5e7fd2ed1f7d756edee8e19af8bb639e1287ee6 (diff)
downloaderlang.mk-f7bc2bd13f32af13af1a8e37745b935068c45671.tar.gz
erlang.mk-f7bc2bd13f32af13af1a8e37745b935068c45671.tar.bz2
erlang.mk-f7bc2bd13f32af13af1a8e37745b935068c45671.zip
Properly handle asdf-installed Elixirelixir-related-fixes
-rw-r--r--.github/workflows/ci.yaml17
-rw-r--r--core/elixir.mk7
2 files changed, 23 insertions, 1 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 0ff2e4d..552859a 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@v3
+ 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)