Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Providing a string() instead of [string()] in 𝚎𝚛𝚕_𝚏𝚒𝚛𝚜𝚝_𝚏𝚒𝚕𝚎𝚜 crashes rebar3 #1645

Closed
kvakvs opened this issue Oct 11, 2017 · 1 comment · Fixed by #1807
Labels
minor bug bug that does not prevent major features from working

Comments

@kvakvs
Copy link

kvakvs commented Oct 11, 2017

Current behaviour

I have specified {erl_first_files, "nnn.erl"} as a string instead of list of strings.

Running rebar3 compile crashes with internal error trying to join a string with a single integer (a character).

===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: function_clause
===> Stack trace to the error location:
[{filename,join,
           ["/home/kv/M/_build/default/lib/lib_directory",115],
           [{file,"filename.erl"},{line,410}]},
 {rebar_erlc_compiler,'-erl_first_files/4-lc$^0/1-0-',3,
                      [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_erlc_compiler.erl"},
                       {line,292}]},

Expected behaviour

There should be a check that the value provided is a list of strings and error should be printed.

Environment

[kv@UbuntuVbox M (BC-173-rebar3)]$ rebar3 report
Rebar3 report
 version 3.4.4
 generated at 2017-10-11T13:29:08+00:00
=================
Please submit this along with your issue at https://github.com/erlang/rebar3/issues (and feel free to edit out private information, if any)
-----------------
Task: 
Entered as:
  
-----------------
Operating System: x86_64-unknown-linux-gnu
ERTS: Erlang/OTP 19 [erts-8.3] [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]
Root Directory: /home/kv/r19
Library directory: /home/kv/r19/lib
-----------------
Loaded Applications:
bbmustache: 1.3.0
certifi: 2.0.0
cf: 0.2.2
common_test: 1.14
compiler: 7.0.4
crypto: 3.7.3
cth_readable: 1.3.0
dialyzer: 3.1
edoc: 0.8.1
erlware_commons: 1.0.0
eunit: 2.3.2
eunit_formatters: 0.3.1
getopt: 0.8.2
inets: 6.3.6
kernel: 5.2
providers: 1.6.0
public_key: 1.4
relx: 3.23.1
sasl: 3.0.3
snmp: 5.2.5
ssl_verify_fun: 1.1.2
stdlib: 3.3
syntax_tools: 2.1.1
tools: 2.9.1

-----------------
Escript path: /home/kv/bin/rebar3
Providers:
  app_discovery as clean compile compile cover ct deps dialyzer do edoc escriptize eunit get-deps help install install_deps list lock new path pkgs release relup report shell state tar tree unlock update upgrade upgrade upgrade version xref 
@kvakvs kvakvs changed the title Providing a string() instead of [string()] in rebar_files_first crashes rebar3 Providing a string() instead of [string()] in erl_files_first crashes rebar3 Oct 11, 2017
@kvakvs kvakvs changed the title Providing a string() instead of [string()] in erl_files_first crashes rebar3 Providing a string() instead of [string()] in 𝚎𝚛𝚕_𝚏𝚒𝚕𝚎𝚜_𝚏𝚒𝚛𝚜𝚝 crashes rebar3 Oct 11, 2017
@kvakvs kvakvs changed the title Providing a string() instead of [string()] in 𝚎𝚛𝚕_𝚏𝚒𝚕𝚎𝚜_𝚏𝚒𝚛𝚜𝚝 crashes rebar3 Providing a string() instead of [string()] in 𝚎𝚛𝚕_𝚏𝚒𝚛𝚜𝚝_𝚏𝚒𝚕𝚎𝚜 crashes rebar3 Oct 11, 2017
@ferd ferd added the minor bug bug that does not prevent major features from working label Oct 11, 2017
@ferd
Copy link
Collaborator

ferd commented Oct 11, 2017

Might make sense. A bit tricky from the point of view that "" will be valid, but "abc" will not, but that's what we get for string representations. There's also multiple places where the line can be used (you may get failures in plugins if the compiler does its own validation for example), but a best effort in the main code base would be reasonable.

starbelly pushed a commit to starbelly/rebar3 that referenced this issue Jun 7, 2018
starbelly pushed a commit to starbelly/rebar3 that referenced this issue Jun 8, 2018
starbelly pushed a commit to starbelly/rebar3 that referenced this issue Jun 8, 2018
@ferd ferd closed this as completed in #1807 Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor bug bug that does not prevent major features from working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants