Skip to content

Mirroring (HEX_CDN and HEX_MIRROR) not working in rebar3 specific case #11414

@matreyes

Description

@matreyes

Precheck

Checked!

Environment

elixir:1.10 (official docker version)

Current behavior

Using hex mirrors:
export HEX_MIRROR=private url
export HEX_CDN=private url

and Having repo.hex.pm blocked by firewall (you could test it pointing to localhost in /etc/hosts)

and Having Snappyer as a dependency for my project (https://hex.pm/packages/snappyer).

When I Fetch the dependencies (mix deps.get), It downloads them through the mirror without problem.
But when I try to compile the dependency, it tries to connect to repo.hex.pm to get the pc sub-dependency (https://hex.pm/packages/pc), and it fails as it is blocked.

# DEBUG=1 mix deps.compile snappyer
===> Hex get_package request failed: {error,
                                      {failed_connect,
                                       [{to_address,{"repo.hex.pm",443}},
                                        {inet,[inet],nxdomain}]}}
....

Running rebar3 compile directly from the snappyer project having exported the HEX_CDN env variable, works OK.
Running rebar3 compile directly from the snappyer project removing the HEX_CDN env variable, fails as expected.

Expected behavior

Compiling from mix (from the elixir project) should use the HEX_MIRROR (and/or HEX_CDN) env variable to fetch the pc package, but it does not.

Thanks!!!!!!!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions