Reorganize dependencies #373

Merged
lx merged 28 commits from improve-deps into main 2022-09-08 13:45:09 +00:00
Owner

This PR includes work from @jirutka :

  • Allow linking against system-provided libraries (libsodium, libsqlite, libzstd) #370
  • Make OTLP exporter optional and allow building without Prometheus exporter (/metrics) #372

And also:

  • Update .nix files
  • Remove heed default-features
  • Bump versions of all Garage crates to 0.8.0
  • Make db engines (lmdb, sled, sqlite) optionnal
  • Add documentation for available features
  • Directly include code of previous versions used for migration in order to reduce dependencies
  • Read variable GIT_VERSION from garage main instead of in crate garage_util to make builds faster
  • Report features used in the build somewhere? (in garage --version or something)
  • Check we warn! correctly if we try to use deactivated feature
  • Allow not to launch S3 endpoint if not in config
This PR includes work from @jirutka : - [x] Allow linking against system-provided libraries (libsodium, libsqlite, libzstd) #370 - [x] Make OTLP exporter optional and allow building without Prometheus exporter (/metrics) #372 And also: - [x] Update `.nix` files - [x] Remove heed default-features - [x] Bump versions of all Garage crates to 0.8.0 - [x] Make db engines (lmdb, sled, sqlite) optionnal - [x] Add documentation for available features - [x] Directly include code of previous versions used for migration in order to reduce dependencies - [x] Read variable `GIT_VERSION` from garage main instead of in crate garage_util to make builds faster - [x] Report features used in the build somewhere? (in `garage --version` or something) - [x] Check we `warn!` correctly if we try to use deactivated feature - [x] Allow not to launch S3 endpoint if not in config
lx added 2 commits 2022-09-05 10:21:20 +00:00
If this feature is enabled, libsodium-sys and zstd-sys will link
dynamically against system-provided libraries instead of building
and linking statically the bundled (possibly outdated and vulnerable)
copies of them. This feature is intended mainly for linux package
maintainers.
Allow linking against system-provided libsqlite
Some checks are pending
continuous-integration/drone/push Build is pending
continuous-integration/drone/pr Build is pending
7511ba5530
Unfortunately, rusqlite uses the opposite logic for enabling/disabling
bundled libraries to others (libsodium-sys, zstd-sys). Cargo features
are very limited and doesn't allow to enable feature A in a dependency
iff feature B is disabled.

Note, lmdb-rkv-sys doesn't need any special treatment because it
automatically links against system liblmdb if found via pkgconf.

Linux distros should build garage with
`--no-default-features --features system-libs` to disable bundled-libs
and enable system-libs.
lx added 1 commit 2022-09-05 14:40:29 +00:00
Remove Heed default features
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
729a910e14
lx added 4 commits 2022-09-06 13:11:34 +00:00
Garage currently uses the legacy resolver "1". The new one is used
by default if the root package specifies 'edition = 2021', which
Garage does not (yet).

The problem with the legacy resolver is, among others, that features
enabled by dev-dependencies are propagated to normal dependencies.
This affects e.g. hyper - one of the dev-dependencies enables "http2"
feature that adds many extra dependencies. If we build garage without
opentelemetry-otlp (this is enabled in the following commit), there's
no normal dependency enabling "http2" feature.

See https://doc.rust-lang.org/cargo/reference/resolver.html#feature-resolver-version-2
opentelemetry-otlp add 48 (!) extra dependencies and increases the
size of the garage binary by ~11 % (with fat LTO).
Allow building without Prometheus exporter (/metrics endpoint)
Some checks failed
continuous-integration/drone/pr Build is failing
ea36b9ff90
prometheus and opentelemetry-prometheus add 7 extra dependencies in
total and increases the size of the garage binary by ~7 % (with
fat LTO).
Reviewed-on: #372
Reviewed-by: Alex <alex@adnab.me>
lx added 1 commit 2022-09-06 13:48:35 +00:00
lx force-pushed improve-deps from 32612455f5 to 8d77a76df1 2022-09-06 13:49:47 +00:00 Compare
lx added 1 commit 2022-09-06 14:42:18 +00:00
Force disable pkg-config for libsodum-sys and libzstd-sys
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
7de53a4d66
lx added 1 commit 2022-09-06 14:48:12 +00:00
Bump versions to 0.8.0 (compatibility is broken already)
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
48ffaaadfc
lx added 2 commits 2022-09-06 15:16:56 +00:00
Document available build features
Some checks are pending
continuous-integration/drone/push Build is pending
continuous-integration/drone/pr Build is pending
bbb970965c
lx added 1 commit 2022-09-06 15:20:21 +00:00
Update Nix files with optional db engines
Some checks are pending
continuous-integration/drone/push Build is pending
continuous-integration/drone/pr Build is pending
2c2b93acdf
lx added 1 commit 2022-09-06 15:25:55 +00:00
Remove opentelemetry-otlp dep in api/
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
431dee050f
lx added 1 commit 2022-09-06 15:29:59 +00:00
Disable k2v tests when feature is disabled
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
1e92e9f782
lx added 1 commit 2022-09-06 15:54:14 +00:00
Include code from v0.5.1 directly to remove dependencies
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
0f5689c169
lx added 1 commit 2022-09-06 15:59:47 +00:00
cargo fmt
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
6f02c36a89
lx added 1 commit 2022-09-07 10:00:16 +00:00
Move GIT_VERSION injection later in build chain to reduce build times
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is passing
db61f41030
lx added 1 commit 2022-09-07 15:05:35 +00:00
Report build features in garage --help
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is passing
28d86e7602
lx added 1 commit 2022-09-07 15:54:31 +00:00
Make all HTTP services optionnal
Some checks are pending
continuous-integration/drone/push Build is pending
continuous-integration/drone/pr Build is pending
2559f63e9b
lx added 1 commit 2022-09-07 15:57:29 +00:00
Error messages when system-libs XOR bundled-libs != 1
Some checks are pending
continuous-integration/drone/push Build is pending
continuous-integration/drone/pr Build is pending
2e00809af5
lx added 1 commit 2022-09-07 16:02:24 +00:00
Add warnings when features are not included in build
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
1449204439
lx added 1 commit 2022-09-07 16:10:28 +00:00
Fix build error
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is passing
107853334b
lx added 2 commits 2022-09-07 16:16:07 +00:00
Fix merge
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
06df301de5
lx added 1 commit 2022-09-07 16:30:28 +00:00
Inject GIT_VERSION even later
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
f310fce34b
lx added 1 commit 2022-09-07 16:37:02 +00:00
Move version back into util
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
ceb1f0229a
lx changed title from WIP: Reorganize dependencies to Reorganize dependencies 2022-09-07 16:45:36 +00:00
lx merged commit 03c40a0b24 into main 2022-09-08 13:45:09 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/garage#373
No description provided.