mudasobwa

mudasobwa

Creator of Cure

Compilation fails on 1.17.0-dev because of lack of “version” meta key

During the upgrade of one of my libraries to 1.17.0, I got the following error message led the compilation to failing.

== Compilation error in file lib/md/parser/engine.ex ==
** (MatchError) no match of right hand side value: false
    (elixir 1.17.0-dev) src/elixir_erl_var.erl:16: :elixir_erl_var.translate/4
    (stdlib 6.0) lists.erl:2343: :lists.mapfoldl_1/3
    (stdlib 6.0) lists.erl:2344: :lists.mapfoldl_1/3
    (stdlib 6.0) lists.erl:2343: :lists.mapfoldl_1/3
    (stdlib 6.0) lists.erl:2344: :lists.mapfoldl_1/3

The line above in src/elixir_erl_var.erl:16 belongs to one of :elixir_erl_var.translate/4 clauses here

  {version, Version} = lists:keyfind(version, 1, Meta),

I would kindly appreciate any hint of under what circumstances Meta requires this :version key. The quick dig did not shed any light and I am a bit lost.

Macro.var/2 does not generate any version in meta. The only suspicious occurrence in elixir code itself would be in protocol.ex:664 as

    x = {:x, [line: line, version: -1], __MODULE__}

But amending meta manually to include version in the only place I generate vars did not help.

Thanks!

Marked As Solved

sabiwara

sabiwara

Elixir Core Team

It seems to have been introduced in this commit.

The variable name for which it fails is context, and Meta is [{line,1278},{column,5}], so it’s probably this quote.

Could you open up an issue (if possible with a minimal example)? Thank you!

Also Liked

sabiwara

sabiwara

Elixir Core Team

If you don’t mind, how did you get to the variable name and meta there? Some compiler flag?

Nothing fancy, just good old print debugging :smile:

translate(Meta, Name, Kind, #elixir_erl{var_names=VarNames} = S) ->
  Version = case lists:keyfind(version, 1, Meta) of
      {version, V} -> V;
      false ->
        io:format('Name: ~p~n', [Name]),
        io:format('Meta: ~p~n', [Meta]),
        io:format('Kind: ~p~n', [Kind]),
        throw(error)
    end,

which prints

Name: context
Meta: [{line,1278},{column,5}]
Kind: elixir_quote
mudasobwa

mudasobwa

Creator of Cure

Thanks again!

Where Next?

Popular in Questions Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New

We're in Beta

About us Mission Statement