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

libxmlsec1 formula can't seem to pin or roll back to 1.2.37 #135418

Closed
4 tasks done
dpritchett opened this issue Jun 30, 2023 · 5 comments
Closed
4 tasks done

libxmlsec1 formula can't seem to pin or roll back to 1.2.37 #135418

dpritchett opened this issue Jun 30, 2023 · 5 comments
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age

Comments

@dpritchett
Copy link

dpritchett commented Jun 30, 2023

brew gist-logs <formula> link OR brew config AND brew doctor output

brew config

> brew config
HOMEBREW_VERSION: 4.0.26-29-g9a482de
ORIGIN: https://github.com/Homebrew/brew
HEAD: 9a482dea2b4a4f076a420f5e80a5a4857c66df9d
Last commit: 19 hours ago
Core tap JSON: 30 Jun 16:24 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_BAT_THEME: Monokai Extended Bright
HOMEBREW_CASK_OPTS: []
HOMEBREW_EDITOR: vim
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: dodeca-core 64-bit arm_blizzard_avalanche
Clang: 14.0.3 build 1403
Git: 2.39.2 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.88.1 => /usr/bin/curl
macOS: 13.4-arm64
CLT: 14.3.1.0.1.1683849156
Xcode: N/A
Rosetta 2: false

brew doctor

> brew doctor
Your system is ready to brew.

Verification

  • My "brew doctor output" says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

The April 1.3 release of libxmlsec1 breaks some XML/SAML functionality baked into python-xmlsec (see xmlsec/python-xmlsec#254). I'm not a Homebrew wizard but folks have been struggling to roll back or otherwise pin to 1.2.37.

Despite a few readings of Homebrew's Formula version schema guidance docs since April I'm not quite sure if this is something that can be easily resolved with a change to the currently published libxmlsec1 formula.

The last commit to the libxmlsec1 formula before 1.3 rolled out is here: https://raw.githubusercontent.com/Homebrew/homebrew-core/7f35e6ede954326a10949891af2dba47bbe1fc17/Formula/libxmlsec1.rb

I've tried a few ways to use brew extract to make my own copy or maybe even fork the last-known-good v1.2.37 formula over to github.com/dpritchett but so far I'm not having much luck.

FWIW there are a good number of other folks experiencing this issue and not just me, so a libxmlsec1@1.2 formula might be a decent fix for them. I'm getting by with my lame hack of just cloning the aforementioned 1.2.37 revision of the formula and running brew install --formula /tmp/libxmlsec1.rb

What happened (include all command output)?

Not much, there doesn't seem to be a way to pull that specific revision of the formula short of maybe creating a fork of the formula.

> brew install libxmlsec1@1.2.37
Warning: No available formula with the name "libxmlsec1@1.2.37". Did you mean libxmlsec1?
==> Searching for similarly named formulae and casks...
==> Formulae
libxmlsec1

To install libxmlsec1, run:
  brew install libxmlsec1
> brew install libxmlsec1@1.2
Warning: No available formula with the name "libxmlsec1@1.2". Did you mean libxmlsec1?
==> Searching for similarly named formulae and casks...
==> Formulae
libxmlsec1

To install libxmlsec1, run:
  brew install libxmlsec1
> brew list --versions libxmlsec1
>

What did you expect to happen?

Ideally there'd be a reliable one-line command to install the latest libxmlsec1 v1.2.x.

Step-by-step reproduction instructions (by running brew commands)

## check for available versions


> brew list --debug --verbose --versions libxmlsec1

libxmlsec1 1.3.1_1
@dpritchett dpritchett added the bug Reproducible Homebrew/homebrew-core bug label Jun 30, 2023
@carlocab
Copy link
Member

There's already a comment in the issue that you link explaining how to do this: xmlsec/python-xmlsec#254 (comment)

If you encounter errors doing brew extract, try:

export HOMEBREW_NO_INSTALL_FROM_API=1
brew tap homebrew/core

and then try brew extract again. You can

unset HOMEBREW_NO_INSTALL_FROM_API
brew untap homebrew/core

when you're done.

@dpritchett
Copy link
Author

Thanks for the quick response @carlocab but I'm not sure how to extract a specific revision of the formula by synthesizing your advice and that of the comment you've linked. I package it up in a bash script and ran it, here's the script and the failure log.

I'm not quite sure what I've missed here — seems like the brew extract --version command is going to struggle to identify the 1.2.37 revision of the libxmlsec1 formula.

I'm now digging into the source for brew extract at Homebrew/dev-cmd/extract.rb#L95 to see what I might be misunderstanding.

my new extractor script as written

> cat ./install-libxmlsec-1.2.37.bash
#!/bin/bash

set -eo pipefail
set -vx

# create a local tap for specific versions of formulas
brew tap-new $USER/local

# download the desired version and extract it as a local formula
export HOMEBREW_NO_INSTALL_FROM_API=1
brew tap homebrew/core
brew extract --version=1.2.37 libxmlsec1 $USER/local
brew install $USER/local/libxmlsec@1.2.37

unset HOMEBREW_NO_INSTALL_FROM_API
brew untap homebrew/core

log of running my script and not quite achieving the desired outcome

> ./install-libxmlsec-1.2.37.bash

# create a local tap for specific versions of formulas
brew tap-new $USER/local
+ brew tap-new daniel/local
Initialized empty Git repository in /opt/homebrew/Library/Taps/daniel/homebrew-local/.git/
[main (root-commit) 3784d6b] Create daniel/local tap
 3 files changed, 90 insertions(+)
 create mode 100644 .github/workflows/publish.yml
 create mode 100644 .github/workflows/tests.yml
 create mode 100644 README.md
==> Created daniel/local
/opt/homebrew/Library/Taps/daniel/homebrew-local

When a pull request making changes to a formula (or formulae) becomes green
(all checks passed), then you can publish the built bottles.
To do so, label your PR as `pr-pull` and the workflow will be triggered.

# download the desired version and extract it as a local formula
export HOMEBREW_NO_INSTALL_FROM_API=1
+ export HOMEBREW_NO_INSTALL_FROM_API=1
+ HOMEBREW_NO_INSTALL_FROM_API=1
brew tap homebrew/core
+ brew tap homebrew/core
brew extract --version=1.2.37 libxmlsec1 $USER/local
+ brew extract --version=1.2.37 libxmlsec1 daniel/local
==> Searching repository history
==> Writing formula for libxmlsec1 from revision 17a2c4d to:
/opt/homebrew/Library/Taps/daniel/homebrew-local/Formula/libxmlsec1@1.2.37.rb
brew install $USER/local/libxmlsec@1.2.37
+ brew install daniel/local/libxmlsec@1.2.37
Warning: No available formula or cask with the name "daniel/local/libxmlsec@1.2.37". Did you mean daniel/local/libxmlsec1@1.2.37?

@carlocab
Copy link
Member

carlocab commented Jun 30, 2023

Ah, your script has a typo:

brew install $USER/local/libxmlsec@1.2.37

should be

brew install $USER/local/libxmlsec1@1.2.37

That is, you dropped the 1 from libxmlsec1. If you fix that then your script should work just fine.

@dpritchett
Copy link
Author

That definitely helped, thank you! Unfortunately the install still ultimately fails with a "You must install Xcode.app" error as there's no bottle directive in the commit that originally landed 1.2.37 like there is in the one I linked above.

Looks like omitting bottles when cloning a Formula is intended behavior for brew extract, so I may have reached the end of the road in my hope for a one-liner.

@carlocab
Copy link
Member

Yes, you'll need to build from source to install older versions. For libxmlsec1, this requires installing Xcode.app.

You can try modifying your local formula to get rid of the Xcode requirement, but you might find your build failing as a result.

@github-actions github-actions bot added the outdated PR was locked due to age label Jul 31, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

2 participants