Yikes. Then it’s either Windows-specific or this “cannot find path” error that OP is brushing off as non-important, is actually important.
It’s a shell problem, it has already been reported, so it’s just normal here, not out of abnormal
I can just add everything I have here (with _build/deps, every detail would be good)
Ok, not deps, there is too much there
It’s just mix phx.new
template, I didn’t change anything
Could you pretty please set the debug environment variables I suggested? Without this, everyone will just guess.
Screenshot by Lightshot The rest is running ok, should be the same as in your local env.
Ran debug=1 mix_debug=1 mix phx.server
The following code has been called:
I have also tried to recreate arguments passed to this function based on authors images and what I found on my machine:
dep = %Mix.Dep{
scm: Hex.SCM,
app: :telemetry,
requirement: "~> 0.4 or ~> 1.0",
status: {:ok, "1.3.0"},
opts: [
app_properties: [
description: ~c"Dynamic dispatching library for metrics and instrumentations",
vsn: ~c"1.3.0",
registered: [],
mod: {:telemetry_app, []},
applications: [:kernel, :stdlib],
env: [],
modules: [
:telemetry,
:telemetry_app,
:telemetry_handler_table,
:telemetry_sup,
:telemetry_test
],
licenses: [~c"Apache-2.0"],
links: [{~c"GitHub", ~c"https://github.com/beam-telemetry/telemetry"}],
doc: ~c"doc",
include_files: [~c"mix.exs"]
],
lock:
{:hex, :telemetry, "1.3.0",
"fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm",
"7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
env: :prod,
build: "c:/Users/pedro/Desktop/Coding/Elixir/zaworld/_build/dev/lib/telemetry",
dest: "c:/Users/pedro/Desktop/Coding/Elixir/zaworld/deps/telemetry",
hex: "telemetry",
repo: "hexpm",
optional: false
],
deps: [],
top_level: false,
extra: [
erl_opts: [:debug_info],
deps: [],
profiles: [
test: [
erl_opts: [:nowarn_export_all],
ct_opts: [ct_hooks: [:cth_surefire]],
cover_enabled: true,
cover_opts: [:verbose],
plugins: [:covertool],
covertool: [coverdata_files: [~c"ct.coverdata"]]
]
],
shell: [apps: [:telemetry]],
xref_checks: [
:undefined_function_calls,
:undefined_functions,
:locals_not_used,
:deprecated_function_calls,
:deprecated_functions
],
project_plugins: [:rebar3_hex, :rebar3_ex_doc],
hex: [doc: %{provider: :ex_doc}],
ex_doc: [
source_url: "https://github.com/beam-telemetry/telemetry",
extras: ["README.md", "CHANGELOG.md", "LICENSE", "NOTICE"],
main: "readme"
],
overrides: []
],
manager: :rebar3,
from: "c:/Users/pedro/Desktop/Coding/Elixir/zaworld/deps/bandit/mix.exs",
system_env: []
}
config = [
consolidate_protocols: false,
consolidation_path: "c:/Users/pedro/Desktop/Coding/Elixir/zaworld/_build/dev/lib/example/consolidated",
deps_path: "c:/Users/pedro/Desktop/Coding/Elixir/zaworld/deps",
deps_build_path: "c:/Users/pedro/Desktop/Coding/Elixir/zaworld/_build/dev",
lockfile: "c:/Users/pedro/Desktop/Coding/Elixir/zaworld/mix.lock",
build_embedded: false,
build_per_environment: true
]
command = ~s[escript.exe "c:/Users/pedro/.mix/elixir/1-17/rebar3" bare compile --paths c:/Users/pedro/Desktop/Coding/Elixir/zaworld/_build/dev/lib/*/ebin]
print_app? = false
env = [
{"REBAR_BARE_COMPILER_OUTPUT_DIR", "c:/Users/pedro/Desktop/Coding/Elixir/zaworld/_build/dev/lib/telemetry"},
{"REBAR_CONFIG", "c:/Users/pedro/Desktop/Coding/Elixir/zaworld/_build/dev/lib/telemetry/mix.rebar.config"},
{"REBAR_PROFILE", "prod"},
{"TERM", "dumb"}
]
Note: Pay attention that some of those values may be a bit different, but most of them if not all should be exactly the same as what author’s have.
As we can see the escript.exe
return code is different than 0
which means it failed. However looks like there is not much info what exactly have failed.
@SunPoke04 Are you able to clone the Elixir
repo, switch to v1.17.3
, modify code as shown below, compile and run mix compile
with updated code?
Please wrap System.shell/2
call at the bottom of the function with IO.inspect/1
call, for example:
# …
{_, status} = IO.inspect(System.shell(command, options))
# or
{_, status} = System.shell(command, options) |> IO.inspect()
# or
{message, status} = System.shell(command, options)
IO.puts(message)
# …
As long as the code runs we do not care about if it’s nice or not. What we may be interested here is first tuple element i.e. error message
coming from escript.exe
which as you can see is unfortunately silenced.
Edit: Created a related issue:
Edit 2: This is going to be even more interesting … Looks like there is no issue with printing output (as it’s done using :into
option) which would mean that escript.exe
have failed with non-zero exit status and did not print any message. Unless there is a way everyone can reproduce, it would be a very hard to debug.
I have created a post on Erlang Forums
, see:
@SunPoke04 How about checking if escript.exe
have all dependencies installed? In Linux
this could be done with ldd
command, but I have no idea about Windows
. Consider checking topics like:
@SunPoke04 Are you able to clone the
Elixir
repo, switch tov1.17.3
, modify code as shown below, compile and runmix compile
with updated code?
I can’t compile it though, it seems I’m missing stuff, dunno. Screenshot by Lightshot
@SunPoke04 How about checking if
escript.exe
have all dependencies installed? InLinux
this could be done withldd
command, but I have no idea aboutWindows
. Consider checking topics like:
Screenshot by Lightshot it seems to work properly
Heh, I never saw it, but it may be a huge hint!
Did you follow Windows
wiki?
I guess making Elixir
able to compile on your machine could be at least half a way to solve your issue.
Did you follow Windows wiki?
Didn’t know there was one, ngl.
But I saw it now and it requires msys2, which erm… kinda meh.
I already have mingw stuff, but it also requires bash/grep, which isn’t that “normal” in windows.
I can install those, but I can’t promise I’ll do it since it’s not my style of doing stuff and I’ll probably just forget about it.
I have work+uni today and tomorrow, so if I am able to install msys2, I’ll do it on the weekend (sry for taking a lot of time in advance)
You said you don’t want to use Docker, which is a valid choice, but what about WSL2? That’s practically how most Windows-bound programmers work these days.
Sry, working has took a lot of my time, wasn’t able to do much outside of it.
I’m just not fond of WSL, I’ve used it in the past and it didn’t work properly, also it takes too much memory, so it’s a major pain
I mean OK, it’s your machine but let me remind you that you have so far refused to use:
- Docker
- WSL2
- msys2
- mingw + UNIX tools
At this point I’m certain you’d refuse to try Cygwin as well.
It’s a fact of life that Windows is not exactly an universal developer-friendly OS and by refusing to use the convenient workarounds you’re making your work more difficult than it has to be.
Let us know if you make it work. It would be enlightening.
I am using mingw though, I don’t like msys2.
Also reformatting the pc seems to fix it? I have no idea why it didn’t work previously.
It’s a fact of life that Windows is not exactly an universal developer-friendly OS and by refusing to use the convenient workarounds you’re making your work more difficult than it has to be.
For me it’s worse in linux, but that’s an opinion, same as yours.
That’s a fairly heavy hammer to swing to fix one problem but hey, glad you made it work!
If you are happy with the result then that’s all that matters for this thread.
I also faced similar issue on windows. I did not use installer. Downloaded zip file and extracted them for erlang, elixir and gleam.
I could not get phoenix sample app to work.
Was failing with.
**(Mix) Could not compile dependency :telemetry, "escript rebar3 bare compile --paths _build/dev/lib/*/ebin" command failed. Errors may have been logged above.
You can recompile this dependency with "mix deps.compile telemetry --force" or clean it with "mix deps.clean telemetry"
Fix: Change the following files to have correct path.
C:\Programs\erl.27_1_2\bin>type erl.ini
[erlang]
Bindir=C:\\Programs\\erl.27_1_2\\erts-15.1.2\\bin
Progname=erl
Rootdir=C:\\Programs\\erl.27_1_2
C:\Programs\erl.27_1_2\erts-15.1.2\bin>type erl.ini
[erlang]
Bindir=C:\\Programs\\erl.27_1_2\\erts-15.1.2\\bin
Progname=erl
Rootdir=C:\\Programs\\erl.27_1_2
Not sure whether installation with scoop also has similar issues.
Hope this is useful for somebody else.
Deleting this erl.ini should work too: ci: Add otp_win.zip to releases by wojtekmach · Pull Request #8729 · erlang/otp · GitHub
hey @wojtekmach, sorry I missed this and now that I need help I found it gain. Basically trying to compile a project and running into this very same thing. Did a global search for erl.ini and deleted all the entries I found (probably not what I should have done). Installed and download several different ways rebar3. thanks.
C:\Users\rafae\source\vc_demo>mix deps.compile telemetry --force
Could not load module C:\Users\wojtek\otp\erts-15.1.2\bin\erlexec.dll.
** (Mix) Could not compile dependency :telemetry, “escript.exe “c:/Users/rafae/.mix/elixir/1-17/rebar3” bare compile --paths c:/Users/rafae/source/vc_demo/_build/dev/lib/*/ebin” command failed. Errors may have been logged above. You can recompile this dependency with “mix deps.compile telemetry --force”, update it with “mix deps.update telemetry” or clean it with “mix deps.clean telemetry”
there’s gotta be that erl.ini somewhere still, that’s the only known to me explanation. What you can also do is install elixir again: Installing Elixir - The Elixir programming language
Corollary to your issue, you could install Everything from VoidTools and task it with finding erl.ini
on your local disk(s) to make double sure.
It’s times better than Windows Explorer’s search.
Somewhere between re-installing and updating path stuff it looks like I’m back in business. thanks again.