Skip to content

Commit 8a96471

Browse files
reubenoCopilot
authored andcommitted
refactor(rubygem-activestorage): drop ffmpeg/ffprobe BRs, Suggests, and tests
Drop the ffmpeg / ffprobe BuildRequires and Suggests from rubygem-activestorage as part of removing ffmpeg/libav* from Azure Linux. The Rails ActiveStorage gem uses ffmpeg/ffprobe only for optional video previews and audio/video metadata analysis; the gem itself builds and loads cleanly without them. Also remove the upstream audio_analyzer, video_analyzer, and video_previewer test files in %check — they shell out to ffmpeg/ffprobe and fail with ENOENT when those binaries are absent. The remaining test suite (482 runs in mock) still passes. Applications that need video previews will need to install ffmpeg explicitly; this was already the case for any deployment that picked ffmpeg up only via the soft Suggests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8cd6aea commit 8a96471

4 files changed

Lines changed: 39 additions & 7 deletions

File tree

base/comps/components.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4610,7 +4610,6 @@ includes = ["**/*.comp.toml", "component-check-disablement.toml", "component-min
46104610
[components.rubygem-activejob]
46114611
[components.rubygem-activemodel]
46124612
[components.rubygem-activerecord]
4613-
[components.rubygem-activestorage]
46144613
[components.rubygem-activesupport]
46154614
[components.rubygem-addressable]
46164615
[components.rubygem-afm]
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Drop the ffmpeg / ffprobe BuildRequires and Suggests. Azure Linux is
2+
# removing ffmpeg/libav* from the distro; the rails ActiveStorage gem
3+
# uses these binaries only for optional video previews/analysis. The
4+
# gem builds, installs, and runs without them — applications that need
5+
# video previews would have had to install ffmpeg explicitly anyway.
6+
[components.rubygem-activestorage]
7+
8+
[[components.rubygem-activestorage.overlays]]
9+
description = "Drop BuildRequires on %{_bindir}/ffmpeg — removing ffmpeg from the distro"
10+
type = "spec-remove-tag"
11+
tag = "BuildRequires"
12+
value = "%{_bindir}/ffmpeg"
13+
14+
[[components.rubygem-activestorage.overlays]]
15+
description = "Drop BuildRequires on %{_bindir}/ffprobe — removing ffmpeg from the distro"
16+
type = "spec-remove-tag"
17+
tag = "BuildRequires"
18+
value = "%{_bindir}/ffprobe"
19+
20+
[[components.rubygem-activestorage.overlays]]
21+
description = "Drop Suggests on %{_bindir}/ffmpeg — removing ffmpeg from the distro"
22+
type = "spec-remove-tag"
23+
tag = "Suggests"
24+
value = "%{_bindir}/ffmpeg"
25+
26+
[[components.rubygem-activestorage.overlays]]
27+
description = "Drop Suggests on %{_bindir}/ffprobe — removing ffmpeg from the distro"
28+
type = "spec-remove-tag"
29+
tag = "Suggests"
30+
value = "%{_bindir}/ffprobe"
31+
32+
[[components.rubygem-activestorage.overlays]]
33+
description = "Skip audio/video analyzer/previewer tests — they shell out to ffmpeg/ffprobe, which are no longer available"
34+
type = "spec-search-replace"
35+
regex = '^bundle exec ruby '
36+
replacement = "rm -f test/analyzer/audio_analyzer_test.rb test/analyzer/video_analyzer_test.rb test/previewer/video_previewer_test.rb\nbundle exec ruby "

locks/rubygem-activestorage.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
version = 1
33
import-commit = '9cf47cd92bee4a9a205a0bfe3cbefe3205153e6c'
44
upstream-commit = '9cf47cd92bee4a9a205a0bfe3cbefe3205153e6c'
5-
input-fingerprint = 'sha256:148c634d368c41889b8d89b8ab6ff45500b740d73a3ef6838e6685047ef555fa'
5+
input-fingerprint = 'sha256:98bcc65f3cc28fb554b97d7aa3ec9274351369a5e4bf722ac2e6c418e1eedcd7'
66
resolution-input-hash = 'sha256:466421704711c4fd3c71f0b2ed715a0e61d49e3e26f3a2637fee755795849c8e'

specs/r/rubygem-activestorage/rubygem-activestorage.spec

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
Name: rubygem-%{gem_name}
1818
Version: 8.0.2
19-
Release: 3%{?dist}
19+
Release: 4%{?dist}
2020
Summary: Local and cloud file storage framework
2121
License: MIT
2222
URL: https://rubyonrails.org
@@ -44,17 +44,13 @@ BuildRequires: rubygem(sqlite3)
4444
# Required to pass some of the test/models/variant_test.rb
4545
# https://github.com/rails/rails/issues/44395
4646
BuildRequires: vips-magick
47-
BuildRequires: %{_bindir}/ffmpeg
48-
BuildRequires: %{_bindir}/ffprobe
4947
BuildRequires: %{_bindir}/mutool
5048
BuildRequires: %{_bindir}/pdftoppm
5149
%{?with_openh264:BuildRequires: openh264}
5250
%{?with_js_recompilation:BuildRequires: %{_bindir}/npm}
5351
# Used for creating file previews
5452
Suggests: %{_bindir}/mutool
5553
Suggests: %{_bindir}/pdftoppm
56-
Suggests: %{_bindir}/ffmpeg
57-
Suggests: %{_bindir}/ffprobe
5854
# Codec for video analysis
5955
Suggests: openh264
6056

@@ -160,6 +156,7 @@ sed -i \
160156
export RUBYOPT="-I${PWD}/lib"
161157
export BUNDLE_GEMFILE=${PWD}/Gemfile
162158

159+
rm -f test/analyzer/audio_analyzer_test.rb test/analyzer/video_analyzer_test.rb test/previewer/video_previewer_test.rb
163160
bundle exec ruby -Itest -ractive_storage/engine -e 'Dir.glob "./test/**/*_test.rb", &method(:require)'
164161
)
165162

0 commit comments

Comments
 (0)