Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1525392 - update rkv (and LMDB) to their latest stable versions r…
Browse files Browse the repository at this point in the history
…=froydnj

Changes to rkv and LMDB crates:

rkv 0.7.0 -> 0.9.1
lmdb-rkv 0.9.0 -> 0.11.2
lmdb-sys 0.8.0 -> lmdb-rkv-sys 0.8.2

Update to the LMDB C library:

LMDB 0.9.21 -> 0.9.23 (+ backported patch for Mozilla build issue)

Other crate dependency update:

lazy_static 1.0.1 -> 1.2.0

This also removes the workaround for bug 1525219 and updates the kvstore in-tree crate (and nsIKeyValueService XPCOM API) for the rkv changes.

Differential Revision: https://phabricator.services.mozilla.com/D19094
  • Loading branch information
mykmelez committed Feb 11, 2019
1 parent e37b00a commit 002757e
Show file tree
Hide file tree
Showing 84 changed files with 2,008 additions and 1,295 deletions.
5 changes: 0 additions & 5 deletions .cargo/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ git = "https://github.com/glandium/cc-rs"
branch = "1.0.23-clang-cl-aarch64"
replace-with = "vendored-sources"

[source."https://github.com/mozilla/lmdb-rs"]
git = "https://github.com/mozilla/lmdb-rs"
branch = "lmdb-sys-0.8.0-android-fix"
replace-with = "vendored-sources"

[source.vendored-sources]
directory = '@top_srcdir@/third_party/rust'

Expand Down
63 changes: 32 additions & 31 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ codegen-units = 1

[patch.crates-io]
libudev-sys = { path = "dom/webauthn/libudev-sys" }
lmdb-sys = { git = "https://github.com/mozilla/lmdb-rs", branch = "lmdb-sys-0.8.0-android-fix" }
serde_derive = { git = "https://github.com/servo/serde", branch = "deserialize_from_enums9" }
winapi = { git = "https://github.com/froydnj/winapi-rs", branch = "aarch64" }
cc = { git = "https://github.com/glandium/cc-rs", branch = "1.0.23-clang-cl-aarch64" }
2 changes: 1 addition & 1 deletion third_party/rust/lazy_static/.cargo-checksum.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"files":{"Cargo.toml":"64e1cd36c70ec172cab7e96c5faa3c670f9313f677c90db977224f9b24a7d468","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0621878e61f0d0fda054bcbe02df75192c28bde1ecc8289cbd86aeba2dd72720","README.md":"7daae430cf5936e151386856293024e1466cddf62f27a9ff7ee3ef1511698514","appveyor.yml":"d17efb6bab4af26aa0048930de8bd3310b8d8a9961946a7962fe9fef31f96720","src/core_lazy.rs":"f20f2fc2bb751cf74622b05ec44675b6a29bfaa67d91a2e55485c665647d2904","src/lazy.rs":"a62cc96b7177a68b25e993592b08a6c706e9020fd565a55afa1fb657efa4052c","src/lib.rs":"75eee349be03ac278c1183cd861ffd0117b7ab7fffd4d46d0a1e21b9c48eab9b","src/nightly_lazy.rs":"7c00b832e907efeee16a01e1739fa536cd01b97a31d71f00d72dcabcf2e4e428","tests/no_std.rs":"2a5236bd3892a253855b4dc192f63138239165fa23b9c3421a9faa5482c780aa","tests/test.rs":"12b100f4790037ca049692d896114d6361373c5321c29e0032c290ee39f1042c"},"package":"e6412c5e2ad9584b0b8e979393122026cdd6d2a80b933f890dcd694ddbe73739"}
{"files":{"Cargo.toml":"9501e790a183ddbc845edba899bffa05f573c43fa5f79ef065ead842d056fa85","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"0621878e61f0d0fda054bcbe02df75192c28bde1ecc8289cbd86aeba2dd72720","README.md":"f2e94da8b77ac2a097dbc4b93b35912ef41b725624512d83ea968951dd5bdc7d","src/core_lazy.rs":"6b9fb6a4f553058e240756125b6b9ca43a83ed1fb72964343038ea0ea2e1af10","src/inline_lazy.rs":"2ae9a04c5bff40e80194f65b01012f0b42efa527bf717e176c68b4ca5212043c","src/lib.rs":"3defd7a82feced71862161a3c36fcff7cef3e08a51596b2e15d629b9a171a75a","tests/no_std.rs":"d68b149ee51ef5ae2b2906c0c94f5a9812d3b02811b13365c5a35e2ef90d25cf","tests/test.rs":"8e809c0f0332a3a60fca0113128cdab2cdbee92f03db523cdc4e82f4cd4b9f22"},"package":"a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1"}
9 changes: 6 additions & 3 deletions third_party/rust/lazy_static/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@

[package]
name = "lazy_static"
version = "1.0.1"
version = "1.2.0"
authors = ["Marvin Löbel <loebel.marvin@gmail.com>"]
exclude = ["/.travis.yml", "/appveyor.yml"]
description = "A macro for declaring lazily evaluated statics in Rust."
documentation = "https://docs.rs/lazy_static"
readme = "README.md"
Expand All @@ -22,12 +23,14 @@ categories = ["no-std", "rust-patterns", "memory-management"]
license = "MIT/Apache-2.0"
repository = "https://github.com/rust-lang-nursery/lazy-static.rs"
[dependencies.spin]
version = "0.4.6"
version = "0.4.10"
features = ["once"]
optional = true
default-features = false

[features]
nightly = []
spin_no_std = ["nightly", "spin"]
spin_no_std = ["spin"]
[badges.appveyor]
repository = "rust-lang-nursery/lazy-static.rs"

Expand Down
12 changes: 11 additions & 1 deletion third_party/rust/lazy_static/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ This includes anything requiring heap allocations, like vectors or hash maps,
as well as anything that requires non-const function calls to be computed.

[![Travis-CI Status](https://travis-ci.org/rust-lang-nursery/lazy-static.rs.svg?branch=master)](https://travis-ci.org/rust-lang-nursery/lazy-static.rs)
[![Latest version](https://img.shields.io/crates/v/lazy_static.svg)](https://crates.io/crates/lazy_static)
[![Documentation](https://docs.rs/lazy_static/badge.svg)](https://docs.rs/lazy_static)
[![License](https://img.shields.io/crates/l/lazy_static.svg)](https://github.com/rust-lang-nursery/lazy-static.rs#license)

## Minimum supported `rustc`

`1.24.1+`

This version is explicitly tested in CI and may only be bumped in new minor versions. Any changes to the supported minimum version will be called out in the release notes.


# Getting Started

Expand All @@ -21,7 +31,7 @@ Add the following dependency to your Cargo manifest...

```toml
[dependencies]
lazy_static = "1.0"
lazy_static = "1.2.0"
```

...and see the [docs](https://docs.rs/lazy_static) for how to use it.
Expand Down
61 changes: 0 additions & 61 deletions third_party/rust/lazy_static/appveyor.yml

This file was deleted.

7 changes: 2 additions & 5 deletions third_party/rust/lazy_static/src/core_lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ use self::spin::Once;
pub struct Lazy<T: Sync>(Once<T>);

impl<T: Sync> Lazy<T> {
#[inline(always)]
pub const fn new() -> Self {
Lazy(Once::new())
}
pub const INIT: Self = Lazy(Once::INIT);

#[inline(always)]
pub fn get<F>(&'static self, builder: F) -> &T
Expand All @@ -29,6 +26,6 @@ impl<T: Sync> Lazy<T> {
#[doc(hidden)]
macro_rules! __lazy_static_create {
($NAME:ident, $T:ty) => {
static $NAME: $crate::lazy::Lazy<$T> = $crate::lazy::Lazy::new();
static $NAME: $crate::lazy::Lazy<$T> = $crate::lazy::Lazy::INIT;
}
}
65 changes: 65 additions & 0 deletions third_party/rust/lazy_static/src/inline_lazy.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Copyright 2016 lazy-static.rs Developers
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.

extern crate core;
extern crate std;

use self::std::prelude::v1::*;
use self::std::cell::Cell;
use self::std::sync::Once;
pub use self::std::sync::ONCE_INIT;

// FIXME: Replace Option<T> with MaybeInitialized<T>
pub struct Lazy<T: Sync>(Cell<Option<T>>, Once);

impl<T: Sync> Lazy<T> {
pub const INIT: Self = Lazy(Cell::new(None), ONCE_INIT);

#[inline(always)]
pub fn get<F>(&'static self, f: F) -> &T
where
F: FnOnce() -> T,
{
self.1.call_once(|| {
self.0.set(Some(f()));
});

// `self.0` is guaranteed to be `Some` by this point
// The `Once` will catch and propegate panics
unsafe {
match *self.0.as_ptr() {
Some(ref x) => x,
None => {
debug_assert!(false, "attempted to derefence an uninitialized lazy static. This is a bug");

unreachable_unchecked()
},
}
}
}
}

unsafe impl<T: Sync> Sync for Lazy<T> {}

#[macro_export]
#[doc(hidden)]
macro_rules! __lazy_static_create {
($NAME:ident, $T:ty) => {
static $NAME: $crate::lazy::Lazy<$T> = $crate::lazy::Lazy::INIT;
};
}

/// Polyfill for std::hint::unreachable_unchecked. There currently exists a
/// [crate](https://docs.rs/unreachable) for an equivalent to std::hint::unreachable_unchecked, but
/// lazy_static currently doesn't include any runtime dependencies and we've chosen to include this
/// short polyfill rather than include a new crate in every consumer's build.
///
/// This should be replaced by std's version when lazy_static starts to require at least Rust 1.27.
unsafe fn unreachable_unchecked() -> ! {
enum Void {}
match std::mem::uninitialized::<Void>() {}
}
40 changes: 0 additions & 40 deletions third_party/rust/lazy_static/src/lazy.rs

This file was deleted.

38 changes: 14 additions & 24 deletions third_party/rust/lazy_static/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,30 +100,23 @@ no guarantees can be made about them in regard to SemVer stability.
*/

#![cfg_attr(feature="spin_no_std", feature(const_fn))]
#![cfg_attr(feature="nightly", feature(unreachable))]

#![doc(html_root_url = "https://docs.rs/lazy_static/1.0.1")]
#![doc(html_root_url = "https://docs.rs/lazy_static/1.2.0")]
#![no_std]

#[cfg(not(feature="nightly"))]
#[cfg(not(feature = "spin_no_std"))]
#[path="inline_lazy.rs"]
#[doc(hidden)]
pub mod lazy;

#[cfg(all(feature="nightly", not(feature="spin_no_std")))]
#[path="nightly_lazy.rs"]
#[doc(hidden)]
pub mod lazy;

#[cfg(all(feature="nightly", feature="spin_no_std"))]
#[cfg(feature = "spin_no_std")]
#[path="core_lazy.rs"]
#[doc(hidden)]
pub mod lazy;

#[doc(hidden)]
pub use core::ops::Deref as __Deref;

#[macro_export]
#[macro_export(local_inner_macros)]
#[doc(hidden)]
macro_rules! __lazy_static_internal {
// optional visibility restrictions are wrapped in `()` to allow for
Expand All @@ -136,19 +129,16 @@ macro_rules! __lazy_static_internal {
(@TAIL, $N:ident : $T:ty = $e:expr) => {
impl $crate::__Deref for $N {
type Target = $T;
#[allow(unsafe_code)]
fn deref(&self) -> &$T {
unsafe {
#[inline(always)]
fn __static_ref_initialize() -> $T { $e }

#[inline(always)]
unsafe fn __stability() -> &'static $T {
__lazy_static_create!(LAZY, $T);
LAZY.get(__static_ref_initialize)
}
__stability()
#[inline(always)]
fn __static_ref_initialize() -> $T { $e }

#[inline(always)]
fn __stability() -> &'static $T {
__lazy_static_create!(LAZY, $T);
LAZY.get(__static_ref_initialize)
}
__stability()
}
}
impl $crate::LazyStatic for $N {
Expand All @@ -170,7 +160,7 @@ macro_rules! __lazy_static_internal {
() => ()
}

#[macro_export]
#[macro_export(local_inner_macros)]
macro_rules! lazy_static {
($(#[$attr:meta])* static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => {
// use `()` to explicitly forward the information about private items
Expand Down
45 changes: 0 additions & 45 deletions third_party/rust/lazy_static/src/nightly_lazy.rs

This file was deleted.

1 change: 0 additions & 1 deletion third_party/rust/lazy_static/tests/no_std.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![cfg(feature="spin_no_std")]
#![feature(const_fn)]

#![no_std]

Expand Down
2 changes: 0 additions & 2 deletions third_party/rust/lazy_static/tests/test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg_attr(feature="nightly", feature(const_fn))]

#[macro_use]
extern crate lazy_static;
use std::collections::HashMap;
Expand Down
Loading

0 comments on commit 002757e

Please sign in to comment.