brew icon indicating copy to clipboard operation
brew copied to clipboard

casks using: :svn to depend on svn

Open yurikoles opened this issue 2 years ago β€’ 12 comments

Provide a detailed description of the proposed feature

A lot of cask-fonts are using svn to download artifacts, but fail to download on a fresh system. It would be nice if svn will be automatically installed if url is using: :svn.

What is the motivation for the feature?

Less manual steps and font download errors.

How will the feature be relevant to at least 90% of Homebrew users?

Anyone who tries to install on a fresh system wouldn't need to install svn manually.

What alternatives to the feature have been considered?

Explicitly add svn dependency to those casks.

yurikoles avatar Jul 15 '21 09:07 yurikoles

As I understand, this issue was introduced when Xcode CLT stopped shipping svn binary.

yurikoles avatar Jul 15 '21 09:07 yurikoles

Yes, this seems reasonable. Are there any other using: that auto-install dependencies?

MikeMcQuaid avatar Jul 15 '21 11:07 MikeMcQuaid

I'm unsure, I didn't see this before.

yurikoles avatar Jul 18 '21 03:07 yurikoles

Hi! I would like to take a look at this.

If I understand this correctly: New code will probably go here: https://github.com/Homebrew/brew/blob/master/Library/Homebrew/cask/artifact/font.rb

And this property needs to be parsed: https://github.com/Homebrew/brew/blob/1909d89d003bdf1f34775faf81b8c0529729013f/Library/Homebrew/cask/artifact/relocated.rb#L51

is this halfway correct?

Git-Jiro avatar Oct 03 '21 11:10 Git-Jiro

@Git-Jiro don't think it's going to be font-specific logic. @Homebrew/cask folks can provide more help here, feel free to open a PR that's a bit broken and we'll do what we can to help ❀️

MikeMcQuaid avatar Oct 04 '21 12:10 MikeMcQuaid

Note that installing svn happens once ever per machine. It is at worse a minor inconvenience which might not be worth it if it significantly complicates the code.

Alternatives:

  • Relinquish the fonts repo to a third-party. (Not because of this; the matter has been considered before)
  • Remove the SVN dependency in favour of newer git commands.

vitorgalvao avatar Oct 04 '21 12:10 vitorgalvao

Note that for formulae relying on SVN, brew already acknowledges that SVN is a dependency on systems where it isn't installed:

1015-Catalina ~ % brew deps --tree --include-build acme
acme
└── subversion
    β”œβ”€β”€ openjdk
    β”‚   └── autoconf
    β”‚       └── m4
    β”œβ”€β”€ pkg-config
    β”œβ”€β”€ [email protected]
...

The trick is getting brew to install SVN in those cases before attempting to download anything else.

1015-Catalina ~ % brew install -s acme                 
==> Cloning https://svn.code.sf.net/p/acme-crossass/code-0/trunk
==> Checking out 266
You must: brew install svn
Error: acme: Failed to download resource "acme"
Failure while executing; `svn checkout https://svn.code.sf.net/p/acme-crossass/code-0/trunk /Users/serveradmin/Library/Caches/Homebrew/acme--svn --quiet -r 266` exited with 1. Here's the output:
You must: brew install svn

EricFromCanada avatar Oct 22 '21 04:10 EricFromCanada

While messing around with font casks in an experiment, I installed subversion to validate that my experiment's changed didn't break svn fonts. Searching around to check history of my experiment led me to this ticket.

I noted that I had no other reason to have svn installed. Upon installation, it newly installed several dependencies outside of my standard config for Linuxbrew. brew deps --tree subversion was surprising to me. I know some are very common but I'm curious if requiring subversion creates some extra package upgrade burden that would be nice to avoid for folks who otherwise don't need svn or its less-widely installed dependencies.

colindean avatar Jan 10 '22 04:01 colindean

I know some are very common but I'm curious if requiring subversion creates some extra package upgrade burden that would be nice to avoid for folks who otherwise don't need svn or its less-widely installed dependencies.

There's always a way to do it manually. Just svn checkout then tar -czf then brew edit and replace these resources with your local copy - a file:// URL.

I have a related issue though. brew now requires the newest svn for those resources even though an older svn works fine… In my case I'm running High Sierra so the latest bottled svn is [email protected], and building SVN builds some really heavy duty stuff beforehand, AND if I were to upgrade svn sometime later I'd need to upgrade those build dependencies again(!)

Think I need an environment variable that bypasses the svn dependency check and just use whatever svn it found in /usr/local/bin/

Jerry1144 avatar Apr 13 '22 06:04 Jerry1144

Think I need an environment variable that bypasses the svn dependency check and just use whatever svn it found in /usr/local/bin/

No, sorry, we don't wish to adjust behaviour in this way for versions we no longer support (e.g. High Sierra)

MikeMcQuaid avatar Apr 13 '22 14:04 MikeMcQuaid

The built-in svn on older macOS versions can't be relied upon because it's now unable to connect to some repositories, which is why Homebrew pre-installs it when needed. A PR to allow the formula to install on older versions is being discussed at Homebrew/homebrew-core#99023.

EricFromCanada avatar Apr 13 '22 14:04 EricFromCanada

Are there any other using: that auto-install dependencies?

I think it's mercurial, curl, and svn judging from:

https://github.com/Homebrew/homebrew-test-bot/blob/6e5b9dbd11338e55995293df9852ece37123af3d/lib/test_formulae.rb#L40-L59

gibfahn avatar May 10 '22 15:05 gibfahn

It looks like this could probably be handled with git sparse-checkout instead of svn now that https://github.com/Homebrew/brew/pull/14035 got merged in.

An extra only_path: option must be passed with the git url to specify the sparse checkout.

apainintheneck avatar Dec 04 '22 23:12 apainintheneck

It looks like this could probably be handled with git sparse-checkout instead of svn now that #14035 got merged in.

An extra only_path: option must be passed with the git url to specify the sparse checkout.

Yes, this would be ideal solution πŸ‘πŸ». CC @hmarr for thoughts or if you're working on this already.

MikeMcQuaid avatar Dec 05 '22 13:12 MikeMcQuaid

Thanks for the ping @MikeMcQuaid. I just moved the remaining fonts over to git in https://github.com/Homebrew/homebrew-cask-fonts/pull/6725

hmarr avatar Dec 06 '22 01:12 hmarr

Thanks for finishing this off @hmarr!

MikeMcQuaid avatar Dec 06 '22 09:12 MikeMcQuaid