-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Separate the Ruby backend from internal Homebrew dependencies #5080
Comments
and add: Advantages: |
Not exactly. From the post:
|
if brew is in stalled then piggyback on |
cc @phinze |
According to the logic of Homebrew#5080, we should move away from calling Homebrew internals, in part because things break over time, as happened here with the implementation of `depends_on_formula` (shortly to become `depends_on :formula`). This re-implements formula dependencies by invoking the Homebrew CLI, which is the only stable API Homebrew guarantees. Fixes Homebrew#5475 Fixes Homebrew#4010
@jawshooah Since we now want to go in the opposite direction, should we close this, or is it still useful in some way? |
No use in leaving it open. |
Background
Homebrew-cask is implemented as a Homebrew external command, in the form of
brew-cask.rb
, which isrequire
d by thebrew
command. This means thatHomebrew-cask has full access to, and is constrained by, the Ruby runtime
provided by Homebrew.
Initially it was thought that Homebrew-cask would re-use much of Homebrew's
code internally. That turned out not to be the case in practice, largely
because Homebrew's code is organized around the Formula.
Proposal
brew-cask.rb
should be re-implemented as an executablebrew-cask
, whichwould be invoked by Homebrew rather than
require
d.brew-cask
wouldthen execute completely independently of Homebrew's Ruby environment.
This would be an internal-only change. The user interface would stay the
same. Commands would still be invoked via
brew cask <verb>
, and we wouldstill piggyback on
brew update
to get new Casks.Advantages
Homebrew-cask frequently breaks due to changes within Homebrew
(force UTF-8 encodings #4732, Adjust to Homebrew's test environment changes #4982, Defend against unusual Homebrew setups #4229, many others).
downloading), we do so only partially, with some methods overridden.
This needlessly obscures what the code is doing, making it more difficult
to diagnose bugs or develop new functionality.
rescue exceptions and direct users to the relevant issues URL. @voanhduy1512
did some good work on this problem, but it still crops up as in Update error #5108. Every
misdirected report is a drain on maintainers (in both projects).
brew cask cleanup
works in a roundaboutway (using tracking symlinks) because we share a download location
with Homebrew. It would be more robust to maintain our own download
cache.
switching to Ruby 2.0 (say, 6 months after Yosemite is released). We
could require Mountain Lion and earlier to install Ruby 2.0 as a
prerequisite. This would not only gain us access to new language
features, but reduce the currently-imposed burden of maintaining
compatibility across Ruby 1.8 and 2.0.
regard to character encodings, interpreter version, monkeypatching -- all
things that, once inherited, we cannot easily undo.
Disadvantages
which are not available externally, as with the tap migration code (automatically transition to new Tap name/location #4169).
However, this also could have been accomplished by copying the relevant
logic from Homebrew.
/usr/local
,which causes
brew doctor
to complain as in Installing truecrypt makes 'brew doctor' unhappy #2350 and others. Currentlywe have a
caveats
warning for this, which is not really a fix. As mentionedin Cleanup after Truecrypt installation #3693, we could fully resolve the problem by installing files to a Homebrew
Cellar, and then symlinking into the Cellar as with any other Homebrew
installation. Such a technique would become more difficult if we could not
call directly into Homebrew.
Places where we currently re-use Homebrew's code (incomplete)
onoe
(example install.rb)cabv
(forkabv
method with better odd-filename defense #2991)brew tap <Tapname>
Cask::CurlDownloadStrategy
(see comments in download_strategy.rb)depends_on_formula
(add dependencies for Homebrew formulae #2305)brew install <formula>
Tracker
roughly 3 August.)
brew-cask.rb
to a bash-script executable shimbrew-cask
(Separate the Ruby backend from Homebrew + Require Ruby 2.x #8089)brew-cask.rb
(a different file) to support the new setup (Separate the Ruby backend from Homebrew + Require Ruby 2.x #8089)Cask::CLI::Update
#8155tap_migrations.rb
#8194patch.rb
from homebrew-fork #8195install_renamed.rb
from homebrew-fork #8196debrew.rb
from homebrew-fork #8197brew cask doctor
for homebrew-fork #8221String
monkeypatches:start_with?
andundent_…_72
#8336with_system_path
method #8340Homebrew
namespaces in homebrew-fork #8369Checksum
class and refactor #8388Tty
#8390os/mac.rb
#8393Tty
class #8402extend/pathname.rb
#8403utils.rb
#8425Pathname#version
#8426Pathname#/
monkeypatch #8428popen_write
#8434download_strategy.rb
#8436Version
class #8446GitHub
class #8447Hash
monkeypatch to separate file #8458cabv
method out ofPathname
monkeypatch #8460MacOS#release
#8461OS::Mac
into our codebase asCask::MacOS
#8539hardware.rb
from homebrew-fork #8557puts_columns
from homebrew-fork into our codebase. #8559which
method #8561exec_editor
#8611ignore_interrupts
utility method #8724MACOS_RELEASE
constants #8870Hbc::SystemCommand
safe for commands with large writes to STDERR as performed by curlHbc::SystemCommand
, migrating it out of homebrew-forkHbc::HbCurlDownloadStrategy
from homebrew-forkHbc::HbSubversionDownloadStrategy
cleanupsshell_quote
methodHbc::SystemCommand
instead ofquiet_system
Hbc::SystemCommand
instead of backticksHbc::HbSubversionDownloadStrategy
from homebrew-forkHbc::HbVCSDownloadStrategy
from homebrew-fork/Library/Caches/Homebrew-cask
, setting value inHbc::Locations
HOMEBREW_CACHE
constant fromglobal.rb
HOMEBREW_CACHE
constant fromtesting_env.rb
, and inject a test value for both rspec and minitest/Library/Caches/Homebrew/Casks
, if seenbrew cask cleanup
(no longer needs to use subdirectory and tracking symlinks)download_strategy.rb
exceptions.rb
global.rb
monkeypatch_pathname.rb
testing_env.rb
utils.rb
lib/vendor/homebrew-fork
Edits:
/usr/local
The text was updated successfully, but these errors were encountered: