-
-
Notifications
You must be signed in to change notification settings - Fork 238
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
Native Elixir Fixes #1021
Open
artman41
wants to merge
7
commits into
ninenines:native-elixir
Choose a base branch
from
artman41:native-elixir_fixes
base: native-elixir
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Native Elixir Fixes #1021
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
86b0649
Cause failed compilation of ex files to prevent creation of .app file
artman41 310c7b6
Allow support for Elixir v1.13 (supported by OTP 23)
artman41 71ace38
Replace my email
artman41 9919545
Account for .ex files which reference mix.exs config
artman41 3bf68d4
Convert StartMod to list so it can be written
artman41 fdeb720
Replace wildcard for ex beams for a shell command
artman41 081fd94
Simplify Ex compilation failure
artman41 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Copyright (c) 2024, Tyler Hughes <[email protected]> | ||
# Copyright (c) 2024, Tyler Hughes <[email protected]> | ||
# Copyright (c) 2024, Loïc Hoguin <[email protected]> | ||
# This file is part of erlang.mk and subject to the terms of the ISC License. | ||
|
||
|
@@ -16,7 +16,7 @@ else | |
ERL_LIBS := $(ERL_LIBS):$(DEPS_DIR)/elixir/lib/ | ||
endif | ||
|
||
elixirc_verbose_0 = @echo " EXC $(words $(EX_FILES)) files" | ||
elixirc_verbose_0 = @echo " EXC $(words $(EX_FILES)) files"; | ||
elixirc_verbose_2 = set -x; | ||
elixirc_verbose = $(elixirc_verbose_$(V)) | ||
|
||
|
@@ -25,13 +25,17 @@ define dep_autopatch_mix.erl | |
{ok, _} = application:ensure_all_started(elixir), | ||
{ok, _} = application:ensure_all_started(mix), | ||
MixFile = <<"$(call core_native_path,$(DEPS_DIR)/$1/mix.exs)">>, | ||
[{Mod, Bin}] = elixir_compiler:file(MixFile, fun(_File, _LexerPid) -> ok end), | ||
{Mod, Bin} = | ||
case elixir_compiler:file(MixFile, fun(_File, _LexerPid) -> ok end) of | ||
[{T = {_, _}, _CheckerPid}] -> T | ||
[T = {_, _}] -> T; | ||
end, | ||
{module, Mod} = code:load_binary(Mod, binary_to_list(MixFile), Bin), | ||
Project = Mod:project(), | ||
Application = try Mod:application() catch error:undef -> [] end, | ||
StartMod = case lists:keyfind(mod, 1, Application) of | ||
{mod, {StartMod0, _StartArgs}} -> | ||
StartMod0; | ||
atom_to_list(StartMod0); | ||
_ -> | ||
"" | ||
end, | ||
|
@@ -139,7 +143,15 @@ define compile_ex.erl | |
ModCode = list_to_atom("Elixir.Code"), | ||
ModCode:put_compiler_option(ignore_module_conflict, true), | ||
ModComp = list_to_atom("Elixir.Kernel.ParallelCompiler"), | ||
{ok, Modules, _} = ModComp:compile_to_path([$(call comma_list,$(patsubst %,<<"%">>,$(EX_FILES)))], <<"ebin/">>), | ||
lists:foreach(fun(E) -> io:format("~p ", [E]) end, Modules), | ||
halt() | ||
ModMixProject = list_to_atom("Elixir.Mix.Project"), | ||
ModMixProject:in_project($(PROJECT), ".", [], fun(_MixFile) -> | ||
case ModComp:compile_to_path([$(call comma_list,$(patsubst %,<<"%">>,$(EX_FILES)))], <<"ebin/">>) of | ||
{ok, Modules, _} -> | ||
halt(0); | ||
{error, [], _WarnedModules} -> | ||
halt(0); | ||
{error, _ErroredModules, _WarnedModules} -> | ||
halt(1) | ||
end | ||
end) | ||
endef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't do that, the wildcard function operates on cache that is updated at the start of executing the target, so it won't know about the new Elixir beam files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, leave it with me and I'll double check against what I have locally - could be the case that I need to rollback that change