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

pkg-config for libarchive #120526

Closed
3 tasks done
graymalkin opened this issue Jan 13, 2023 · 5 comments
Closed
3 tasks done

pkg-config for libarchive #120526

graymalkin opened this issue Jan 13, 2023 · 5 comments
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age stale No recent activity upstream issue An upstream issue report is needed

Comments

@graymalkin
Copy link

graymalkin commented Jan 13, 2023

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

brew config


HOMEBREW_VERSION: 3.6.18
ORIGIN: https://github.com/Homebrew/brew
HEAD: 106af035578d5f8716ae9510c1f9ad8c19f73a79
Last commit: 6 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: ab0f7adb1367bd263063c15cf2b14d290a1658e5
Core tap last commit: 2 hours ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 20
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: 20-core 64-bit arm_firestorm_icestorm
Clang: 14.0.0 build 1400
Git: 2.39.0 => /opt/homebrew/bin/git
Curl: 7.85.0 => /usr/bin/curl
macOS: 13.1-arm64
CLT: 14.2.0.0.1.1668646533
Xcode: N/A
Rosetta 2: false


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.

What were you trying to do (and why)?

Running some build automation checks whether libarchive is installed using pkg-config --exists libarchive, and fails because pkg-config returns 1 even when I have updated the PKG_CONFIG_PATH environment variable to point to the libarchive.pc file as described in brew info libarchive.

What happened (include all command output)?

pkg-config appears to be able to see the package when queried with --modversion, but it returns 1 (false) when asked if the package exists using the --exists option.

What did you expect to happen?

I expect pkg-config to return 0 when the package is installed and the .pc file is on the PKG_CONFIG_PATH.

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

brew install libarchive
echo ' export PKG_CONFIG_PATH="/opt/homebrew/opt/libarchive/lib/pkgconfig"' >> ~/.zshrc
source ~/.zshrc


pkg-config --modversion libarchive
# 3.6.2

pkg-config --exists libarchive; echo $?
# 1

I've tried this on two separate Macs, both running Ventura 13.1 (22C65).

@graymalkin graymalkin added the bug Reproducible Homebrew/homebrew-core bug label Jan 13, 2023
@gromgit
Copy link
Member

gromgit commented Jan 13, 2023

What does pkg-config --exists --print-errors libarchive output? I'm betting it's the following:

Package iconv was not found in the pkg-config search path.
Perhaps you should add the directory containing `iconv.pc'
to the PKG_CONFIG_PATH environment variable
Package 'iconv', required by 'libarchive', not found

@graymalkin
Copy link
Author

Ah, yes exactly that.

@graymalkin
Copy link
Author

I think that makes this related to #117869. The work-around is good for me for now. Can I keep this issue open to track the bug?

The workaround from that issue (for those who need it and find this thread googling) is to remove Requires.private: iconv from /opt/homebrew/opt/libarchive/lib/pkgconfig/libarchive.pc. You might need to do chmod +w first.

@KenjiTakahashi
Copy link

It seems that this breaks building mpv from source (maybe also other formulas?).

@cho-m cho-m added the upstream issue An upstream issue report is needed label Jan 14, 2023
graymalkin added a commit to graymalkin/cheribuild that referenced this issue Jan 17, 2023
pkg-config --exists also checks dependencies are present on macOS, and
due to some packaging issues with upstream libarchive this is breaking
the build for cheribsd and freebsd.

Closes CTSRD-CHERI#340.

See Homebrew/homebrew-core#120526 for
tracking of this issue as it relates to macOS.
arichardson pushed a commit to CTSRD-CHERI/cheribuild that referenced this issue Jan 17, 2023
)

pkg-config --exists also checks dependencies are present on macOS, and
due to some packaging issues with upstream libarchive this is breaking
the build for cheribsd and freebsd.

Closes #340.

See Homebrew/homebrew-core#120526 for
tracking of this issue as it relates to macOS.
sharkwouter added a commit to pspdev/pspdev that referenced this issue Feb 1, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale No recent activity label Feb 5, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 12, 2023
@github-actions github-actions bot added the outdated PR was locked due to age label Mar 15, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 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 stale No recent activity upstream issue An upstream issue report is needed
Projects
None yet
Development

No branches or pull requests

4 participants