rebar3 as test compile not fetching test dependencies

Tristan Sloughter t@REDACTED
Thu Jan 13 22:52:41 CET 2022


Really weird. I just copy/pasted the commands and config you have here and it fetches the test deps as expected:

$ rebar3 as test compile
===> Verifying dependencies...
===> Fetching gun v1.3.3
===> Fetching meck v0.9.2
===> Fetching cowlib v2.7.3
===> Analyzing applications...
===> Compiling meck
===> Compiling cowlib
===> Compiling gun
_build/test/lib/gun/src/gun.erl:654:29: Warning: erlang:get_stacktrace/0 is removed; use the new try/catch syntax for retrieving the stack backtrace

===> Analyzing applications...
===> Compiling chk

$ rebar3 -v
rebar 3.18.0 on Erlang/OTP 24 Erts 12.0.1

How do you install rebar3? Are you downloading the escript or building from source? (Just throwing out random thoughts of what could be different).

On Thu, Jan 13, 2022, at 13:51, Anthony Howe wrote:
> So I tried your test example:
>
> ```
> docky$ rebar3 new lib chk
> ===> Writing chk/src/chk.erl
> ===> Writing chk/src/chk.app.src
> ===> Writing chk/rebar.config
> ===> Writing chk/.gitignore
> ===> Writing chk/LICENSE
> ===> Writing chk/README.md
> docky$ cd chk
> docky$ ls
> LICENSE  README.md  rebar.config  src
> docky$ vi rear.config
> docky$ vi rebar.config
> docky$ ls
> LICENSE  README.md  rebar.config  src
> docky$ rebar3 as test compile
> ===> Verifying dependencies...
> ===> Analyzing applications...
> ===> Compiling chk
> docky$ cat rebar.config
> {erl_opts, [debug_info]}.
> {deps, []}.
> {profiles, [
>         {test, [{deps, [gun, meck]}]}
> ]}.
> docky$ rebar3 -v
> rebar 3.18.0 on Erlang/OTP 21 Erts 10.3.5.6
> docky$
> ```
>
> Also there is no gun or merk related files in 
> ~/.cache/rebar3/hex/hexpm/packages.
>
>
>
> On 2022-01-13 13:46, Fred Hebert wrote:
>> Here's a sample run with 3.17.0, which I had already pre-installed:
>> 
>> λ /tmp → rebar3 new lib chk
>> ===> Writing chk/src/chk.erl
>> ===> Writing chk/src/chk.app.src
>> ===> Writing chk/rebar.config
>> ===> Writing chk/.gitignore
>> ===> Writing chk/LICENSE
>> ===> Writing chk/README.md
>> λ /tmp → cd chk
>> λ chk → vim rebar.config
>> λ chk → cat rebar.config
>> {profiles, [
>>   {test, [{deps, [gun, meck]}]}
>> ]}.
>> λ chk → rebar3 as test compile
>> ===> Verifying dependencies...
>> ===> Fetching gun v1.3.3
>> ===> Fetching meck v0.9.2
>> ===> Fetching cowlib v2.7.3
>> ===> Analyzing applications...
>> ===> Compiling meck
>> ===> Compiling cowlib
>> ===> Compiling gun
>> _build/test/lib/gun/src/gun.erl:654:29: Warning: erlang:get_stacktrace/0 is
>> removed; use the new try/catch syntax for retrieving the stack backtrace
>> 
>> ===> Analyzing applications...
>> ===> Compiling chk
>> 
>> I would probably advise to double-check the configuration format (see the sample
>> one I have included and displayed). This is pretty core functionality and
>> thoroughly tested, so I'd be very surprised to see it break.
>> 
>> On Thu, Jan 13, 2022 at 8:47 AM Anthony Howe <achowe@REDACTED
>> <mailto:achowe@REDACTED>> wrote:
>> 
>>     Has anyone seen this happening?
>> 
>>     Using rebar3 3.16.1, I remove the whole `_build` directory, my `rebar.config`
>>     has a `test` profile with `deps` (gun and meck) specified.  I do `rebar3 as test
>>     compile` and it fetches all the default dependencies, but not the test ones,
>>     which of course means the test suites fail.
>> 
>>     I also tried rebar 3.18.0.
>> 
>>     -- 
>>     Anthony C Howe                                                 SnertSoft
>>     achowe@REDACTED <mailto:achowe@REDACTED>     Twitter: SirWumpus           
>>     BarricadeMX & Milters
>>     http://snert.com/ <http://snert.com/>    http://nanozen.snert.com/
>>     <http://nanozen.snert.com/>     http://snertsoft.com/ <http://snertsoft.com/>
>> 
>
>
> -- 
> Anthony C Howe         	                                       SnertSoft
> achowe@REDACTED     Twitter: SirWumpus            BarricadeMX & Milters
> http://snert.com/    http://nanozen.snert.com/     http://snertsoft.com/


More information about the erlang-questions mailing list