gleam: No such file or directory src/libcore/result.rs:997:5

Hi Louis,

Trying out Gleam and getting an error when I try to compile an unmodified project built using rebar3 new gleam_lib my_proj

Here is the error:

╰─$ rebar3 compile
===> Plugin {rebar_gleam,{git,"https://github.com/gleam-lang/rebar_gleam"}} not available. It will not be used.
===> Verifying dependencies...
===> Fetching gleam_stdlib ({pkg,<<"gleam_stdlib">>,<<"0.2.0">>})
===> Version cached at /Users/steven/.cache/rebar3/hex/hexpm/packages/gleam_stdlib-0.2.0.tar is up to date, reusing it
===> Compiling gleam_stdlib
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/libcore/result.rs:997:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
===> Hook for compile failed!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

Hi all! I’ve just released a fix for this, as well as Gleam v0.2.0! Please update your copy of the compiler and then update the rebar_gleam plugin with rebar3 as global plugins upgrade rebar_gleam

Thanks for the fix on this Louis and also the library in general, looking forward to playing about with it some more.

@lpil for sure, I can do that 👍 Also I made a make file addition for myself to help make future upgrades easier make upgrade version=0.8.2 . If this is something that’s useful I can add that as well:

.PHONY: upgrade
upgrade:
	git fetch &&\
	git fetch --tags &&\
	git checkout v$(version) &&\
	make install &&\
	rebar3 as global plugins upgrade rebar_gleam

@lpil ah ok thanks for your help! I would have assumed a new project (via rebar_gleam) would have looked for the latest lib before fetching it 🤔

This seems to be a gap in my Erlang tooling knowledge. I’ve only been using Elixir for the beam. I’m assuming adding version numbers to the generated code could be a burden at this early stage but if not it would be helpful for newcomers (or even a comment to add that latest version)


For future readers, I was able to add a version number to my rebar.config, delete the lock file, and recompile to get it to run without issues.

{deps, [
    {gleam_stdlib, "0.3.0"}
]}.

new output

testupgrade|⇒ rebar3 compile
===> Verifying dependencies...
===> Package gleam_stdlib-0.3.0 not found. Fetching registry updates and trying again...
===> Updating package registry...
===> Writing registry to /Users/work/.cache/rebar3/hex/default/registry
===> Generating package index...
===> Writing index to /Users/work/.cache/rebar3/hex/default/packages.idx
===> Fetching gleam_stdlib ({pkg,<<"gleam_stdlib">>,<<"0.3.0">>})
===> Downloaded package, caching at /Users/work/.cache/rebar3/hex/default/packages/gleam_stdlib-0.3.0.tar
===> Compiling gleam_stdlib
===> Compiling testupgrade