775 Commits

Author SHA1 Message Date
Xu Cheng
5045fc95bf FormulaInstaller: raise if pouring bottle failed and no Xcode/CLT installed 2015-09-26 13:51:56 +08:00
Xu Cheng
d911b5689a keg_relocate: split relocate_install_names and relocate_text_files
For bottle with `:any_skip_relocation`, relocating text files is
required.
2015-09-12 01:38:59 +08:00
Xu Cheng
3638c057f0 FormulaInstaller: reset git_available? when installing git
Closes Homebrew/homebrew#43693

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-09 12:22:03 +08:00
Xu Cheng
f279a13977 formula_installer: fix syntax warning
Library/Homebrew/formula_installer.rb:636: warning: shadowing outer local variable - conflict_file
Library/Homebrew/formula_installer.rb:636: warning: shadowing outer local variable - backup_file

Closes Homebrew/homebrew#43602.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-06 20:15:38 +08:00
Alex Dunn
818c65542d remove Formula#file_modified?
It's been more trouble than it's worth.

Fixes Homebrew/homebrew#43607.
Closes Homebrew/homebrew#43049.

Closes Homebrew/homebrew#43615.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-09-06 13:13:59 +01:00
Xu Cheng
8830e401a9 formula_installer: check has_apple_developer_tools? once
Closes Homebrew/homebrew#43534.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-06 15:00:45 +08:00
Xu Cheng
ddb630b01c move sudo -k to formula_installer
sudo -k cannot be used inside sandbox

Closes Homebrew/homebrew#43345.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-28 17:15:29 +08:00
Dominyk Tiller
98499d1d29 sandbox: permit /var/tmp & DerivedData
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.

Closes Homebrew/homebrew#43276.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-08-25 22:01:24 +01:00
Xu Cheng
5266ff2739 formula_installer: tweak word 2015-08-23 23:30:14 +08:00
Xu Cheng
09c810c7f4 add link_overwrite DSL
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
2015-08-23 21:43:03 +08:00
Xu Cheng
9f20679366 formula_installer: fix when bottle pouring when creating new bottle
Formula#bottle_specification always exists, while Formula#bottle only
exists if the bottle is available and compatible.
2015-08-22 14:19:22 +08:00
Xu Cheng
a88c40b8c8 core file style update 2015-08-22 13:15:33 +08:00
Misty De Meo
727239e12f Merge bottle install without Xcode branch
Merge branch 'bottle_hooks'
2015-08-21 11:04:22 -07:00
William Woodruff
12b25f59cc Only print dep installation notice when deps will be installed 2015-08-21 11:02:33 -07:00
William Woodruff
8793a68ee4 Add no-Xcode documentation for all classes, methods 2015-08-21 11:02:33 -07:00
William Woodruff
1face808f5 Add guards to calls that would trigger Xcode install requests
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?
2015-08-21 11:02:33 -07:00
William Woodruff
f58506ea6f FormulaInstaller: add prevent_build_flags to eliminate code repetition
remove unneeded definition

change variable in FormulaInstaller.check_build_flags from bf to build_flags
2015-08-21 10:59:35 -07:00
William Woodruff
91e598cf3f Install: add BuildToolsError and BuildFlagsError
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
2015-08-21 10:59:09 -07:00
William Woodruff
76dcad7c82 Split compute_and_install_dependencies
This is so so that check_dependencies_bottled can be called when bottles
are being poured; implement check_dependencies_bottled
2015-08-21 10:58:45 -07:00
William Woodruff
8aad523063 Formula_installer: only attempt relocation install once
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
2015-08-21 10:57:48 -07:00
William Woodruff
b46d5de492 Requirements: add CctoolsRequirement
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
2015-08-21 10:57:20 -07:00
William Woodruff
dcfac4f571 add install_relocation_tools stub 2015-08-21 10:56:46 -07:00
Rafael Kitover
74b18bfe12 put caveats in finish after post_install Homebrew/homebrew#42565
When running brew -v install, long post_install output from the formula,
presumably from upstream, may hide the important instructions in the
caveats and confuse the user. For example, postgresql runs initdb which
prints its own instructions for running the database, making the caveats
scroll off screen.

Per xu-cheng's instructions in Homebrew/homebrew#42565 :

Remove the explicit call to caveats from the install, reinstall, and
upgrade commands, as well as the dependency installer code in
FormulaInstaller#install_dependency , and call caveats right before the
summary code in FormulaInstaller#finish .

Closes Homebrew/homebrew#42565.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-09 20:08:42 +08:00
Xu Cheng
e60dc64828 only run post_install if it's defined
Closes Homebrew/homebrew#42593.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-08 17:50:49 +08:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Xu Cheng
2ebd1c974b print sandbox message
Closes Homebrew/homebrew#42293.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-31 19:52:36 +08:00
Xu Cheng
8c7b629149 formula_installer: relocate bottle immediately after it's poured
Closes Homebrew/homebrew#42268.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-30 20:11:19 +08:00
Xu Cheng
1845706187 formula_installer: better priority for pour_bottle? 2015-07-24 16:08:44 +08:00
Dominyk Tiller
2751449abb formula_installer: tweak priority of true
Closes Homebrew/homebrew#41913.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-07-23 22:29:31 +01:00
Dominyk Tiller
b06af00d76 formula_installer: don't flag fs builds 2015-07-23 22:28:07 +01:00
Xu Cheng
8cebb64eec auto disable sandbox for interactive shell
Closes Homebrew/homebrew#38792.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-22 15:12:15 +08:00
Alex Dunn
da2e4d417d fetch/build formula from source when modified
closes Homebrew/homebrew#36068

Closes Homebrew/homebrew#41397.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-07-18 19:30:30 -07:00
Xu Cheng
05c0fcb5ee formula_installer: remove duplicated hold_locks check
It'll be checked inside `FormulaInstaller#unlock` method.

Closes Homebrew/homebrew#41820.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-18 13:59:52 +08:00
Jack Nagel
7690a00d04 Stdlib check should use the compiler used to build the bottle 2015-06-27 20:04:45 -04:00
Jack Nagel
f13ac9b0c8 Decouple the local bottle strategy from the formula 2015-06-15 21:32:15 -04:00
Misty De Meo
6d5632cd8f Formula: always print keg_only_text
Fixes Homebrew/homebrew#40724.

Closes Homebrew/homebrew#40725.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2015-06-15 08:21:08 -07:00
Mike McQuaid
a631ae1983 formula_installer: don't install runtime dependencies from bottles.
They haven't been linked against so we don't care.

Closes Homebrew/homebrew#40410.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-06-10 15:25:28 +01:00
Xu Cheng
12f0472a7d formula_installer: use Formula#full_name 2015-05-29 17:02:23 +08:00
Mike McQuaid
fc5070c252 formula_installer: set tap source for bottles.
This defaults to the value that's in the bottle but that isn't
necessarily correct. For example, some Boxen modules will reuse our
old bottles and so if they are installed from there we should be sure
to set the tab's tap to the tap we've installed from rather than the one
set inside the bottle's tarball.

Closes Homebrew/homebrew#40096.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-05-27 10:21:46 +01:00
Jack Nagel
e04e898d5c Avoid explicit control flow 2015-05-12 20:33:34 -04:00
Jack Nagel
71f4e90cdb Handle deprecated options in dependency specifications
Fixes Homebrew/homebrew#38069.
2015-05-11 22:07:14 -04:00
Xu Cheng
272d68740f Use TapFormulaUnavailableError instead of HOMEBREW_TAP_FORMULA_REGEX
Closes Homebrew/homebrew#39307.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-05-03 22:53:22 +08:00
Jack Nagel
2ca8172fe9 Let the test environment inject its own load path 2015-04-29 19:15:11 -04:00
Jack Nagel
16dfe3dd40 Add Formula#logs 2015-04-25 23:14:05 -04:00
Xu Cheng
adedbb86f1 sandbox: record log
Closes Homebrew/homebrew#38711.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-04-17 14:09:24 +08:00
Jack Nagel
c2dcd91bd1 Eliminate a place where ARGV is mutated 2015-04-16 22:20:59 -04:00
Xu Cheng
d1617e86d0 sandbox postinstall
Closes Homebrew/homebrew#38479.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-04-15 19:51:54 +08:00
Xu Cheng
a6be0b5bb8 sandbox: redesign API 2015-04-15 19:51:54 +08:00
Xu Cheng
06f72ab38f move safe_fork into a standalone method 2015-04-15 19:51:54 +08:00
Xu Cheng
2f529220e7 preliminary write control only sandbox
Closes Homebrew/homebrew#38361.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-04-09 17:42:54 +08:00