-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rust: Split glean-ffi up into 2 crates
glean-ffi carries all the no_mangle extern "C" definitions of our FFI layer. This is getting included in mozilla-central soon. However we can't have crates that are build as a `cdylib` as dependencies in mozilla-central, as this will then produce said `cdylib` during the build, which breaks at least on one build target. We don't need that `cdylib` published, we only need it for builds we ship ourselves: Kotlin, Swift & Python. Therefore we split this part into a `glean-bundle` crate which itself will generate a `cdylib` by the name `libglean_ffi`. Our builds only need to reference that other workspace member, but don't need to change what library they are loading. Now `glean-ffi` is a plain ol' Rust crate and we can use that in mozilla-central.
- Loading branch information
Showing
9 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[package] | ||
name = "glean-bundle" | ||
# No need to ever change this version | ||
version = "1.0.0" | ||
authors = ["The Glean Team <glean-team@mozilla.com>"] | ||
edition = "2018" | ||
description = "Static/Dynamic library build of glean-ffi, for use in mobile builds" | ||
repository = "https://github.com/mozilla/glean" | ||
license = "MPL-2.0" | ||
|
||
# This crate is never published to crates.io | ||
publish = false | ||
|
||
# We use the same name as glean-ffi. | ||
# The Kotlin/Swift/Python bindings will use this name. | ||
[lib] | ||
name = "glean_ffi" | ||
crate-type = ["staticlib", "cdylib"] | ||
|
||
[dependencies.glean-ffi] | ||
# No version specified, we build against what's available here. | ||
path = "../ffi" | ||
|
||
[features] | ||
# Enable the "safe-mode" Rust storage backend instead of the default LMDB one. | ||
rkv-safe-mode = ["glean-ffi/rkv-safe-mode"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
pub use glean_ffi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters