Homebrew / homebrew-core

🍻 Default formulae for the missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
13.77k stars 12.45k forks source link

hackrf formula does not install required firmware binaries #112008

Closed rfc6919 closed 2 years ago

rfc6919 commented 2 years ago

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

brew config:

HOMEBREW_VERSION: 3.6.3-28-g7b00b2b
ORIGIN: https://github.com/Homebrew/brew
HEAD: 7b00b2b1d70e045a5ad2fd952ed9b4b0dc2abd49
Last commit: 24 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: a1b61b0fec33a77423af06e132d396ba28296be0
Core tap last commit: 3 hours ago
Core tap branch: hackrf-install-firmware
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 14.0.0 build 1400
Git: 2.37.0 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.79.1 => /usr/bin/curl
macOS: 12.6-arm64
CLT: 14.0.0.0.1.1661618636
Xcode: 14.0.1
Rosetta 2: false

brew doctor:

Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed formulae are deprecated or disabled.
You should find replacements for the following formulae:
  nlohmann_json

Warning: Some taps are not on the default git origin branch and may not receive
updates. If this is a surprise to you, check out the default branch with:
  git -C $(brew --repo homebrew/core) checkout master

Verification

What were you trying to do (and why)?

trying to upgrade hackrf firmware for new 2022.09.1 release as noted in release notes at https://github.com/greatscottgadgets/hackrf/releases/tag/v2022.09.1

What happened (include all command output)?

required device firmware (provided in upstream release bundle in the firmware-bin/ directory) wasn't included in the homebrew install, so I needed to download the upstream release myself

What did you expect to happen?

the required device firmware files would be installed by the formula

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

brew upgrade hackrf
find /opt/homebrew/Cellar/hackrf/2022.09.1 -name hackrf_one_usb.bin
(no results found)
rfc6919 commented 2 years ago

This is https://github.com/Homebrew/homebrew-core/issues/74398 again.

Upstream have said they won't automate install of the firmware binaries as that's distro-specific - see https://github.com/greatscottgadgets/hackrf/issues/868

I'm happy to provide a PR automating this, but it would require shifting the source url from the source only tarball https://github.com/greatscottgadgets/hackrf/archive/v2022.09.1.tar.gz to the one containing built artefacts https://github.com/greatscottgadgets/hackrf/releases/download/v2022.09.1/hackrf-2022.09.1.tar.xz and I don't see how to do that using the github livecheck.

carlocab commented 2 years ago

No, we only ship software we built from source. However, I think we can do what you suggested in the previous issue:

I'm just suggesting that the install method, as well as running make install in host, also copy firmware-bin from the root of the release archive into eg. .../share/hackrf/firmware-bin

rfc6919 commented 2 years ago

@carlocab

No, we only ship software we built from source.

Do you mean the device firmware? This would involve pulling an entire embedded cross-dev toolchain in to the package dependencies.

The source tarball that's currently referenced in the formula doesn't contain the pre-built device firmware, it's just a package of the git repo at a release tag. The https://github.com/greatscottgadgets/hackrf/releases/download/v2022.09.1/hackrf-2022.09.1.tar.xz release bundle contains pre-built device firmware (so end-users don't need an embedded cross-dev toolchain) but not pre-built host binaries - they still need to be built on the target host using exactly the same process as with the source-only bundle (the cd "host" do build/install block in the current formula's install function would remain unchanged).

rfc6919 commented 2 years ago

I believe the changes required are:

fxcoudert commented 2 years ago

@rfc6919 your suggestion seems alright to me. We'll still build the host tools from source, but download the full tarball including firmware.

github-actions[bot] commented 2 years ago

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

rfc6919 commented 2 years ago

PR https://github.com/Homebrew/homebrew-core/pull/113899 pending review