1 |
On Sat, 2020-05-02 at 19:02 +0200, Hanno Böck wrote: |
2 |
> Due to an update of dev-erlang/fast_tls I noticed an issue in the |
3 |
> rebar |
4 |
> eclass with tests. |
5 |
> |
6 |
> It seems the way the eclass currently works it is running tests with |
7 |
> the library installed in the system, not the code just compiled. |
8 |
> |
9 |
> This is obviously not what we want and it also obviously can fail if |
10 |
> the new tests use features that aren't present in the old version in |
11 |
> the system. |
12 |
> |
13 |
> The patch below fixes this and runs tests with libs from the current |
14 |
> directory. |
15 |
> |
16 |
> Closes: https://bugs.gentoo.org/720448 |
17 |
> Signed-off-by: Hanno Böck <hanno@g.o> |
18 |
> --- |
19 |
> |
20 |
> diff --git a/eclass/rebar.eclass b/eclass/rebar.eclass |
21 |
> index 92dd16b08..f9849f0ff 100644 |
22 |
> --- a/eclass/rebar.eclass |
23 |
> +++ b/eclass/rebar.eclass |
24 |
> @@ -105,6 +105,9 @@ erebar() { |
25 |
> (( $# > 0 )) || die "erebar: at least one target is required" |
26 |
> |
27 |
> local -x ERL_LIBS="${EPREFIX}$(get_erl_libs)" |
28 |
> + if [ "$1" = "eunit" ]; then |
29 |
> + local -x ERL_LIBS="." |
30 |
> + fi |
31 |
> rebar -v skip_deps=true "$@" || die -n "rebar $@ failed" |
32 |
> } |
33 |
> |
34 |
> |
35 |
> |
36 |
|
37 |
Please use proper bash brackets and shorten everything to |
38 |
|
39 |
[[ ${1} == eunit ]] && local -x ERL_LIBS="." |