rebar3: 3.1.0 -> 3.3.2
This commit is contained in:
parent
41256881bf
commit
fe727a19c1
@ -3,45 +3,20 @@
|
|||||||
tree, fetchFromGitHub, hexRegistrySnapshot }:
|
tree, fetchFromGitHub, hexRegistrySnapshot }:
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "3.1.0";
|
version = "3.3.2";
|
||||||
|
|
||||||
bootstrapper = ./rebar3-nix-bootstrap;
|
bootstrapper = ./rebar3-nix-bootstrap;
|
||||||
|
|
||||||
erlware_commons = fetchHex {
|
bbmustache = fetchHex {
|
||||||
pkg = "erlware_commons";
|
pkg = "bbmustache";
|
||||||
version = "0.19.0";
|
version = "1.3.0";
|
||||||
sha256 = "1gfsy9bbhjb94c5ghff2niamn93x2x08lnklh6pp7sfr5i0gkgsv";
|
sha256 = "042pfgss8kscq6ssg8gix8ccmdsrx0anjczsbrn2a6c36ljrx2p6";
|
||||||
};
|
|
||||||
ssl_verify_hostname = fetchHex {
|
|
||||||
pkg = "ssl_verify_hostname";
|
|
||||||
version = "1.0.5";
|
|
||||||
sha256 = "1gzavzqzljywx4l59gvhkjbr1dip4kxzjjz1s4wsn42f2kk13jzj";
|
|
||||||
};
|
};
|
||||||
certifi = fetchHex {
|
certifi = fetchHex {
|
||||||
pkg = "certifi";
|
pkg = "certifi";
|
||||||
version = "0.4.0";
|
version = "0.4.0";
|
||||||
sha256 = "04bnvsbssdcf6b9h9bfglflds7j0gx6q5igl1xxhx6fnwaz37hhw";
|
sha256 = "04bnvsbssdcf6b9h9bfglflds7j0gx6q5igl1xxhx6fnwaz37hhw";
|
||||||
};
|
};
|
||||||
providers = fetchHex {
|
|
||||||
pkg = "providers";
|
|
||||||
version = "1.6.0";
|
|
||||||
sha256 = "0byfa1h57n46jilz4q132j0vk3iqc0v1vip89li38gb1k997cs0g";
|
|
||||||
};
|
|
||||||
getopt = fetchHex {
|
|
||||||
pkg = "getopt";
|
|
||||||
version = "0.8.2";
|
|
||||||
sha256 = "1xw30h59zbw957cyjd8n50hf9y09jnv9dyry6x3avfwzcyrnsvkk";
|
|
||||||
};
|
|
||||||
bbmustache = fetchHex {
|
|
||||||
pkg = "bbmustache";
|
|
||||||
version = "1.0.4";
|
|
||||||
sha256 = "04lvwm7f78x8bys0js33higswjkyimbygp4n72cxz1kfnryx9c03";
|
|
||||||
};
|
|
||||||
relx = fetchHex {
|
|
||||||
pkg = "relx";
|
|
||||||
version = "3.17.0";
|
|
||||||
sha256 = "1xjybi93m8gj9f9z3lkc7xbg3k5cw56yl78rcz5qfirr0223sby2";
|
|
||||||
};
|
|
||||||
cf = fetchHex {
|
cf = fetchHex {
|
||||||
pkg = "cf";
|
pkg = "cf";
|
||||||
version = "0.2.1";
|
version = "0.2.1";
|
||||||
@ -49,14 +24,39 @@ let
|
|||||||
};
|
};
|
||||||
cth_readable = fetchHex {
|
cth_readable = fetchHex {
|
||||||
pkg = "cth_readable";
|
pkg = "cth_readable";
|
||||||
version = "1.2.2";
|
version = "1.2.3";
|
||||||
sha256 = "0kb9v4998liwyidpjkhcg1nin6djjzxcx6b313pbjicbp4r58n3p";
|
sha256 = "0wfpfismzi2q0nzvx9qyllch4skwmsk6yqffw8iw2v48ssbfvfhz";
|
||||||
|
};
|
||||||
|
erlware_commons = fetchHex {
|
||||||
|
pkg = "erlware_commons";
|
||||||
|
version = "0.21.0";
|
||||||
|
sha256 = "0gxb011m637rca2g0vhm1q9krm3va50rz1py6zf8k92q4iv9a2p7";
|
||||||
};
|
};
|
||||||
eunit_formatters = fetchHex {
|
eunit_formatters = fetchHex {
|
||||||
pkg = "eunit_formatters";
|
pkg = "eunit_formatters";
|
||||||
version = "0.3.1";
|
version = "0.3.1";
|
||||||
sha256 = "0cg9dasv60v09q3q4wja76pld0546mhmlpb0khagyylv890hg934";
|
sha256 = "0cg9dasv60v09q3q4wja76pld0546mhmlpb0khagyylv890hg934";
|
||||||
};
|
};
|
||||||
|
getopt = fetchHex {
|
||||||
|
pkg = "getopt";
|
||||||
|
version = "0.8.2";
|
||||||
|
sha256 = "1xw30h59zbw957cyjd8n50hf9y09jnv9dyry6x3avfwzcyrnsvkk";
|
||||||
|
};
|
||||||
|
providers = fetchHex {
|
||||||
|
pkg = "providers";
|
||||||
|
version = "1.6.0";
|
||||||
|
sha256 = "0byfa1h57n46jilz4q132j0vk3iqc0v1vip89li38gb1k997cs0g";
|
||||||
|
};
|
||||||
|
ssl_verify_fun = fetchHex {
|
||||||
|
pkg = "ssl_verify_fun";
|
||||||
|
version = "1.1.1";
|
||||||
|
sha256 = "0pnnan9xf4r6pr34hi28zdyv501i39jwnrwk6pr9r4wabkmhb22g";
|
||||||
|
};
|
||||||
|
relx = fetchHex {
|
||||||
|
pkg = "relx";
|
||||||
|
version = "3.21.1";
|
||||||
|
sha256 = "00590aqy0rfzgsnzxqgwbmn90imxxqlzmnmapy6bq76vw2rynvb8";
|
||||||
|
};
|
||||||
rebar3_hex = fetchHex {
|
rebar3_hex = fetchHex {
|
||||||
pkg = "rebar3_hex";
|
pkg = "rebar3_hex";
|
||||||
version = "1.12.0";
|
version = "1.12.0";
|
||||||
@ -70,7 +70,7 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://github.com/rebar/rebar3/archive/${version}.tar.gz";
|
url = "https://github.com/rebar/rebar3/archive/${version}.tar.gz";
|
||||||
sha256 = "0r4wpnpi81ha4iirv9hcif3vrgc82qd51kah7rnhvpym55wcy9ml";
|
sha256 = "14nhc1bmna3b4y9qmd0lzpi0jdaw92r7ljg7vlghn297awsjgg6c";
|
||||||
};
|
};
|
||||||
|
|
||||||
inherit bootstrapper;
|
inherit bootstrapper;
|
||||||
@ -97,7 +97,7 @@ stdenv.mkDerivation {
|
|||||||
cp --no-preserve=mode -R ${cth_readable} _build/default/lib/cth_readable
|
cp --no-preserve=mode -R ${cth_readable} _build/default/lib/cth_readable
|
||||||
cp --no-preserve=mode -R ${eunit_formatters} _build/default/lib/eunit_formatters
|
cp --no-preserve=mode -R ${eunit_formatters} _build/default/lib/eunit_formatters
|
||||||
cp --no-preserve=mode -R ${relx} _build/default/lib/relx
|
cp --no-preserve=mode -R ${relx} _build/default/lib/relx
|
||||||
cp --no-preserve=mode -R ${ssl_verify_hostname} _build/default/lib/ssl_verify_hostname
|
cp --no-preserve=mode -R ${ssl_verify_fun} _build/default/lib/ssl_verify_fun
|
||||||
cp --no-preserve=mode -R ${rebar3_hex} _build/default/plugins/rebar3_hex
|
cp --no-preserve=mode -R ${rebar3_hex} _build/default/plugins/rebar3_hex
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
diff --git a/bootstrap b/bootstrap
|
diff --git a/bootstrap b/bootstrap
|
||||||
index 35759b0..939c838 100755
|
index c36fddb..9fcb718 100755
|
||||||
--- a/bootstrap
|
--- a/bootstrap
|
||||||
+++ b/bootstrap
|
+++ b/bootstrap
|
||||||
@@ -7,9 +7,11 @@ main(_) ->
|
@@ -7,9 +7,11 @@ main(_) ->
|
||||||
@ -9,42 +9,44 @@ index 35759b0..939c838 100755
|
|||||||
- inets:start(),
|
- inets:start(),
|
||||||
- inets:start(httpc, [{profile, rebar}]),
|
- inets:start(httpc, [{profile, rebar}]),
|
||||||
- set_httpc_options(),
|
- set_httpc_options(),
|
||||||
+ %% Removed for hermeticity on Nix
|
+ %% Removed for hermeticity on Nix
|
||||||
+ %%
|
+ %%
|
||||||
+ %% inets:start(),
|
+ %% inets:start(),
|
||||||
+ %% inets:start(httpc, [{profile, rebar}]),
|
+ %% inets:start(httpc, [{profile, rebar}]),
|
||||||
+ %% set_httpc_options(),
|
+ %% set_httpc_options(),
|
||||||
|
|
||||||
%% Fetch and build deps required to build rebar3
|
%% Fetch and build deps required to build rebar3
|
||||||
BaseDeps = [{providers, []}
|
BaseDeps = [{providers, []}
|
||||||
@@ -74,12 +76,12 @@ default_registry_file() ->
|
@@ -73,13 +75,13 @@ default_registry_file() ->
|
||||||
|
CacheDir = filename:join([Home, ".cache", "rebar3"]),
|
||||||
filename:join([CacheDir, "hex", "default", "registry"]).
|
filename:join([CacheDir, "hex", "default", "registry"]).
|
||||||
|
|
||||||
fetch_and_compile({Name, ErlFirstFiles}, Deps) ->
|
-fetch_and_compile({Name, ErlFirstFiles}, Deps) ->
|
||||||
- case lists:keyfind(Name, 1, Deps) of
|
- case lists:keyfind(Name, 1, Deps) of
|
||||||
- {Name, Vsn} ->
|
- {Name, Vsn} ->
|
||||||
- ok = fetch({pkg, atom_to_binary(Name, utf8), list_to_binary(Vsn)}, Name);
|
- ok = fetch({pkg, atom_to_binary(Name, utf8), list_to_binary(Vsn)}, Name);
|
||||||
- {Name, _, Source} ->
|
- {Name, _, Source} ->
|
||||||
- ok = fetch(Source, Name)
|
- ok = fetch(Source, Name)
|
||||||
- end,
|
- end,
|
||||||
|
+fetch_and_compile({Name, ErlFirstFiles}, _Deps) ->
|
||||||
+ %% case lists:keyfind(Name, 1, Deps) of
|
+ %% case lists:keyfind(Name, 1, Deps) of
|
||||||
+ %% {Name, Vsn} ->
|
+ %% {Name, Vsn} ->
|
||||||
+ %% ok = fetch({pkg, atom_to_binary(Name, utf8), list_to_binary(Vsn)}, Name);
|
+ %% ok = fetch({pkg, atom_to_binary(Name, utf8), list_to_binary(Vsn)}, Name);
|
||||||
+ %% {Name, _, Source} ->
|
+ %% {Name, _, Source} ->
|
||||||
+ %% ok = fetch(Source, Name)
|
+ %% ok = fetch(Source, Name)
|
||||||
+ %% end,
|
+ %% end,
|
||||||
|
|
||||||
%% Hack: erlware_commons depends on a .script file to check if it is being built with
|
%% Hack: erlware_commons depends on a .script file to check if it is being built with
|
||||||
%% rebar2 or rebar3. But since rebar3 isn't built yet it can't get the vsn with get_key.
|
%% rebar2 or rebar3. But since rebar3 isn't built yet it can't get the vsn with get_key.
|
||||||
@@ -88,63 +90,63 @@ fetch_and_compile({Name, ErlFirstFiles}, Deps) ->
|
@@ -88,67 +90,67 @@ fetch_and_compile({Name, ErlFirstFiles}, Deps) ->
|
||||||
|
|
||||||
compile(Name, ErlFirstFiles).
|
compile(Name, ErlFirstFiles).
|
||||||
|
|
||||||
-fetch({pkg, Name, Vsn}, App) ->
|
-fetch({pkg, Name, Vsn}, App) ->
|
||||||
- Dir = filename:join([filename:absname("_build/default/lib/"), App]),
|
- Dir = filename:join([filename:absname("_build/default/lib/"), App]),
|
||||||
- case filelib:is_dir(Dir) of
|
- case filelib:is_dir(Dir) of
|
||||||
- false ->
|
- false ->
|
||||||
- CDN = "https://s3.amazonaws.com/s3.hex.pm/tarballs",
|
- CDN = "https://repo.hex.pm/tarballs",
|
||||||
- Package = binary_to_list(<<Name/binary, "-", Vsn/binary, ".tar">>),
|
- Package = binary_to_list(<<Name/binary, "-", Vsn/binary, ".tar">>),
|
||||||
- Url = string:join([CDN, Package], "/"),
|
- Url = string:join([CDN, Package], "/"),
|
||||||
- case request(Url) of
|
- case request(Url) of
|
||||||
@ -85,7 +87,11 @@ index 35759b0..939c838 100755
|
|||||||
- end.
|
- end.
|
||||||
-
|
-
|
||||||
-get_http_vars(Scheme) ->
|
-get_http_vars(Scheme) ->
|
||||||
- proplists:get_value(Scheme, get_rebar_config(), []).
|
- OS = case os:getenv(atom_to_list(Scheme)) of
|
||||||
|
- Str when is_list(Str) -> Str;
|
||||||
|
- _ -> []
|
||||||
|
- end,
|
||||||
|
- proplists:get_value(Scheme, get_rebar_config(), OS).
|
||||||
-
|
-
|
||||||
-set_httpc_options() ->
|
-set_httpc_options() ->
|
||||||
- set_httpc_options(https_proxy, get_http_vars(https_proxy)),
|
- set_httpc_options(https_proxy, get_http_vars(https_proxy)),
|
||||||
@ -101,7 +107,7 @@ index 35759b0..939c838 100755
|
|||||||
+%% Dir = filename:join([filename:absname("_build/default/lib/"), App]),
|
+%% Dir = filename:join([filename:absname("_build/default/lib/"), App]),
|
||||||
+%% case filelib:is_dir(Dir) of
|
+%% case filelib:is_dir(Dir) of
|
||||||
+%% false ->
|
+%% false ->
|
||||||
+%% CDN = "https://s3.amazonaws.com/s3.hex.pm/tarballs",
|
+%% CDN = "https://repo.hex.pm/tarballs",
|
||||||
+%% Package = binary_to_list(<<Name/binary, "-", Vsn/binary, ".tar">>),
|
+%% Package = binary_to_list(<<Name/binary, "-", Vsn/binary, ".tar">>),
|
||||||
+%% Url = string:join([CDN, Package], "/"),
|
+%% Url = string:join([CDN, Package], "/"),
|
||||||
+%% case request(Url) of
|
+%% case request(Url) of
|
||||||
@ -142,7 +148,11 @@ index 35759b0..939c838 100755
|
|||||||
+%% end.
|
+%% end.
|
||||||
+
|
+
|
||||||
+%% get_http_vars(Scheme) ->
|
+%% get_http_vars(Scheme) ->
|
||||||
+%% proplists:get_value(Scheme, get_rebar_config(), []).
|
+%% OS = case os:getenv(atom_to_list(Scheme)) of
|
||||||
|
+%% Str when is_list(Str) -> Str;
|
||||||
|
+%% _ -> []
|
||||||
|
+%% end,
|
||||||
|
+%% proplists:get_value(Scheme, get_rebar_config(), OS).
|
||||||
+
|
+
|
||||||
+%% set_httpc_options() ->
|
+%% set_httpc_options() ->
|
||||||
+%% set_httpc_options(https_proxy, get_http_vars(https_proxy)),
|
+%% set_httpc_options(https_proxy, get_http_vars(https_proxy)),
|
||||||
@ -154,6 +164,6 @@ index 35759b0..939c838 100755
|
|||||||
+%% set_httpc_options(Scheme, Proxy) ->
|
+%% set_httpc_options(Scheme, Proxy) ->
|
||||||
+%% {ok, {_, _, Host, Port, _, _}} = http_uri:parse(Proxy),
|
+%% {ok, {_, _, Host, Port, _, _}} = http_uri:parse(Proxy),
|
||||||
+%% httpc:set_options([{Scheme, {{Host, Port}, []}}], rebar).
|
+%% httpc:set_options([{Scheme, {{Host, Port}, []}}], rebar).
|
||||||
|
|
||||||
compile(App, FirstFiles) ->
|
compile(App, FirstFiles) ->
|
||||||
Dir = filename:join(filename:absname("_build/default/lib/"), App),
|
Dir = filename:join(filename:absname("_build/default/lib/"), App),
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
diff a/src/rebar3.erl b/src/rebar3.erl
|
diff --git a/src/rebar3.erl b/src/rebar3.erl
|
||||||
index c1a1ae4..1bf1ea0 100644
|
index 47dc25a..edda250 100644
|
||||||
--- a/src/rebar3.erl
|
--- a/src/rebar3.erl
|
||||||
+++ b/src/rebar3.erl
|
+++ b/src/rebar3.erl
|
||||||
@@ -294,9 +294,11 @@ start_and_load_apps(Caller) ->
|
@@ -304,9 +304,11 @@ start_and_load_apps(Caller) ->
|
||||||
ensure_running(crypto, Caller),
|
ensure_running(crypto, Caller),
|
||||||
ensure_running(asn1, Caller),
|
ensure_running(asn1, Caller),
|
||||||
ensure_running(public_key, Caller),
|
ensure_running(public_key, Caller),
|
||||||
@ -12,16 +12,16 @@ index c1a1ae4..1bf1ea0 100644
|
|||||||
+ ensure_running(ssl, Caller).
|
+ ensure_running(ssl, Caller).
|
||||||
+%% Removed due to the hermicity requirements of Nix
|
+%% Removed due to the hermicity requirements of Nix
|
||||||
+%%
|
+%%
|
||||||
+%% inets:start(),
|
+%% inets:start(),
|
||||||
+%% inets:start(httpc, [{profile, rebar}]).
|
+%% inets:start(httpc, [{profile, rebar}]).
|
||||||
|
|
||||||
ensure_running(App, Caller) ->
|
ensure_running(App, Caller) ->
|
||||||
case application:start(App) of
|
case application:start(App) of
|
||||||
diff a/src/rebar_hermicity.erl b/src/rebar_hermicity.erl
|
diff --git a/src/rebar_hermeticity.erl b/src/rebar_hermeticity.erl
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..d814e2a
|
index 0000000..8f6cc7d
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/rebar_hermicity.erl
|
+++ b/src/rebar_hermeticity.erl
|
||||||
@@ -0,0 +1,42 @@
|
@@ -0,0 +1,42 @@
|
||||||
+%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
|
+%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
|
||||||
+%% ex: ts=4 sw=4 et
|
+%% ex: ts=4 sw=4 et
|
||||||
@ -49,7 +49,7 @@ index 0000000..d814e2a
|
|||||||
+%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
+%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
+%% THE SOFTWARE.
|
+%% THE SOFTWARE.
|
||||||
+%% -------------------------------------------------------------------
|
+%% -------------------------------------------------------------------
|
||||||
+-module(rebar_hermicity).
|
+-module(rebar_hermeticity).
|
||||||
+
|
+
|
||||||
+-export([request/5]).
|
+-export([request/5]).
|
||||||
+
|
+
|
||||||
@ -63,23 +63,23 @@ index 0000000..d814e2a
|
|||||||
+ ?ERROR("A request is being made that violates Nix hermicity "
|
+ ?ERROR("A request is being made that violates Nix hermicity "
|
||||||
+ "This request has been stopped. Details of the request "
|
+ "This request has been stopped. Details of the request "
|
||||||
+ "are as follows:", []),
|
+ "are as follows:", []),
|
||||||
+ ?ERROR("Requesnt: ~p ~s", [Method, Url]),
|
+ ?ERROR("Request: ~p ~s", [Method, Url]),
|
||||||
+ erlang:halt(1).
|
+ erlang:halt(1).
|
||||||
diff a/src/rebar_pkg_resource.erl b/src/rebar_pkg_resource.erl
|
diff --git a/src/rebar_pkg_resource.erl b/src/rebar_pkg_resource.erl
|
||||||
index ec7e09d..03be343 100644
|
index 5817817..2ea1703 100644
|
||||||
--- a/src/rebar_pkg_resource.erl
|
--- a/src/rebar_pkg_resource.erl
|
||||||
+++ b/src/rebar_pkg_resource.erl
|
+++ b/src/rebar_pkg_resource.erl
|
||||||
@@ -104,7 +104,7 @@ make_vsn(_) ->
|
@@ -107,7 +107,7 @@ make_vsn(_) ->
|
||||||
{error, "Replacing version of type pkg not supported."}.
|
{error, "Replacing version of type pkg not supported."}.
|
||||||
|
|
||||||
request(Url, ETag) ->
|
request(Url, ETag) ->
|
||||||
- case httpc:request(get, {Url, [{"if-none-match", ETag} || ETag =/= false]++[{"User-Agent", rebar_utils:user_agent()}]},
|
- case httpc:request(get, {Url, [{"if-none-match", ETag} || ETag =/= false]++[{"User-Agent", rebar_utils:user_agent()}]},
|
||||||
+ case rebar_hermicity:request(get, {Url, [{"if-none-match", ETag} || ETag =/= false]++[{"User-Agent", rebar_utils:user_agent()}]},
|
+ case rebar_hermeticity:request(get, {Url, [{"if-none-match", ETag} || ETag =/= false]++[{"User-Agent", rebar_utils:user_agent()}]},
|
||||||
[{ssl, ssl_opts(Url)}, {relaxed, true}],
|
[{ssl, ssl_opts(Url)}, {relaxed, true}],
|
||||||
[{body_format, binary}],
|
[{body_format, binary}],
|
||||||
rebar) of
|
rebar) of
|
||||||
diff a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl
|
diff --git a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl
|
||||||
index 5e1e253..ea25b9e 100644
|
index 75c609e..4283c23 100644
|
||||||
--- a/src/rebar_prv_update.erl
|
--- a/src/rebar_prv_update.erl
|
||||||
+++ b/src/rebar_prv_update.erl
|
+++ b/src/rebar_prv_update.erl
|
||||||
@@ -52,7 +52,7 @@ do(State) ->
|
@@ -52,7 +52,7 @@ do(State) ->
|
||||||
@ -87,7 +87,7 @@ index 5e1e253..ea25b9e 100644
|
|||||||
{ok, Url} ->
|
{ok, Url} ->
|
||||||
?DEBUG("Fetching registry from ~p", [Url]),
|
?DEBUG("Fetching registry from ~p", [Url]),
|
||||||
- case httpc:request(get, {Url, [{"User-Agent", rebar_utils:user_agent()}]},
|
- case httpc:request(get, {Url, [{"User-Agent", rebar_utils:user_agent()}]},
|
||||||
+ case rebar_hermicity:request(get, {Url, [{"User-Agent", rebar_utils:user_agent()}]},
|
+ case rebar_hermeticity:request(get, {Url, [{"User-Agent", rebar_utils:user_agent()}]},
|
||||||
[], [{stream, TmpFile}, {sync, true}],
|
[], [{stream, TmpFile}, {sync, true}],
|
||||||
rebar) of
|
rebar) of
|
||||||
{ok, saved_to_file} ->
|
{ok, saved_to_file} ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user