util: be consistent about transitive dependencies

A transitive dependency is a dependency of a dependency.
So if, for example, mesa3d_util does explicitly use
zerocopy-derive, it should not need to a depend on it.

The package that pulls in transitive should already
include it has a dependency.  This provides clearer
methodologies in maintaining Rust code, similiar to
how Cargo.toml handles it.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
This commit is contained in:
Gurchetan Singh 2025-10-01 17:42:28 -07:00
parent 5eece7596e
commit 01bb498e16
3 changed files with 4 additions and 23 deletions

View file

@ -25,14 +25,7 @@ dep_zerocopy = dependency('zerocopy',
required: true,
)
dep_zerocopy_derive = dependency('zerocopy-derive',
version: '>= 0.8.13',
fallback: ['zerocopy-derive-0.8-rs', 'dep_zerocopy_derive'],
required: true,
)
dep_mesa3d_util = [dep_cfg_if, dep_thiserror, dep_remain, dep_zerocopy,
dep_zerocopy_derive]
dep_mesa3d_util = [dep_cfg_if, dep_thiserror, dep_remain, dep_zerocopy]
supported_systems = ['linux', 'windows', 'darwin', 'macos']
supported_host_machine = host_machine.system() in supported_systems
@ -44,19 +37,7 @@ if supported_host_machine
required: true,
)
dep_bitflags = dependency('bitflags',
version: '>= 2.6.0',
fallback: ['bitflags-2-rs', 'dep_bitflags'],
required: true,
)
dep_errno = dependency('errno',
version: '>= 0.3.8',
fallback: ['errno-0.3-rs', 'dep_errno'],
required: true,
)
dep_mesa3d_util += [dep_rustix, dep_bitflags, dep_errno]
dep_mesa3d_util += [dep_rustix]
endif
libmesa_rust_util = static_library(

View file

@ -22,5 +22,5 @@ lib = static_library(
)
dep_thiserror = declare_dependency(
link_with : [lib]
link_with : [lib, thiserror_impl]
)

View file

@ -21,5 +21,5 @@ lib = static_library(
)
dep_zerocopy = declare_dependency(
link_with : [lib]
link_with : [lib, zerocopy_derive]
)