Skip to content

(Mix) Could not compile dependency :lfe - Elixir 1.15.7 OTP 26 #489

Closed

Description

@simonelnahas

Repo:
https://github.com/simonelnahas/lfe_test

# mix.exs
defmodule LfeTest.MixProject do
  use Mix.Project

  def project do
    [
      app: :lfe_test,
      version: "0.1.0",
      elixir: "~> 1.15",
      start_permanent: Mix.env() == :prod,
      deps: deps()
    ]
  end

  # Run "mix help compile.app" to learn about applications.
  def application do
    [
      extra_applications: [:logger]
    ]
  end

  # Run "mix help deps" to learn about dependencies.
  defp deps do
    [
      # {:dep_from_hexpm, "~> 0.3.0"},
      # {:dep_from_git, git: "https://github.com/elixir-lang/my_dep.git", tag: "0.1.0"}
      {:lfe, "2.1.3"}
    ]
  end
end

> elixir --version
Erlang/OTP 26 [erts-14.1.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

Elixir 1.15.7 (compiled with Erlang/OTP 24)




> mix deps.get
Resolving Hex dependencies...
Resolution completed in 0.009s
New:
  lfe 2.1.3
* Getting lfe (Hex package)


> mix compile
===> Analyzing applications...
===> Compiling lfe
src/cl.lfe: error writing file
===> Hook for app_compile failed!

** (Mix) Could not compile dependency :lfe, "/Users/simonelnahas/.asdf/installs/elixir/1.15/.mix/elixir/1-15/rebar3 bare compile --paths /Users/simonelnahas/Documents/Developer/lfe_test/_build/dev/lib/*/ebin" command failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile lfe --force", update it with "mix deps.update lfe" or clean it with "mix deps.clean lfe"
> rebar3 lfe repl
===> Verifying dependencies...
Erlang/OTP 26 [erts-14.1.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

   ..-~.~_~---..
  (      \\     )    |   A Lisp-2+ on the Erlang VM
  |`-.._/_\\_.-':    |   Type (help) for usage info.
  |         g |_ \   |
  |        n    | |  |   Docs: http://docs.lfe.io/
  |       a    / /   |   Source: http://github.com/lfe/lfe
   \     l    |_/    |
    \   r     /      |   LFE v2.1.2 (abort with ^C; enter JCL with ^G)
     `-E___.-'

lfe> 

Activity

  1. simonelnahas commented on May 15, 2024

    @simonelnahas
    Author

    Running on MacOS 1.14.1

  2. simonelnahas commented on May 23, 2024

    @simonelnahas
    Author

    Upgrading to LFE 2.1.4, didn't make a difference.

  3. oubiwann commented on Aug 3, 2024

    @oubiwann
    Member

    My first guess is that this is a problem with the LFE mix plugin? Have you filed a ticket there or chatted with the dev?

    If that guess is correct, I wonder if the plugin (or config?) needs some help with ordering ... LFE's Erlang files need to be compiled before the supporting libs (clj.lfe and cl.lfe) can be compiled ... I would need to see full build debug logs to determine if this second guess is correct.

    We accomplish this in the LFE project with the explicit ordering of our make targets (see https://github.com/lfe/lfe/blob/develop/Makefile, if you read GNU make).

    The LFE rebar3 plugin has this in its "DNA" as it were ... it always compiles the Erlang files before compiling the LFE files.

  4. diasbruno commented on Nov 3, 2025

    @diasbruno
    Contributor

    LFE's Erlang files need to be compiled before the supporting libs (clj.lfe and cl.lfe) can be compiled

    It seems to be the problem.

    Elixir 1.18.4
    Erlang/OTP 27
    LFE 2.2.0

    [nix-shell:~/Programming/lfe_test]$ mix deps.compile
    ===> Analyzing applications...
    ===> Compiling lfe
    src/cl.lfe: error writing file
    ===> Hook for app_compile failed!
    
    ** (Mix) Could not compile dependency :lfe, 
    "/Users/dias/.mix/elixir/1-18-otp-27/rebar3 bare compile \
      --paths /Users/dias/Programming/lfe_test/_build/dev/lib/*/ebin" 
    command failed. Errors may have been logged above. You can recompile this dependency 
    with "mix deps.compile lfe --force",  update it with "mix deps.update lfe" 
    or clean it with "mix deps.clean lfe"
  5. diasbruno commented on Nov 3, 2025

    @diasbruno
    Contributor
    ===> Load global config file /Users/dias/.config/rebar3/rebar.config
    ===> 27.3.4.3 satisfies the requirement for minimum OTP version 18
    ===> Evaluating config script "/Users/dias/.cache/rebar3/plugins/hex_core/rebar.config.script"
    ===> Compile (apps)
    ===> Compile (apps)
    ===> Compile (apps)
    ===> Evaluating config script "/Users/dias/.cache/rebar3/plugins/lfe/rebar.config.script"
    ===> Evaluating config script "/Users/dias/.cache/rebar3/plugins/lfe/rebar.config.script"
    ===> Compile (apps)
    ===> Intializing rebar3_lfe plugin ...
    ===> Default eunit options help: ...
    ===> Expanded command sequence to be run: []
    ===> Running provider: do
    ===> Expanded command sequence to be run: [app_discovery,{bare,compile}]
    ===> Running provider: app_discovery
    ===> Found top-level apps: [lfe]
    	using config: [{src_dirs,["src"]},{lib_dirs,["apps/*","lib/*","."]}]
    ===> Running provider: {bare,compile}
    ===> Compile (untagged)
    ===> Running hooks for compile in app lfe (/Users/dias/Programming/lfe_test/deps/lfe) with configuration:
    ===> 	{pre_hooks, []}.
    ===> Running hooks for erlc_compile in app lfe (/Users/dias/Programming/lfe_test/deps/lfe) with configuration:
    ===> 	{pre_hooks, []}.
    ===> Analyzing applications...
    ===> Compiling lfe
    ===> compile options: {erl_opts, [debug_info,
                                      {d,'ERLANG_VERSION',"27.3.4.3"},
                                      {d,'HAS_MAPS',true},
                                      {d,'HAS_FULL_KEYS',true},
                                      {d,'NEW_REC_CORE',true},
                                      {d,'NEW_RAND',true},
                                      {d,'NEW_BOOL_GUARD',true},
                                      {d,'HAS_FLOOR',true},
                                      {d,'HAS_CEIL',true},
                                      {d,'NEW_STACKTRACE',true},
                                      {d,'EEP48',true},
                                      {d,'OTP27_MAYBE',true}]}.
    ===> files to analyze ["/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_edlin_expand.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_shell.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_internal.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_macro_export.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_io_write.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_docs.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_lib.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_codegen.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_comp.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_struct.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfescript.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_gen.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/scm.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_io_format.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_codelift.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_scan.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_lint.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_macro_record.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_bits.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_init.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_abstract_code.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_io_pretty.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_translate.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_macro_struct.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_error.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_shell_docs.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_macro_include.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_eval.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_eval_bits.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_ms.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_qlc.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_macro.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_parse.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_env.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_types.erl",
                           "/Users/dias/Programming/lfe_test/deps/lfe/src/lfe_io.erl"]
    ===>      Compiled lfe_qlc.erl
    ===>      Compiled lfe.erl
    ===>      Compiled lfe_shell_docs.erl
    ===>      Compiled lfe_env.erl
    ===>      Compiled lfe_io.erl
    ===>      Compiled lfe_lib.erl
    ===>      Compiled lfe_internal.erl
    ===>      Compiled lfe_bits.erl
    ===>      Compiled lfe_parse.erl
    ===>      Compiled lfe_abstract_code.erl
    ===>      Compiled lfe_macro_record.erl
    ===>      Compiled lfe_eval_bits.erl
    ===>      Compiled lfe_struct.erl
    ===>      Compiled scm.erl
    ===>      Compiled lfe_ms.erl
    ===>      Compiled lfe_types.erl
    ===>      Compiled lfe_comp.erl
    ===>      Compiled lfe_io_pretty.erl
    ===>      Compiled lfe_codelift.erl
    ===>      Compiled lfescript.erl
    ===>      Compiled lfe_gen.erl
    ===>      Compiled lfe_io_format.erl
    ===>      Compiled lfe_init.erl
    ===>      Compiled lfe_shell.erl
    ===>      Compiled lfe_edlin_expand.erl
    ===>      Compiled lfe_docs.erl
    ===>      Compiled lfe_io_write.erl
    ===>      Compiled lfe_codegen.erl
    ===>      Compiled lfe_macro_export.erl
    ===>      Compiled lfe_error.erl
    ===>      Compiled lfe_macro_struct.erl
    ===>      Compiled lfe_macro_include.erl
    ===>      Compiled lfe_scan.erl
    ===>      Compiled lfe_macro.erl
    ===>      Compiled lfe_eval.erl
    ===>      Compiled lfe_lint.erl
    ===>      Compiled lfe_translate.erl
    ===> Running hooks for erlc_compile in app lfe (/Users/dias/Programming/lfe_test/deps/lfe) with configuration:
    ===> 	{post_hooks, []}.
    ===> Running hooks for app_compile in app lfe (/Users/dias/Programming/lfe_test/deps/lfe) with configuration:
    ===> 	{pre_hooks, [{"(linux|darwin|solaris|freebsd|netbsd|openbsd)",
                          app_compile,
                          "bin/lfescript bin/lfec -o $REBAR_DEPS_DIR/lfe/ebin src/*.lfe"}]}.
    src/cl.lfe: error writing file
    ===> Hook for app_compile failed!
  6. iprog4u commented on Nov 3, 2025

    @iprog4u
  7. oubiwann commented on Nov 3, 2025

    @oubiwann
    Member

    @diasbruno do you know if Mix has a directive like rebar.config does for "first files"? Or if it reads rebar.config files at all? I have several projects where I need to add a couple of entries for files that need to be compile first ...

  8. diasbruno commented on Nov 3, 2025

    @diasbruno
    Contributor

    From what I debugged, it seems that it is trying to write the file in a path that was not created.

    Image

    Before writing the file, I added the filelib:ensure_dir(Name), and it compile ok.

    The question is that in don't know who must be responsible to create the building path.

  9. oubiwann commented on Nov 4, 2025

    @oubiwann
    Member

    I'm pretty confused :-( I'm seeing too many different things and I don't have a clear picture of what's going on:

    • I see a mix project that doesn't pull in a mix LFE plugin (!)
    • I see rebar3 and rebar3_lfe logging output, but I'm not sure how it got pulled into the Elixir mix project context (?)
    • looking at the mix docs, I see specific compiler options in mix itself (elixir, erlang, leex, yecc) ... which reinforces my general feeling that there should be something that speaks mix that compiles LFE (i.e., an LFE mix plugin)

    Also, LFE itself ensures it has everything it needs to build via the Makefile. We also added a secondary build route using rebar3 for rebar3 projects that pull in LFE as a dependency ... but it's very minimal: basically pre-hooks that tie into the standard LFE build route (Makefile). There is a rebar config script for defining Erlang version specific operations (again, a convenience). But note that there is nothing rebar3 plugin specific in LFE -- all of that has to be provided by the rebar3_lfe plugin (using all the compile hooks, the rest of the rebar3 API, etc.).

    To cut my rambling short, this really feels like it should either be a ticket in the lfe mix repo, or a ticket in the rebar3_lfe repo ...

    That being said, we can still keep discussing here until everything is clear :-) Questions I need answers to in order to better help:

    • Is the mix LFE plugin being used? If not, why?
    • How is rebar3/rebar3_lfe being pulled in? I'm assuming version 0.4.x of rebar3_lfe is being used?
    • Is it possible to test with rebar3_lfe 0.5.x? (there are some changes in that release branch that include much more use of newer rebar3 APIs for creating directories, finding includes, etc., that might make this process easier to debug ... but it's very bleedy, so it could also make it harder!)
    • Is there a publicly clonable/downloadable project where this is being tested?
  10. diasbruno commented on Nov 4, 2025

    @diasbruno
    Contributor

    @iprog4u Thanks. I was look at the repo and it uses the old lfe-compile. But I did found that it has an implementation of ensure_dir.

    compile_dir(Config, FirstFiles, SourceDir, TargetDir) ->
        lr3_comp_util:ensure_dir(TargetDir),         <-----
        rebar_base_compiler:run(Config, FirstFiles,
                                SourceDir, ".lfe", TargetDir, ".beam",
                                fun compile/3).
  11. diasbruno commented on Nov 4, 2025

    @diasbruno
    Contributor

    Ok. Let's get a step back...

    I've updated the repo https://github.com/diasbruno/lfe_test using the mix_lfe (it's a bit behind, but I'll try to patch it).

    Now, rebar3_lfe is failing to compile.

    mix run
    ===> Analyzing applications...
    ===> Compiling rebar3_lfe
    ===> Compiling src/r3lfe_paths.erl failed
    src/r3lfe_paths.erl:{13,14}: can't find include lib "rebar3_lfe/include/r3lfe.hrl"; Make sure rebar3_lfe is in your app file's 'applications' list
        ┌─ src/r3lfe_paths.erl:
        │
     81 │                      ?DEBUG("Created directory: ~s", [Dir]),
        │                       ╰── undefined macro 'DEBUG/2'
    
    
       ┌─ src/r3lfe_paths.erl:
       │
     4 │  -export([
       │   ╰── function ensure_dir/1 undefined
    
        ┌─ src/r3lfe_paths.erl:
        │
     73 │  -spec ensure_dir(file:filename()) -> ok | {error, term()}.
        │   ╰── spec for undefined function ensure_dir/1
    
    
    ** (Mix) Could not compile dependency :rebar3_lfe, "/Users/dias/.mix/elixir/1-18-otp-27/rebar3 bare compile --paths /Users/dias/Programming/lfe_test/_build/dev/lib/*/ebin" command failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile rebar3_lfe --force", update it with "mix deps.update rebar3_lfe" or clean it with "mix deps.clean rebar3_lfe"
  12. oubiwann commented on Nov 4, 2025

    @oubiwann
    Member

    Got it! Thanks for your patience ... reading though the sources now.

  13. oubiwann commented on Nov 4, 2025

    @oubiwann
    Member

    Okay, I've installed Elixir and have run through the steps. It actually looks like it's compiling the LFE *.erl files before compiling the .lfe files. And it looks like it's using LFE's rebar.config.

    0.5.4 seems to be working for me ... did you delete the _build dir? (or at least the rebar3_lfe plugin in it?).

    Still poking ...

  14. diasbruno commented on Nov 4, 2025

    @diasbruno
    Contributor

    A fresh build from the repo.

    [nix-shell:~/Programming/lfe_test]$ mix deps.get
    * Getting mix_lfe (https://github.com/diasbruno/mix_lfe.git - update-lfe-versions)
    remote: Enumerating objects: 60, done.
    remote: Counting objects: 100% (3/3), done.
    remote: Compressing objects: 100% (3/3), done.
    remote: Total 60 (delta 0), reused 1 (delta 0), pack-reused 57 (from 1)
    Resolving Hex dependencies...
    Resolution completed in 0.01s
    Unchanged:
      erlang_color 1.0.0
      lfe 2.2.0
      ltest 0.13.11
      lutil 0.10.0-rc6
      rebar3_lfe 0.5.4
    * Getting rebar3_lfe (Hex package)
    * Getting lfe (Hex package)
    * Getting ltest (Hex package)
    * Getting color (Hex package)
    * Getting lutil (Hex package)
    
    [nix-shell:~/Programming/lfe_test]$ mix run
    ===> Analyzing applications...
    ===> Compiling color
    ===> Analyzing applications...
    ===> Compiling lfe
    src/cl.lfe: error writing file
    ===> Hook for app_compile failed!
    
    ** (Mix) Could not compile dependency :lfe, "/Users/dias/.mix/elixir/1-18-otp-27/rebar3 bare compile --paths /Users/dias/Programming/lfe_test/_build/dev/lib/*/ebin" command failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile lfe --force", update it with "mix deps.update lfe" or clean it with "mix deps.clean lfe"
  15. oubiwann commented on Nov 4, 2025

    @oubiwann
    Member

    Sorry, I should have been more specific about my comment "rebar3_lfe 0.5.4 works for me" ... what I meant was that rebar3_lfe 0.5.4 downloaded and compiled without issue, and I didn't see the same error you saw with this:

    src/r3lfe_paths.erl:{13,14}: can't find include lib "rebar3_lfe/include/r3lfe.hrl"; 
    Make sure rebar3_lfe is in your app file's 'applications' list
    

    I can confirm that even with rebar3_lfe 0.5.4, the LFE does not compile in this Elixir project.

    Oh, wow -- did you see this?

    ** (Mix) Could not compile dependency :lfe, "/Users/dias/.mix/elixir/1-18-otp-27/rebar3 bare compile 
    --paths /Users/dias/Programming/lfe_test/_build/dev/lib/*/ebin" 
    command failed. Errors may have been logged above. 
    You can recompile this dependency with "mix deps.compile lfe --force", 
    update it with "mix deps.update lfe" or clean it with "mix deps.clean lfe"
    

    In particular:

    rebar3 bare compile

    I think what might be going on is that mix compiles rebar3 dependencies using rebar3 bare compile instead of rebar3 compile. The bare compile provider doesn't execute build hooks in the same way - specifically, the hooks that create the ebin directory and compile .lfe sources aren't being invoked (or aren't being invoked properly?).

  16. oubiwann commented on Nov 4, 2025

    @oubiwann
    Member

    There's another fundamental issues here: using another tools instead of providing native support in the mix tool introduces another level of tricky dependency management and bug chasing. I think the "real" solution is to actually create a mix compiler plugin for LFE.

    I'm looking into that now ...

  17. oubiwann commented on Nov 4, 2025

    @oubiwann
    Member

    Well, crap. The problem is that any time a rebar3-based LFE project is pulled in as a dep, mix is going to have to use its rebar3 wrapper ... and it's going to compile with rebar3 bare compile.

  18. oubiwann commented on Nov 4, 2025

    @oubiwann
    Member

    I'm going to try an experiment ... see if I can get mix to not use rebar3_lfe for LFE projects 🤞

  19. oubiwann commented on Nov 4, 2025

    @oubiwann
    Member

    Okay, I've got some success ... check out this branch:

    CI/CD is passing for it, as are local builds. I haven't tried to use it in the test project yet ... ran out of time tonight.

  20. oubiwann commented on Nov 4, 2025

    @oubiwann
    Member

    Had some time to come back to this before bed tonight, and I did manage to get it "working" ... but this is very rough 😬

    Here's what I changed the mix.es file to:

    defmodule LfeTest.MixProject do
      use Mix.Project
    
      def project do
        [
          app: :lfe_test,
          version: "0.1.0",
          elixir: "~> 1.15",
          start_permanent: Mix.env() == :prod,
          compilers: Mix.compilers() ++ [:lfe],
          deps: deps()
        ]
      end
    
      def application do
        [
          extra_applications: [:logger]
        ]
      end
    
      defp deps do
        [
          {:mix_lfe, git: "https://github.com/lfe/mix.git", tag: "release/0.4.x", runtime: false},
        ]
      end
    end

    And here are the commands I used:

    $ rm -rf _build deps mix.lock
    $ mix deps.get
    $ mix lfe.bootstrap
    $ mix lfe.bootstrap # <-- sadly, not a mistake ... for now, the second command is needed
    $ mix compile
    

    This completely circumvents rebar3 for LFE code in a mix project ... but there are pitfalls:

    • we'll basically have to re-implement what we're throwing out
    • we'll inevitably miss something and have to go through the usual process of software maturation
    • right now, the bootstrap step is needed for LFE projects due to the way that Elixir projects treat app.src files (and LFE projects rely on rebar3's handling of those)

    This was so painful and rough, that I'm not convinced this is a better path anymore 😢

    I feel like there's got to be a way to get mix to use rebar3 compile instead of rebar3 bare compile ... but I'm pretty toasty at this point (I like my tools to be more flexible than this 🤷).

  21. oubiwann commented on Nov 4, 2025

    @oubiwann
    Member

    Feel free to work on a fork of the release/0.4.x branch ... if you get some stuff working, we can iterate on a PR.

  22. oubiwann commented on Nov 4, 2025

    @oubiwann
    Member

    I have an idea which might let us get around the mix issues of calling rebar3 bare compile ... (and use rebar3 compile instead)

  23. oubiwann commented on Nov 4, 2025

    @oubiwann
    Member

    Ugh. So much catch-22. Mix actually does support a way to override the reabr3 bare compile and that's essentially just overriding how mix compiles a library (and maybe that lib's deps?) with the :compile option (used in the same line of a mix.es file as the dep is declared).

    However: LFE projects will still fail the ebin/<proj>.app check that mix performs, since LFE projects use rebar3's support for src/<proj>.app.src (this is one of the things that the above mix task lfe.bootstrap does).

    More "however": I'm pretty sure that by not using bare compile, projects would compile using the standard rebar3 _build dirs ... which would result in something like _build/dev/lib/ltest/_build/default/lib/ltest. That, of course, is broken. And probably why bare compile even exists ...

    There are a couple of routes we can explore before reimplementing rebar3's compile and dependency logic in an LFE mix plugin:

    • environment variables: It may be that rebar3 will respect certain env vars that would let us override the rebar3 defaults. This will be tricky for many reasons ... and pretty hacky verging on really ugly (and thus difficult to maintain); if the right env vars are available, we might be able to get away with using those with rebar3 compile to fully build LFE projects in mix
    • a build script: LFE projects that want to support Elixir could include a build script that handles all of the potential environments that mix supports (i.e. _build/*), maybe also override rebar3 defaults with a new profile like elixir_build in its rebar.config, and finally uses the :compile override in the mix.es dep to call this build script
    • yet another attempt at an LFE mix plugin refactor: if the build script approach works, we should be able to convert that to Elixir code in an updated mix plugin for LFE projects

    And, if those all fail, the ultimate fallback of reimplementing chunks of rebar3's logic in mix tasks, etc., would be the path forward ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions