Also enables sandbox for --interactive and --debug use of install
and test, using automatic retention.
Closes#66.
Signed-off-by: Andrew Janke <andrew@apjanke.net>
- add `HOMEBREW_PRODUCT` global variable
- only differentiate between `/usr/local` and `non-/usr/local` Homebrew
prefixes to avoid sharing sensitive user information
- note if e.g. build errors are occurring under CI
- Add `HOMEBREW_NO_ANALYTICS` variable (this will be how people opt-out
when this is enabled for everyone)
- Add `HOMEBREW_ANALYTICS_DEBUG` variable to output all the analytics
that are sent
- Move Bash analytics code to `Library/Homebrew/utils/analytics.sh`
- Add documentation for our analytics and why/what/when/how and opt-out
- Only official Homebrew commands are reported
- Ruby analytics are now reported in a forked, background process
Calling `compute_dependencies` will make sure both requirements and
dependencies are expanded, so that any referenced taps can be
auto-tapped. Prior to this commit only dependencies were expanded for
the sake of auto-tapping, so dependencies of requirements would cause
installation to fail whenever a tap unavailable exception was
encountered.
ClosesHomebrew/homebrew#50271ClosesHomebrew/homebrew#50281.
Signed-off-by: ilovezfs <ilovezfs@icloud.com>
Previously we got all the options based on the build, any inherited
options, any passed options and the tab. We want to make sure that these
then exclude any options that don't exist as, otherwise, passing an
option that doesn't exist (or has been deleted) is enough to stop a
bottle being poured. This was particularly nasty on upgrades where we
deleted options and one left in the tab would stop the bottle being
poured.
ClosesHomebrew/homebrew#47891.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Currently `brew install —build-from-source wget` builds all the
dependencies also from source. I can see people wanting to do this when
`HOMEBREW_BUILD_FROM_SOURCE` is set by passing it on the command-line
is mostly just annoying; it means you have to use `—build-bottle` and
deal with the CFLAGS and `post_install` changes if you want to build
from source. Tweak `formula_installer` so this behaviour is more
intuitive.
ClosesHomebrew/homebrew#47889.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Setting the `FC` environment variable allows the user to override the
default Fortran compiler. The `SharedEnvExtension#fortran` method then
checks whether any of `FCFLAGS` and `FFLAGS` environment variables are
set and, if not, suggests to use `--default-fortran-flags` when running
`brew install`. However, `--default-fortran-flags` never makes it to
`build.rb` (that is executed by `FormulaInstaller`) because the flag is
not whitelisted in `FormulaInstaller#sanitized_ARGV_options`.
This change rectifies this and thereby eliminates the confusing message.
FixesHomebrew/homebrew#47852.
Use FormulaAuditor.audit_prefix_has_contents from audit.rb, which has
better logic.
ClosesHomebrew/homebrew#47678.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
I've set all the variable data to versions that are dependent on the
latest source file date and various modification dates also to the
latest source file date. With this if you rerun `brew bottle`
multiple times in a row you will see the same checksum even if you have
`brew reinstall`ed (as long as upstream does not hardcode e.g. the
build date).
I debugged this with diffoscope and worked on this as part of the
Athens 2015 reproducible builds workshop:
https://reproducible-builds.org/events/athens2015/ClosesHomebrew/homebrew#46587.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
A formula should be built from source by default if the --cc option is
passed to specify a particular compiler.
Added a test to test_formula_installer: test_not_poured_from_bottle_when_compiler_specified
Modified test_formula_installer to assert that the formula was not poured
from a bottle. Similarly modified test_formula_installer_bottle to assert
that the formula *was* installed from a bottle.
Added an install method to the TestballBottle formula (the same as the
Testball formula's install method) so that the TestballBottle formula can
be "built from source".
FixesHomebrew/homebrew#46046 - Build from source should be the default behavior if --cc
option is passed
ClosesHomebrew/homebrew#46162.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
We previously set `ignore_deps?` as true for DependencyInstaller to
avoid duplicated dependencies resolution. (See a9fc82aea30506eeacbddeb8b53fb85de8acb9d4)
However, this will cause problem when pouring bottle of a dependency is
failed. In this case, it will try to build dependency from source but
failed due to uninstalled build deps for this formula.
Another disadvantage for using `ignore_deps?` hack is we cannot
distinguish users passing `--ignore-dependencies` flag from we are in
`DependencyInstaller`.
So, let's differentiate these using `skip_deps_check?`
Long term it would be nice to sandbox everything that writes to DerivedData
but it is essentially a cache directory of sorts.
The downside of allowing stuff to write there particularly is that DerivedData
is notoriously bad at getting cleaned up, so if you do a lot of Xcode-using
installations very quickly, you can chew your disk space up.
ClosesHomebrew/homebrew#43276.
Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
Sometimes we accidentally install files outside prefix. After we fix that,
users will get nasty link conflict error. So we create a whitelist here to
allow overwriting certain files. e.g.
link_overwrite "bin/foo", "lib/bar"
link_overwrite "share/man/man1/baz-*"
During FormulaInstaller#link, the whitelist conflict files will be
backup into HOMEBREW_CACHE/Backup
add guard in Formula#file_modified? to prevent git popup
add guard in Superenv.bin before calling MacOS::Xcode.version
add guard against missing Xcode/CLT in Xcode.uncached_version
return nil instread of 0 in uncached_version when Xcode/CLT are not present, to distinguish from linuxbrew behavior
checks against pour_bottle? and needs_relocation?, add guard around keg.relocate_install_names to check pour_bottle?/needs_relocation? as well
needs_relocation? becomes skip_relocation?, use cellar attr to indicate relocation instead of does_not_need_relocation
MacOS.can_build? becomes MacOS.has_apple_developer_tools?
Add these new errors, and guards in formula installation and
cmd/{,un,re}install to match, move can_build? to the MacOS module,
flatten conditions, remove redundant can_build? check
reinstate removed (doctor) check
Check @@attempted for cctools so that we only attempt the relocation
install once, skip cxxstdlib check in cctools to prevent otool
execution prior to installation, skip fixing install names if
relocation is not required
Install it as a dependency unless already satisfied by Xcode.
require cctools_requirement
cctools_requirement should be satisfied by cctools present in opt
add build_env => false to the satify block options in CctoolsRequirement