Skip to content

Commit

Permalink
Fix regex in "cannot find -lsome-lib" hint (#6187)
Browse files Browse the repository at this point in the history
Change from [a-zA-Z_] to any non-whitespace characters because library names can vary, and it's not unusual for them to contain a dash.
  • Loading branch information
oprypin authored and RX14 committed Jun 12, 2018
1 parent 0a898dd commit 413920c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/compiler/crystal/compiler.cr
Expand Up @@ -368,9 +368,9 @@ module Crystal
input: Process::Redirect::Close, output: Process::Redirect::Inherit, error: Process::Redirect::Pipe) do |process|
process.error.each_line(chomp: false) do |line|
hint_string = colorize("(this usually means you need to install the development package for lib\\1)").yellow.bold
line = line.gsub(/cannot find -l(\w+)/, "cannot find -l\\1 #{hint_string}")
line = line.gsub(/unable to find library -l(\w+)/, "unable to find library -l\\1 #{hint_string}")
line = line.gsub(/library not found for -l(\w+)/, "library not found for -l\\1 #{hint_string}")
line = line.gsub(/cannot find -l(\S+)\b/, "cannot find -l\\1 #{hint_string}")
line = line.gsub(/unable to find library -l(\S+)\b/, "unable to find library -l\\1 #{hint_string}")
line = line.gsub(/library not found for -l(\S+)\b/, "library not found for -l\\1 #{hint_string}")
STDERR << line
end
end
Expand Down

0 comments on commit 413920c

Please sign in to comment.