sandorbedo
Hex files have old format?
Hi,
I triesd to make a local hex repo based on the docs here: Self-hosting | Hex and i run into a problem. Certain tar files downloaded from the official hex repo are not working with my local repo.
Here’s a bash script that reproduces the error:
#!/bin/bash -x
DIR=try
rm -rf $DIR
mkdir -p $DIR/tarballs
mix hex.package fetch hackney 1.4.2
cp hackney-1.4.2.tar $DIR/tarballs/
openssl genrsa -out /tmp/private_key.pem
mix hex.registry build $DIR --name=test --private-key=/tmp/private_key.pem
mix --version
Here’s it’s output:
+ DIR=try
+ rm -rf try
+ mkdir -p try/tarballs
+ mix hex.package fetch hackney 1.4.2
hackney v1.4.2 downloaded to /home/otp00300830/hackney-1.4.2.tar
+ cp hackney-1.4.2.tar try/tarballs/
+ openssl genrsa -out /tmp/private_key.pem
Generating RSA private key, 2048 bit long modulus (2 primes)
.....................................+++++
...............................+++++
e is 65537 (0x010001)
+ mix hex.registry build try --name=test --private-key=/tmp/private_key.pem
* creating try/public_key
** (BadMapError) expected a map, got: "0.1.1"
(stdlib 3.9.2) :maps.get("app", "0.1.1")
(hex 2.0.6) lib/mix/tasks/hex.registry.ex:167: anonymous fn/3 in Mix.Tasks.Hex.Registry.build_release/2
(stdlib 3.9.2) maps.erl:232: :maps.fold_1/3
(hex 2.0.6) lib/mix/tasks/hex.registry.ex:166: Mix.Tasks.Hex.Registry.build_release/2
(elixir 1.13.3) lib/enum.ex:1593: Enum."-map/2-lists^map/1-0-"/2
(hex 2.0.6) lib/mix/tasks/hex.registry.ex:108: anonymous fn/4 in Mix.Tasks.Hex.Registry.build/3
(elixir 1.13.3) lib/enum.ex:1597: anonymous fn/3 in Enum.map/2
(stdlib 3.9.2) maps.erl:232: :maps.fold_1/3
+ mix --version
Erlang/OTP 22 [erts-10.4.4] [source] [64-bit] [smp:128:128] [ds:128:128:10] [async-threads:1] [hipe]
Mix 1.13.3 (compiled with Erlang/OTP 22)
What goes wrong here?
First Post!
sandorbedo
I tried it with OTP 23 and 25, and Elixir 1.13.3 and 1.14.x, and the same thing happened. Seems like :erlang.map_get("app", "0.1.1") tries to handle a binary as a map.
Popular in Questions
can someone please explain to me how Enum.reduce works with maps
New
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
i’m a new one to elixir
which editor can i use
vs code? or atom?
Thanks! :smiley:
New
Using vs code and installed ElixirLS: support and debugger.
And I got an error popped up on start up says
Failed to run ‘elixir’ comma...
New
The Elixir Typespec docs show the following syntax for keyword lists in typespecs:
# ...
| [key: type] # keyword lis...
New
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
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
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
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
Other popular topics
Phoenix 1.4.0 released
Phoenix 1.4 is out! This release ships with exciting new features, most notably
with HTTP2 support, improved deve...
New
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this:
...
New
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
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: )
Hello all, this is ...
New
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including.
What is Phoenix LiveV...
New
Hey :wave:t3: Elixir community,
I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New







