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

Drop noarch and set debug_package to nil rubygem-sassc #10395

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

pcreech
Copy link
Member

@pcreech pcreech commented Feb 2, 2024

In other build environments, setting 'BuildArch: noarch' causes a build issue where rubygem-ffi can't locate libsass.so.1 in the libraary path, resulting in the following errors:

/usr/share/gems/gems/ffi-1.16.3/lib/ffi/dynamic_library.rb:65:in `load_library': Could not open library '/ext/libsass.so.1': /ext/libsass.so.1: cannot open shared object file: No such file or directory. (LoadError)
Searched in <system library path>, /usr/lib, /usr/local/lib, /opt/local/lib
/usr/share/gems/gems/ffi-1.16.3/lib/ffi/dynamic_library.rb:65:in `load_library': Could not open library '/usr/lib/libsass.so.1': /usr/lib/libsass.so.1: cannot open shared object file: No such file or directory. (LoadError)
Searched in <system library path>, /usr/lib, /usr/local/lib, /opt/local/lib

Once past this issue, the build fails out on debugsources.list being empty. setting debug_packge to nil bypasses this issue.

In other build environments, setting 'BuildArch: noarch' causes a build
issue where rubygem-ffi can't locate libsass.so.1 in the libraary path,
resulting in the following errors:

```
/usr/share/gems/gems/ffi-1.16.3/lib/ffi/dynamic_library.rb:65:in `load_library': Could not open library '/ext/libsass.so.1': /ext/libsass.so.1: cannot open shared object file: No such file or directory. (LoadError)
Searched in <system library path>, /usr/lib, /usr/local/lib, /opt/local/lib
```

```
/usr/share/gems/gems/ffi-1.16.3/lib/ffi/dynamic_library.rb:65:in `load_library': Could not open library '/usr/lib/libsass.so.1': /usr/lib/libsass.so.1: cannot open shared object file: No such file or directory. (LoadError)
Searched in <system library path>, /usr/lib, /usr/local/lib, /opt/local/lib
```

Once past this issue, the build fails out on `debugsources.list` being
empty.  setting debug_packge to nil bypasses this issue.
@pcreech
Copy link
Member Author

pcreech commented Feb 2, 2024

@evgeni @ekohl this should address the issues we're seeing in other build systems trying to bring this package's updates to use llibsass.so.1

very interested in your thoughts

@evgeni
Copy link
Member

evgeni commented Feb 3, 2024

So I had a look at the two involved build systems, and found the difference. When building a noarch package on copr, I see:

+ sed -i 's!__dir__!"/usr/lib64"!' lib/sassc/native.rb

while on Patrick's system, I see:

+ sed -i 's!__dir__!"/usr/lib"!' lib/sassc/native.rb

that means the two systems resolve the %_libdir macro differently when building a noarch package

sed -i "s!__dir__!\"%{_libdir}\"!" lib/sassc/native.rb

Now, honestly, I think the use of _libdir here is wrong, as we need the libdir of the "target" system, not the "build" system, and those can differ (when building noarch).

I see two possibilities:

  • hardcode /usr/lib64
  • make the package arch-specific again

both are hacks, I don't like both too much, but I think that making the pkg arch-specific is "more" correct, as otherwise we could end up with a s390x system building that package (which is totally allowed) and failing as there we do not ship a libsass.so at all.

@pcreech
Copy link
Member Author

pcreech commented Feb 6, 2024

I'd throw my hat in the ring for the second option (that's already enacted on this pr). I'd rather not hardcode a libdir, and that task in and of itself implies that the package really isn't 'noarch', so no need to actually set noarch directly.

Based on that, sounds like this pr is generally g2g if we decide on option 2?

@evgeni evgeni requested a review from ekohl February 16, 2024 09:41
@evgeni
Copy link
Member

evgeni commented Feb 16, 2024

I'm fine with this PR, but would love to have a second pair of eyes (@ekohl) on this, as it tends to be a pain in the ass (noarch).

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the less ugly hack because it'll work correctly once we start building on other arches. And since the lib path is arch-specific, arguably this package is also arch-specific.

@ekohl ekohl merged commit a0b4f1d into theforeman:rpm/develop Jun 7, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants