416 Commits

Author SHA1 Message Date
Mike McQuaid
e5d15c8b19
Merge branch 'master' into argv-cleanup-26 2020-05-23 13:44:42 +01:00
Mike McQuaid
3588e6a5c6
bottle_arch: ensure a symbol is used when needed.
Fixes #7597.
2020-05-19 08:47:59 +01:00
Mike McQuaid
1c656fb584
Merge pull request #7538 from MikeMcQuaid/bottle_arch
Replace ARGV#bottle_arch with Homebrew.args.bottle_arch
2020-05-11 08:46:57 +01:00
Mike McQuaid
5f721c6986
Cleanup ARGV.include? usage
Remove usage where `Homebrew.args` could be used instead or, due to the
`Homebrew.args` parsing, there was dead code that was never executed
(and no-one complained about not working).
2020-05-10 15:28:31 +01:00
Mike McQuaid
07b19cba09
Replace ARGV#bottle_arch with Homebrew.args.bottle_arch
Part of https://github.com/Homebrew/brew/issues/5730
2020-05-10 15:15:41 +01:00
Mike McQuaid
20a1199375
Refactor CLI to remove unless args_parsed
Refactor the CLI::Args module so it doesn't have different paths to
check arguments depending on whether the arguments have been parsed or
not. Instead, set the values we need from the global ARGV at
first, global initialisation time where they will be thrown away when
the actual arguments are parsed.

To do this some other general refactoring was needed:
- more methods made private when possible
- e.g. `HEAD?` used consistently instead of `head` before arguments
  are parsed.
- formula options are only parsed after named arguments are extracted
2020-05-05 17:47:51 +01:00
Gautham G
b40e33aeb8 ARGV: Deprecate ARGV.cc and replace with Homebrew.args.cc 2020-05-04 11:14:55 +05:30
Bo Anderson
3717815ade ENV/std: fix error when using older/no clang
Fixes #7482.
2020-05-02 13:33:32 +01:00
Gautham G
b0ac5bab31
ARGV: Deprecate ARGV.build_bottle? and replace with Homebrew.args.build_bottle 2020-04-26 13:28:44 +01:00
Bo Anderson
df47668113 ENV/std: conditionally apply AES-NI workaround 2020-04-12 14:50:49 +01:00
Bo Anderson
757cc24f7e ENV/std: restore original make_jobs return type 2020-04-08 20:31:04 +01:00
Mike McQuaid
3381cbf5c7
Use Homebrew::EnvConfig. 2020-04-07 09:58:26 +01:00
Mike McQuaid
1e265247ca
rubocop: apply autofixes. 2020-03-13 21:16:18 +00:00
Issy Long
1f6168fe8a
Change regexp.match?(string) to string.match?(regexp) everywhere
- Only try to call `.match?` on strings that aren't nil.
2019-10-13 23:22:51 +01:00
Issy Long
341ea60807
Auto-fix Style/RedundantBegin offenses
- This also required auto-fixes for Layout/EmptyLinesAroundBlockBody and
  Layout/InconsistentIndentation once the auto-fixer had got rid of the
  "redundant begin"s.
2019-10-13 16:04:27 +01:00
Issy Long
b78028b9c2
Auto-fix Performance/RegexpMatch offenses 2019-10-13 16:04:26 +01:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
EricFromCanada
89f0fcedbe whitespace fixes 2019-04-13 21:32:04 -04:00
EricFromCanada
fa6404e0f5 grammar fixes 2019-04-13 21:29:32 -04:00
Mike McQuaid
d64429a736
rubocop: enable Style/IfUnlessModifier. 2019-02-21 12:55:49 +00:00
Mike McQuaid
1aa8ad09e2
Deprecate macOS versions below Mavericks
And remove all dead/unneeded code.
2019-01-27 12:27:47 +00:00
Mike McQuaid
170c5493a4
Update deprecations
- Add some `odeprecated`
- Make some `odeprecated` now `odisabled`
- Remove `odisabled` code.
- Remove old update migrations
- Remove GCC 4.0 compiler
- Remove Tiger-only code
- Remove 32-bit-only code
- Remove use of LD64
- Remove GCC 4.3 - 4.8 support.
2019-01-08 19:13:46 +00:00
Claudia
a72af2c8a6
Disable cop for #set_cpu_flags, #set_cpu_cflags
In `extend/ENV/std.rb`, the methods `set_cpu_flags` and
`set_cpu_cflags` have been violating the `Naming/AccessorMethodName`
cop.

A recent modification in #7e13b3749 woke up the cop. That means we’re
likely dealing with legacy code here, predating the introduction of
RuboCop into Homebrew.

This commit disables the cop for either method. I believe refactoring
wouldn’t currently be worth the effort, especially given that
`#set_cpu_cflags` is mostly called without arguments.
2019-01-08 08:13:25 +01:00
Mike McQuaid
7e13b37495
ENV: default CFLAGS to bottle values.
This reduces the deviation in compilation flags on a given OS between
users and between bottling/not bottling to provide a consistent
behaviour for debugging and support.
2019-01-06 21:27:15 +00:00
Mike McQuaid
e6e534157c
ENV/super: copy Hackintosh comment from ENV/std. 2018-12-20 20:09:45 +00:00
Shaun Jackman
d75f5dacfa test: Fix ENV.cxx11
ENV.cxx11 in a test block fails on Linux with
Error: ibex: failed
An exception occurred within a child process:
NoMethodError: undefined method `non_apple_gcc_version'
See for example brew test ibex on Linux.
2018-12-13 15:46:12 -08:00
EricFromCanada
20167e5f1b Adjust comments to tidy API docs output. 2018-10-18 21:42:43 -04:00
Viktor Szakats
a0d971a0d0 secure/fix URLs 2018-10-03 21:21:05 +00:00
Shaun Jackman
4addff3b2b determine_optflags: Default is -march=native 2018-10-03 11:41:39 -07:00
Shaun Jackman
1cdc34eec3 Default compiler is gcc on Linux 2018-09-30 11:20:35 -07:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Mike McQuaid
a2febc8971
Revert "std: use HOMEBREW_ARCH env var on Linux" 2018-09-06 09:16:13 +01:00
Caleb Xu
90c25bf913 std: use HOMEBREW_ARCH env var on Linux
Unlike macOS, Linux installations can be installed/deployed on a
variety of hardware. The HOMEBREW_ARCH environment variable
allows the end user to set a custom -march=... option for the
compiler. If the variable is not set, it defaults to "native".

This only applies on Linux; on macOS, behavior remains unchanged.
2018-09-05 16:06:11 -04:00
Shaun Jackman
e752e583d6 Add LD_* environment variables to SANITIZED_VARS
Sanitize the Linux environment variables
LD_LIBRARY_PATH LD_PRELOAD LD_RUN_PATH
2018-08-14 11:45:40 -07:00
Mike McQuaid
4fe0adf587
shared: fix HOMEBREW_CCCFG reference. 2018-07-12 19:59:06 +01:00
Maxim Belkin
67ea581e4a
extend/ENV/shared.rb: [new method] append_to_cccfg
append_to_cccfg properly appends values to HOMEBREW_CCCFG variable
2018-07-12 12:20:38 -05:00
Maxim Belkin
bb82f05952
Properly append values to HOMEBREW_CCCFG 2018-07-12 12:19:04 -05:00
Mike McQuaid
14364bbaee extend/ENV: support CX11 for LLVM Clang.
Fix some checks for `:clang` which should match for either `:clang` or
`:llvm_clang`. Note that's not every check.
2018-07-05 20:15:57 +01:00
Shaun Jackman
9f8f8ffb89 superenv: Move Linux-specific bits to extend/os/ 2018-05-30 14:00:26 -07:00
Shaun Jackman
76bfd0cecb Add superenv for Linux 2018-05-18 16:58:21 -07:00
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Mike McQuaid
9b1bd5f45a system_config: don’t output std/superenv vars. 2018-04-02 09:40:39 +01:00
Mike McQuaid
740e89d2f3
super: tweak LLVM refactoring. 2018-03-07 15:00:08 +00:00
Mike McQuaid
7cb6ebf3fb
super: refactor LLVM path addition. 2018-03-06 08:44:47 +00:00
Alex Wang
7b94842610 Split ternary for PATH building into if/else cases 2018-02-28 09:26:15 -05:00
Alex Wang
bfa474857a Add macOS libs ahead of brewed llvm libs in lib search path
This ensures that libraries that are built with brewed LLVM but not
included in the Command Line Tools/Xcode (e.g. libomp) can be found
during a build, while still using system libraries for the essential
stuff (e.g. libc++)
2018-02-26 18:35:34 -05:00
Mike McQuaid
f72aba548d ENV/std: fully extend from HOMEBREW_PATH.
Rather than just re-adding HOMEBREW_PREFIX/bin if it's missing re-add
everything from HOMEBREW_PATH. This works well with or without
environment filtering being enabled but with environment filtering it
ensures that ENV/std just builds on the original user environment.
2017-10-29 13:41:51 +00:00
Markus Reiter
9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
Mike McQuaid
cf5fdeef1d Rubocop: manual rule fixes. 2017-09-24 21:23:59 +01:00