forgejo_backup/modules/packages
Gusted 62ec469394 feat: replace go-rpmutils library with our own (#7953)
- While doing cross-compiling of Forgejo (with CGO enabled) it was noticed that besides compiling sqlite3, github.com/DataDog/zstd (a CGO wrapper around the reference zstd library) took a long time to compile. Upon investigating why this library was included in the first place I concluded that this library is not even used and compiling this package is a waste of time and CPU cycles.
- https://github.com/sassoftware/go-rpmutils is the library that uses the CGO zstd library, and would use it the pure Go variant (https://github.com/klauspost/compress/zstd) if CGO is enabled (which is the default). It uses zstd to uncompress the payload of a RPM packages. This is a operation that Forgejo does not use in the slightest, hence being unused code.
- It is not possible to force compiling the pure Go variant if CGO is enabled. Therefore forking and removing this code is the only option to avoid compiling the zstd C library. The changes made to the fork can be seen here: 2660c86d57...v1.0.0
- Via [actiongraph](https://github.com/icio/actiongraph) you can precisely see where the Go compiler is spending time, on a beefy machine the compilation takes of the zstd C library takes ~40s. For reference compiling the sqlite3 C library takes ~50s.
- The forgejo binary (build via `make backend`) reduced its size by 835776 bytes (0.8 MiB).

TL;DR forked library to remove unused code to avoid Go spending a considerable amount of time compiling the reference zstd library that in the end is never used.

<!--start release-notes-assistant-->

## Release notes
<!--URL:https://codeberg.org/forgejo/forgejo-->
- Features
  - [PR](https://codeberg.org/forgejo/forgejo/pulls/7953): <!--number 7953 --><!--line 0 --><!--description cmVwbGFjZSBnby1ycG11dGlscyBsaWJyYXJ5IHdpdGggb3VyIG93bg==-->replace go-rpmutils library with our own<!--description-->
<!--end release-notes-assistant-->

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7953
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>
2025-05-25 12:30:04 +02:00
..
alpine chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
arch chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
cargo Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
chef chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
composer chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
conan chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
conda chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
container chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
cran chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
debian chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
goproxy chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
helm chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
maven chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
npm chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
nuget chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
pub chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
pypi Implement FSFE REUSE for golang files (#21840) 2022-11-27 18:20:29 +00:00
rpm feat: replace go-rpmutils library with our own (#7953) 2025-05-25 12:30:04 +02:00
rubygems chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
swift chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
vagrant chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
content_store.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
hashed_buffer.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
hashed_buffer_test.go Alt Linux Apt-Rpm repository support for Forgejo packages. (#6351) 2025-01-22 14:01:49 +00:00
multi_hasher.go Alt Linux Apt-Rpm repository support for Forgejo packages. (#6351) 2025-01-22 14:01:49 +00:00
multi_hasher_test.go Alt Linux Apt-Rpm repository support for Forgejo packages. (#6351) 2025-01-22 14:01:49 +00:00