Skip to content
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

Update deprecations #5477

Merged
merged 1 commit into from
Jan 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions Library/Homebrew/brew.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

require_relative "global"

require "update_migrator"

begin
trap("INT", std_trap) # restore default CTRL-C handler

Expand Down Expand Up @@ -77,14 +75,15 @@
# `Homebrew.help` never returns, except for external/unknown commands.
end

# Migrate LinkedKegs/PinnedKegs if update didn't already do so
UpdateMigrator.migrate_legacy_keg_symlinks_if_necessary

# Uninstall old brew-cask if it's still around; we just use the tap now.
if cmd == "cask" && (HOMEBREW_CELLAR/"brew-cask").exist?
system(HOMEBREW_BREW_FILE, "uninstall", "--force", "brew-cask")
end

if ENV["HOMEBREW_BUILD_FROM_SOURCE"]
odeprecated("HOMEBREW_BUILD_FROM_SOURCE", "--build-from-source")
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, please tell me that this variable and cmdline flag are not going away.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chdiza @RandomDSdevel Yes, the HOMEBREW_BUILD_FROM_SOURCE environment variable is going away. It tells people to not file issues they encounter but they keep doing so regardless. This is a waste of time for the Homebrew maintainers.

Homebrew is not a from-source package manager any more. #5491 means that building from source is going to generate identical output to bottles. Homebrew/homebrew-core#31510 means there will be no reason to build from source when using the supported Homebrew installation location. --build-from-source is sticking around for people to be able to reproduce issues by building specific packages from source on request.

Copy link

@rw rw Jan 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MikeMcQuaid I apologize that people report issues about source builds. I did that once, before I understood that they weren't officially supported. However, building from source is an extremely valuable feature to me. Allowing users to set HOMEBREW_BUILD_FROM_SOURCE feels right. Personally, I love digging through the source code of installed programs and libraries, and seeing their make invocations go flying by. In fact, it was this easy accessibility of local source code that pulled me into the open-source movement (I help maintain the FlatBuffers project as a volunteer). Furthermore, it gives me peace of mind in the unfortunate event that there are more security issues with Bottle generation: building from source decentralizes the creation of binary artifacts. It's clear that you spend a lot of time maintaining this project, and for that we are thankful. If you would please consider keeping HOMEBREW_BUILD_FROM_SOURCE available, for deeply-technical and curious enthusiasts like myself, I'm positive many of us on the nerdy fringes will continue to love this project.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rw You can still dig through the source code with brew install --interactive or brew install --build-from-source. You cannot globally tell Homebrew to build everything from source as it's a waste of both your time and our time when people file issues. Additionally, (and I'm not actually joking here) it's also a waste of energy to compile everything repeatedly unnecessarily.

We are not bringing back this variable, sorry.


if internal_cmd
Homebrew.send cmd.to_s.tr("-", "_").downcase
elsif which "brew-#{cmd}"
Expand Down
12 changes: 12 additions & 0 deletions Library/Homebrew/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ then
HOMEBREW_FORCE_BREWED_CURL="1"
fi

# Announce pre-Mavericks deprecation now
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "100900" ]]
then
printf "WARNING: Your version of macOS (%s) will not be able to run Homebrew when\n" "$HOMEBREW_MACOS_VERSION" >&2
printf " version 2.0.0 is released (Q1 2019)!\n" >&2
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "100700" ]]
then
printf " For 10.4 - 10.6 support see: https://github.com/mistydemeo/tigerbrew\n" >&2
fi
printf "\n" >&2
fi

# The system Git on macOS versions before Sierra is too old for some Homebrew functionality we rely on.
HOMEBREW_MINIMUM_GIT_VERSION="2.14.3"
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101200" ]]
Expand Down
7 changes: 3 additions & 4 deletions Library/Homebrew/cmd/install.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
#:
#: If `--cc=`<compiler> is passed, attempt to compile using <compiler>.
#: <compiler> should be the name of the compiler's executable, for instance
#: `gcc-8` for gcc 8, `gcc-4.2` for Apple's GCC 4.2, or `gcc-4.9` for a
#: Homebrew-provided GCC 4.9. In order to use LLVM's clang, use
#: `llvm_clang`. To specify the Apple-provided clang, use `clang`. This
#: parameter will only accept compilers that are provided by Homebrew or
#: `gcc-7` for GCC 7. In order to use LLVM's clang, use `llvm_clang`.
#: To specify the Apple-provided clang, use `clang`.
#: This parameter will only accept compilers that are provided by Homebrew or
#: bundled with macOS. Please do not file issues if you encounter errors
#: while using this flag.
#:
Expand Down
3 changes: 1 addition & 2 deletions Library/Homebrew/cmd/prune.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ def prune_args
def prune
prune_args.parse

# TODO: deprecate and hide from manpage for next minor release.
# odeprecated("'brew prune'", "'brew cleanup'")
odeprecated("'brew prune'", "'brew cleanup'")
Cleanup.new(dry_run: args.dry_run?).prune_prefix_symlinks_and_directories
end
end
19 changes: 0 additions & 19 deletions Library/Homebrew/cmd/update-report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
require "formulary"
require "descriptions"
require "cleanup"
require "update_migrator"
require "description_cache_store"

module Homebrew
Expand Down Expand Up @@ -83,13 +82,6 @@ def update_report
updated = true
end

out, _, status = system_command("git",
args: ["describe", "--tags", "--abbrev=0", initial_revision],
chdir: HOMEBREW_REPOSITORY,
print_stderr: false)

initial_version = Version.new(out) if status.success?

updated_taps = []
Tap.each do |tap|
next unless tap.git?
Expand All @@ -112,11 +104,6 @@ def update_report
updated = true
end

UpdateMigrator.migrate_legacy_cache_if_necessary
UpdateMigrator.migrate_cache_entries_to_double_dashes(initial_version)
UpdateMigrator.migrate_cache_entries_to_symlinks(initial_version)
UpdateMigrator.migrate_legacy_keg_symlinks_if_necessary

if !updated
if !ARGV.include?("--preinstall") && !ENV["HOMEBREW_UPDATE_FAILED"]
puts "Already up-to-date."
Expand All @@ -140,12 +127,6 @@ def update_report
Tap.each(&:link_completions_and_manpages)

Homebrew.failed = true if ENV["HOMEBREW_UPDATE_FAILED"]

# This should always be the last thing to run (but skip on auto-update).
if !ARGV.include?("--preinstall") ||
ENV["HOMEBREW_ENABLE_AUTO_UPDATE_MIGRATION"]
UpdateMigrator.migrate_legacy_repository_if_necessary
end
end

def shorten_revision(revision)
Expand Down
38 changes: 1 addition & 37 deletions Library/Homebrew/cmd/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,39 +66,6 @@ git_init_if_necessary() {
fi
}

rename_taps_dir_if_necessary() {
local tap_dir
local tap_dir_basename
local tap_dir_hyphens
local user
local repo

for tap_dir in "$HOMEBREW_LIBRARY"/Taps/*
do
[[ -d "$tap_dir/.git" ]] || continue
tap_dir_basename="${tap_dir##*/}"
if [[ "$tap_dir_basename" = *"-"* ]]
then
# only replace the *last* dash: yes, tap filenames suck
user="$(echo "${tap_dir_basename%-*}" | tr "[:upper:]" "[:lower:]")"
repo="$(echo "${tap_dir_basename:${#user}+1}" | tr "[:upper:]" "[:lower:]")"
mkdir -p "$HOMEBREW_LIBRARY/Taps/$user"
mv "$tap_dir" "$HOMEBREW_LIBRARY/Taps/$user/homebrew-$repo"

tap_dir_hyphens="${tap_dir_basename//[^\-]}"
if [[ ${#tap_dir_hyphens} -gt 1 ]]
then
echo "Homebrew changed the structure of Taps like <someuser>/<sometap>." >&2
echo "So you may need to rename $HOMEBREW_LIBRARY/Taps/$user/homebrew-$repo manually." >&2
fi
else
echo "Homebrew changed the structure of Taps like <someuser>/<sometap>. " >&2
echo "$tap_dir is an incorrect Tap path." >&2
echo "So you may need to rename it to $HOMEBREW_LIBRARY/Taps/<someuser>/homebrew-<sometap> manually." >&2
fi
done
}

repo_var() {
local repo_var

Expand Down Expand Up @@ -427,15 +394,12 @@ EOS
lock update

git_init_if_necessary
# rename Taps directories
# this procedure will be removed in the future if it seems unnecessary
rename_taps_dir_if_necessary

safe_cd "$HOMEBREW_REPOSITORY"

# if an older system had a newer curl installed, change each repo's remote URL from GIT to HTTPS
if [[ -n "$HOMEBREW_SYSTEM_CURL_TOO_OLD" &&
-x "$HOMEBREW_PREFIX/opt/curl/bin/curl" &&
-x "$HOMEBREW_PREFIX/opt/curl/bin/curl" &&
"$(git config remote.origin.url)" =~ ^git:// ]]
then
git config remote.origin.url "$BREW_OFFICIAL_REMOTE"
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/cmd/upgrade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ def upgrade
# TODO: deprecate for next minor release.
if ARGV.include?("--cleanup")
ENV["HOMEBREW_INSTALL_CLEANUP"] = "1"
# odeprecated("'brew upgrade --cleanup'", "'HOMEBREW_INSTALL_CLEANUP'")
odeprecated("'brew upgrade --cleanup'", "'HOMEBREW_INSTALL_CLEANUP'")
elsif ENV["HOMEBREW_UPGRADE_CLEANUP"]
ENV["HOMEBREW_INSTALL_CLEANUP"] = "1"
# odeprecated("'HOMEBREW_UPGRADE_CLEANUP'", "'HOMEBREW_INSTALL_CLEANUP'")
odeprecated("'HOMEBREW_UPGRADE_CLEANUP'", "'HOMEBREW_INSTALL_CLEANUP'")
end

FormulaInstaller.prevent_build_flags unless DevelopmentTools.installed?
Expand Down
3 changes: 2 additions & 1 deletion Library/Homebrew/compat.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
require "compat/extend/os/mac/utils/bottles"
require "compat/os/mac"
require "compat/requirements/x11_requirement"
require "compat/requirements/xcode_requirement"
require "compat/cask"
require "compat/download_strategy"
require "compat/fileutils"
require "compat/formula"
require "compat/tap"
5 changes: 1 addition & 4 deletions Library/Homebrew/compat/cask.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
require "compat/cask/cask_loader"
require "compat/cask/cmd/--version"
require "compat/cask/cmd/cleanup"
require "compat/cask/cmd/search"
require "compat/cask/cache"
require "compat/cask/cask_loader"
require "compat/cask/caskroom"
require "compat/cask/dsl"

Expand Down
31 changes: 0 additions & 31 deletions Library/Homebrew/compat/cask/cmd/--version.rb

This file was deleted.

29 changes: 0 additions & 29 deletions Library/Homebrew/compat/cask/cmd/cleanup.rb

This file was deleted.

20 changes: 0 additions & 20 deletions Library/Homebrew/compat/cask/cmd/search.rb

This file was deleted.

20 changes: 10 additions & 10 deletions Library/Homebrew/compat/download_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# distribution. (It will work for public buckets as well.)
class S3DownloadStrategy < CurlDownloadStrategy
def initialize(url, name, version, **meta)
odeprecated("S3DownloadStrategy",
odisabled("S3DownloadStrategy",
"a vendored S3DownloadStrategy in your own formula or tap (using require_relative)")
super
end
Expand Down Expand Up @@ -58,7 +58,7 @@ class GitHubPrivateRepositoryDownloadStrategy < CurlDownloadStrategy
require "utils/github"

def initialize(url, name, version, **meta)
odeprecated("GitHubPrivateRepositoryDownloadStrategy",
odisabled("GitHubPrivateRepositoryDownloadStrategy",
"a vendored GitHubPrivateRepositoryDownloadStrategy in your own formula or tap (using require_relative)")
super
parse_url_pattern
Expand Down Expand Up @@ -112,7 +112,7 @@ def validate_github_repository_access!
# environment variables HOMEBREW_GITHUB_API_TOKEN) to sign the request.
class GitHubPrivateRepositoryReleaseDownloadStrategy < GitHubPrivateRepositoryDownloadStrategy
def initialize(url, name, version, **meta)
odeprecated("GitHubPrivateRepositoryReleaseDownloadStrategy",
odisabled("GitHubPrivateRepositoryReleaseDownloadStrategy",
"a vendored GitHubPrivateRepositoryReleaseDownloadStrategy in your own formula or tap (using require_relative)")
super
end
Expand Down Expand Up @@ -168,7 +168,7 @@ def fetch_release_metadata
# ...
class ScpDownloadStrategy < AbstractFileDownloadStrategy
def initialize(url, name, version, **meta)
odeprecated("ScpDownloadStrategy",
odisabled("ScpDownloadStrategy",
"a vendored ScpDownloadStrategy in your own formula or tap (using require_relative)")
super
parse_url_pattern
Expand Down Expand Up @@ -214,11 +214,11 @@ module Compat
def detect_from_url(url)
case url
when %r{^s3://}
odeprecated("s3://",
odisabled("s3://",
"a vendored S3DownloadStrategy in your own formula or tap (using require_relative)")
S3DownloadStrategy
when %r{^scp://}
odeprecated("scp://",
odisabled("scp://",
"a vendored ScpDownloadStrategy in your own formula or tap (using require_relative)")
ScpDownloadStrategy
else
Expand All @@ -229,20 +229,20 @@ def detect_from_url(url)
def detect_from_symbol(symbol)
case symbol
when :github_private_repo
odeprecated(":github_private_repo",
odisabled(":github_private_repo",
"a vendored GitHubPrivateRepositoryDownloadStrategy in your own formula or tap (using require_relative)")
GitHubPrivateRepositoryDownloadStrategy
when :github_private_release
odeprecated(":github_private_repo",
odisabled(":github_private_repo",
"a vendored GitHubPrivateRepositoryReleaseDownloadStrategy in your own formula or tap "\
"(using require_relative)")
GitHubPrivateRepositoryReleaseDownloadStrategy
when :s3
odeprecated(":s3",
odisabled(":s3",
"a vendored S3DownloadStrategy in your own formula or tap (using require_relative)")
S3DownloadStrategy
when :scp
odeprecated(":scp",
odisabled(":scp",
"a vendored ScpDownloadStrategy in your own formula or tap (using require_relative)")
ScpDownloadStrategy
else
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/compat/extend/os/mac/utils/bottles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Compat
def tag_without_or_later(tag)
return super unless tag.to_s.end_with?("_or_later")

odeprecated "`or_later` bottles",
odisabled "`or_later` bottles",
"bottles without `or_later` (or_later is implied now)"
tag.to_s[/(\w+)_or_later$/, 1].to_sym
end
Expand Down
16 changes: 0 additions & 16 deletions Library/Homebrew/compat/fileutils.rb

This file was deleted.