Git Product home page Git Product logo

Comments (3)

tsloughter avatar tsloughter commented on August 28, 2024

Thanks. Pls send a PR if you have time.

from rebar_mix.

mark-04 avatar mark-04 commented on August 28, 2024

I had the same issue
Here in rebar_mix/src/rebar_mix_utils.erl, in the function get_lib_dir (line 42-53) we have the following case expression

case rebar_utils:sh("elixir -e \"IO.puts :code.lib_dir(:elixir)\"", [return_on_error]) of
    {ok, ElixirLibs_} ->
        filename:join(re:replace(ElixirLibs_, "\\s+", "", [global,{return,list}]), "../");
    _ ->
        erlang:error(missing_elixir)
end;

The insteresting part is re:replace(ElixirLibs_, "\\s+", "", [global,{return,list}])
It basically takes the path to Elixir and removes all whitespaces from it. And so if our path happens to start with, for instance, C:\Program Files (default when installing Elixir on windows), it becomes C:\ProgramFiles, resulting in an error.
I spent quite some time trying to figure out what the problem was, so I thought it is worth mentioning it

I'm not sure if it is a bug. I assume there is a valid reason why we would remove whitespaces from the path, and so I don't know if we should do something about it or keep it as is. I do think that it should be mentioned in the README, though. (e.g. in the requiremets section, we might include something like "Make sure that the path to your Elixir installation contains no significant whitespaces". I beleive, that could save a lot of debagging time for the future users).

from rebar_mix.

ferd avatar ferd commented on August 28, 2024

No there's no good reason to remove whitespace from a path, it just makes it wrong. The proper fix is to escape and/or quote the path adequately.

from rebar_mix.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.