Skip to content

Commit

Permalink
fix: do not use code:del_paths since that function is not available o…
Browse files Browse the repository at this point in the history
…n older versions of Erlang.
  • Loading branch information
yoshi-monster authored and lpil committed Dec 3, 2024
1 parent 04e66b0 commit 22319a9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog


## Unreleased

### Compiler
Expand All @@ -12,6 +13,14 @@

### Bug fix

## v1.6.3 - 2024-12-03

### Bug fixed

- Fixed a bug where Gleam would be unable to compile to BEAM bytecode on older
versions of Erlang/OTP.
([yoshi](https://github.com/joshi-monster))

## v1.6.2 - 2024-11-23

### Bug fixed
Expand Down
6 changes: 5 additions & 1 deletion compiler-cli/templates/gleam@@compile.erl
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ add_lib_to_erlang_path(Lib) ->
code:add_paths(filelib:wildcard([Lib, "/*/ebin"])).

del_lib_from_erlang_path(Lib) ->
code:del_paths(filelib:wildcard([Lib, "/*/ebin"])).
Paths = filelib:wildcard([Lib, "/*/ebin"]),
case erlang:function_exported(code, del_paths, 1) of
true -> code:del_paths(Paths);
false -> lists:foreach(fun code:del_path/1, Paths)
end.

configure_logging() ->
Enabled = os:getenv("GLEAM_LOG") /= false,
Expand Down

0 comments on commit 22319a9

Please sign in to comment.