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

Provide reference to file responsible for triggering Arch dependent binaries in noarch package error #3600

Open
dmnks opened this issue Feb 26, 2025 · 0 comments

Comments

@dmnks
Copy link
Contributor

dmnks commented Feb 26, 2025

Discussed in #3587

Originally posted by voxik February 19, 2025
Observing error such as:

... snip ...

Processing files: rubygem-selenium-webdriver-4.27.0-3.fc43.noarch
Provides: rubygem(selenium-webdriver) = 4.27.0 rubygem-selenium-webdriver = 4.27.0-3.fc43
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: (rubygem(base64) >= 0.2 with rubygem(base64) < 1) (rubygem(logger) >= 1.4 with rubygem(logger) < 2) (rubygem(rexml) >= 3.2 with rubygem(rexml) < 4 with rubygem(rexml) >= 3.2.5) (rubygem(rubyzip) >= 1.2.2 with rubygem(rubyzip) < 3.0) (rubygem(websocket) >= 1.0 with rubygem(websocket) < 2) ruby(rubygems) > 1.3.1
Recommends: chromedriver chromium chromium-headless
error: Arch dependent binaries in noarch package
    Arch dependent binaries in noarch package

It does not provide enough detail what binary actually caused this. It would be nice to provide reference to it making it easier to debug the issue.

The following .spec file can trigger such error:

%global gem_name selenium-webdriver

%bcond_without spec_integration

Name: rubygem-%{gem_name}
Version: 4.27.0
Release: 3%{?dist}
Summary: Selenium is a browser automation tool for automated testing of webapps and more
License: Apache-2.0
URL: https://selenium.dev
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# git clone https://github.com/SeleniumHQ/selenium
# git -C selenium archive -v -o selenium-webdriver-4.27.0-spec.tar.gz selenium-4.27.0 rb/spec
Source1: %{gem_name}-%{version}-spec.tar.gz
# Needed for integration `spec/integration`
# git -C selenium archive -v -o selenium-webdriver-4.27.0-web.tar.gz selenium-4.27.0 common/src/web
Source2: %{gem_name}-%{version}-web.tar.gz
# `selenium-manager` stub replacing the bundled binary blobs.
Source3: selenium-manager
# Ruby 3.4 `Hash#inspect` compatibility.
# https://github.com/SeleniumHQ/selenium/issues/14934
Patch0: rubygem-selenium-webdriver-4.27.0-Hash-inspect-formatting-for-Ruby-3.4-compatibili.patch

# There is no other driver in Fedora, therefore suggest what we have. This also
# reflescts the `selenium-manager` stub above.
Recommends: chromedriver
Recommends: chromium chromium-headless

Requires: selenium-manager
BuildRequires: selenium-manager
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby
BuildRequires: rubygem(curb)
BuildRequires: rubygem(rspec)
BuildRequires: rubygem(rubyzip)
BuildRequires: rubygem(webmock)
BuildRequires: rubygem(websocket)
%if %{with spec_integration}
BuildRequires: rubygem(rack)
BuildRequires: rubygem(webrick)
BuildRequires: chromedriver
BuildRequires: chromium chromium-headless
# Chromium is not available for i686 / s390x
# https://src.fedoraproject.org/rpms/chromium/blob/fcd074b9c31411f795ab402fe88e4513a68c843e/f/chromium.spec#_803
# and on ppc64le
# https://src.fedoraproject.org/rpms/chromium/blob/fcd074b9c31411f795ab402fe88e4513a68c843e/f/chromium.spec#_43-45
ExclusiveArch: x86_64 aarch64
%endif
BuildArch: noarch

%description
Selenium implements the W3C WebDriver protocol to automate popular browsers.
It aims to mimic the behaviour of a real user as it interacts with the
application's HTML. It's primarily intended for web application testing,
but any web-based task can automated.

%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description doc
Documentation for %{name}.

%prep
%setup -q -n %{gem_name}-%{version} -b1 -b2

(
cd %{builddir}
%patch 0 -p1
)

# Drop the original selenium-manager binaries as long as we cannot recreate
# them from source. Their purpose is described here:
# https://www.selenium.dev/documentation/selenium_manager/
# and they are included from this repo:
# https://github.com/SeleniumHQ/selenium_manager_artifacts
# TODO: Try to build them from source:
# https://github.com/SeleniumHQ/selenium/tree/trunk/rust
# https://www.selenium.dev/documentation/selenium_manager/#building-a-custom-selenium-manager
# BTW: python-selenium package is struggling with the same issue:
# https://bugzilla.redhat.com/show_bug.cgi?id=2278096#c13
%gemspec_remove_file Dir.glob('bin/{windows,macos}/selenium-manager{,.exe}')
%build
gem build ../%{gem_name}-%{version}.gemspec
%gem_install

%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
        %{buildroot}%{gem_dir}/
#Remove temporary selenium wrapper
#and create a link to selenium-manager binary
rm .%{gem_instdir}/bin/linux/selenium-manager
ln -s %{_bindir}/selenium-manager .%{gem_instdir}/bin/linux/

%check
pushd .%{gem_instdir}
ln -s %{_builddir}/rb/spec .

# `DevTools` are part of separate `selenium-devtools` gem.
mv spec/unit/selenium/devtools_spec.rb{,.disable}
mv spec/unit/selenium/devtools/cdp_client_generator_spec.rb{,.disable}
mv spec/integration/selenium/webdriver/devtools_spec.rb{,.disable}

# Require Firefox extensions included in thirdparty directory, available on GH
# not included in gem
sed -i spec/unit/selenium/webdriver/firefox/profile_spec.rb \
    -e '/can install extension/a\          skip' \
    -e '/can install web extension/a\          skip'

# There seems to be wrong stub and when `bin/linux/selenium-manager` exists,
# the test fails.
# https://github.com/SeleniumHQ/selenium/issues/14925
sed -i "/it 'errors if cannot find' do/a\          skip" \
  spec/unit/selenium/webdriver/common/selenium_manager_spec.rb

rspec spec/unit

%if %{with spec_integration}
# Ignore `spec/integration/selenium/server_spec.rb`, which downloads some
# content from internet.
mv spec/integration/selenium/server_spec.rb{,.disable}

# These test are passing when they are expected to fail. Maybe chromium
# supports these actions now?
sed -i -r \
  -e "/it 'can make window full screen'/ s/(^\s*)it/\1skip/" \
  -e "/it 'can minimize the window'/ s/(^\s*)it/\1skip/" \
  spec/integration/selenium/webdriver/window_spec.rb

HEADLESS=true SE_CHROMEDRIVER=chromedriver rspec spec/integration
%endif
popd

%files
%dir %{gem_instdir}
%license %{gem_instdir}/LICENSE
%{gem_instdir}/bin
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/CHANGES
%doc %{gem_instdir}/NOTICE
%{gem_instdir}/Gemfile
%doc %{gem_instdir}/README.md
%{gem_instdir}/selenium-webdriver.gemspec

%changelog
* Sun Jan 19 2025 Fedora Release Engineering <releng@fedoraproject.org> - 4.27.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
@dmnks dmnks added this to RPM Feb 26, 2025
@github-project-automation github-project-automation bot moved this to Backlog in RPM Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant