Bug 2276290 - Review Request: rust-jemalloc-sys - Rust FFI bindings to jemalloc
Summary: Review Request: rust-jemalloc-sys - Rust FFI bindings to jemalloc
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nobody's working on this, feel free to take it
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-04-21 14:30 UTC by wojnilowicz
Modified: 2024-05-08 18:57 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-05-08 18:57:44 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description wojnilowicz 2024-04-21 14:30:46 UTC
Spec URL: https://raw.githubusercontent.com/wojnilowicz/rust-jemalloc-sys/main/rust-jemalloc-sys.spec
SRPM URL: https://github.com/wojnilowicz/rust-jemalloc-sys/releases/download/0.5.4/rust-jemalloc-sys-0.5.4-1.fc39.src.rpm
Description:  Rust FFI bindings to jemalloc
Fedora Account System Username: wojnilowicz

I plan on packaging https://github.com/ActivityWatch/aw-server-rust and jemalloc is its requirement.

I've requested a sponsor at https://pagure.io/packager-sponsors/issue/640

Comment 1 Fabio Valentini 2024-04-21 17:34:05 UTC
Do you *really* need to use the jemalloc allocator?
We have previously managed to avoid packaging the Rust bindings for jemalloc ...

jemalloc only really supports x86_64 and aarch64, so the package you're working on would be either very limited, or would need to selectively disable jemalloc on other architectures.

Comment 2 wojnilowicz 2024-04-21 17:54:46 UTC
I try to package this aw-server-rust and it has this as a dependency for Linux and x86 as seen at
https://github.com/ActivityWatch/aw-server-rust/blob/c056e50646b45070c330de8a6dbd14042b3455e4/aw-server/Cargo.toml#L40

Couldn't we just remove the noarch line and limit valid architectures with ExclusiveArch similarly to
https://pkgs.rpmfusion.org/cgit/nonfree/nvidia-340xx-kmod.git/tree/nvidia-340xx-kmod.spec#n34
?

Comment 3 Fabio Valentini 2024-05-07 15:04:15 UTC
(In reply to wojnilowicz from comment #2)
> I try to package this aw-server-rust and it has this as a dependency for
> Linux and x86 as seen at
> https://github.com/ActivityWatch/aw-server-rust/blob/
> c056e50646b45070c330de8a6dbd14042b3455e4/aw-server/Cargo.toml#L40

Yes, but custom allocators are, by definition, optional.
We already have a handful of packages in Fedora that drop custom allocators because they are painful to deal with.

> Couldn't we just remove the noarch line and limit valid architectures with
> ExclusiveArch similarly to
> https://pkgs.rpmfusion.org/cgit/nonfree/nvidia-340xx-kmod.git/tree/nvidia-
> 340xx-kmod.spec#n34
> ?

No, that would be wrong.

The correct solution would be to use the "supported-arches" setting in rust2rpm.toml to specify that the crate should only be built and tested on certain architectures.

Comment 4 wojnilowicz 2024-05-07 16:54:07 UTC
(In reply to Fabio Valentini from comment #3)
> Yes, but custom allocators are, by definition, optional.
> We already have a handful of packages in Fedora that drop custom allocators
> because they are painful to deal with.

If I can workaround I would. I'll try to investigate further. In the meantime, could you link a package that deals (drops?) with custom allocators?

> > Couldn't we just remove the noarch line and limit valid architectures with
> > ExclusiveArch similarly to
> > https://pkgs.rpmfusion.org/cgit/nonfree/nvidia-340xx-kmod.git/tree/nvidia-
> > 340xx-kmod.spec#n34
> > ?
> 
> No, that would be wrong.
> 
> The correct solution would be to use the "supported-arches" setting in
> rust2rpm.toml to specify that the crate should only be built and tested on
> certain architectures.

Ok. I've updated the spec file to use supported-arches from rust2rpm.toml.

Comment 5 Fabio Valentini 2024-05-07 16:58:59 UTC
Removing a custom allocator is usually very simple - just remove the dependency and the ALLOC static.

Here's an example of what the latter looks like:
https://src.fedoraproject.org/rpms/rust-fd-find/blob/rawhide/f/0001-remove-references-to-jemalloc.patch

Comment 6 wojnilowicz 2024-05-08 18:57:44 UTC
Indeed, it was super easy. I don't need this package anymore. Thanks for helping me.


Note You need to log in before you can comment on or make changes to this bug.