mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 08:18:15 +03:00
30d4c8fc2d
Summary: Using modulo on arbitrary integers to get random numbers [isn't correct](https://www.internalfb.com/diff/D31305392 (da13975a4f
)?dst_version_fbid=311037904117090&transaction_fbid=550270779610744), as the distribution between numbers isn't fair (unless the size is a power of two). This was raised on D31305392 (da13975a4f
), but we decided to land that quickly to unblock builds before doing these changes. I'm applying the changes suggested on D31305392 (da13975a4f
). This is what this diff does: - For all cases where we generate small numbers (up to 5), replace with call to `Gen::choose`, so `u32::arbitrary(g) % 3` becomes `g.choose(&[0, 1, 2]).unwrap()`. - For generating numbers in range 0..=1, I instead replaced with generating a boolean, which gets rid of the `unreachable!` calls. - I removed the code to generate numbers in range 0..=0. - For generating larger numbers, I used `u64::arbitrary` instead, which should make things "less wrong". Some things I assumed, but am happy to change before landing, just let me know: - Theoretically we don't *need* to change the code for `% 2` and `% 4`, as the math checks out there. I changed it for consistency there, but am happy to change it back. - Using boolean also wasn't suggested initially, I'm happy to change back. Reviewed By: krallin Differential Revision: D31379381 fbshipit-source-id: a0bac26ebabd32a6c65f717512de998ef5dc37c8
393 lines
12 KiB
TOML
393 lines
12 KiB
TOML
# @generated by autocargo
|
|
|
|
[package]
|
|
name = "eden_mononoke"
|
|
version = "0.1.0"
|
|
authors = ["Facebook"]
|
|
edition = "2018"
|
|
license = "GPLv2+"
|
|
|
|
[[bin]]
|
|
name = "backfill_mapping"
|
|
path = "cmds/backfill_mapping.rs"
|
|
|
|
[[bin]]
|
|
name = "benchmark_storage_config"
|
|
path = "cmds/benchmark_storage_config/main.rs"
|
|
|
|
[[bin]]
|
|
name = "bonsai_verify"
|
|
path = "cmds/bonsai_verify/main.rs"
|
|
test = false
|
|
|
|
[[bin]]
|
|
name = "check_git_wc"
|
|
path = "cmds/check_git_wc/main.rs"
|
|
|
|
[[bin]]
|
|
name = "compute_commit_stats"
|
|
path = "cmds/compute_commit_stats/src/main.rs"
|
|
|
|
[[bin]]
|
|
name = "configlint"
|
|
path = "cmds/configlint.rs"
|
|
|
|
[[bin]]
|
|
name = "dump_public_changeset_entries"
|
|
path = "cmds/dump_public_changeset_entries.rs"
|
|
test = false
|
|
|
|
[[bin]]
|
|
name = "dumprev"
|
|
path = "cmds/dumprev.rs"
|
|
test = false
|
|
|
|
[[bin]]
|
|
name = "idxdump"
|
|
path = "cmds/idxdump.rs"
|
|
test = false
|
|
|
|
[[bin]]
|
|
name = "manual_scrub"
|
|
path = "cmds/manual_scrub/main.rs"
|
|
|
|
[[bin]]
|
|
name = "packer"
|
|
path = "cmds/packer/main.rs"
|
|
|
|
[[bin]]
|
|
name = "rechunker"
|
|
path = "cmds/rechunker.rs"
|
|
|
|
[[bin]]
|
|
name = "revlogrepo"
|
|
path = "cmds/revlogrepo.rs"
|
|
|
|
[[bin]]
|
|
name = "segmented_changelog_seeder"
|
|
path = "cmds/segmented_changelog_seeder.rs"
|
|
|
|
[[bin]]
|
|
name = "segmented_changelog_tailer"
|
|
path = "cmds/segmented_changelog_tailer.rs"
|
|
|
|
[[bin]]
|
|
name = "sqlblob_gc"
|
|
path = "cmds/sqlblob_gc/main.rs"
|
|
|
|
[[bin]]
|
|
name = "streaming_clone_warmup"
|
|
path = "cmds/streaming_clone_warmup/main.rs"
|
|
|
|
[dependencies]
|
|
ahash = "0.7.4"
|
|
anyhow = "1.0"
|
|
ascii = "1.0"
|
|
async-compression = { version = "0.3.8", features = ["all-implementations", "brotli", "bzip2", "deflate", "gzip", "zlib", "zstd"] }
|
|
blobrepo = { version = "0.1.0", path = "blobrepo" }
|
|
blobrepo_hg = { version = "0.1.0", path = "blobrepo/blobrepo_hg" }
|
|
blobrepo_utils = { version = "0.1.0", path = "blobrepo_utils" }
|
|
blobstore = { version = "0.1.0", path = "blobstore" }
|
|
blobstore_factory = { version = "0.1.0", path = "blobstore/factory" }
|
|
bookmarks = { version = "0.1.0", path = "bookmarks" }
|
|
borrowed = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
|
|
bulkops = { version = "0.1.0", path = "bulkops" }
|
|
bytes = { version = "1.0", features = ["serde"] }
|
|
bytesize = "1.0"
|
|
cacheblob = { version = "0.1.0", path = "blobstore/cacheblob" }
|
|
cached_config = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
|
|
changesets = { version = "0.1.0", path = "changesets" }
|
|
check_git_wc = { version = "0.1.0", path = "git/check_git_wc" }
|
|
clap = "2.33"
|
|
cloned = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
|
|
cmdlib = { version = "0.1.0", path = "cmdlib" }
|
|
context = { version = "0.1.0", path = "server/context" }
|
|
criterion = "=0.3.1"
|
|
dashmap = { version = "4.0.2", features = ["serde"] }
|
|
derive_more = "0.99.3"
|
|
derived_data = { version = "0.1.0", path = "derived_data" }
|
|
environment = { version = "0.1.0", path = "cmdlib/environment" }
|
|
failure_ext = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
|
|
fbinit = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
|
|
filestore = { version = "0.1.0", path = "filestore" }
|
|
futures = { version = "0.3.13", features = ["async-await", "compat"] }
|
|
futures-old = { package = "futures", version = "0.1.31" }
|
|
futures-util = "0.3.7"
|
|
git2 = "0.13"
|
|
itertools = "0.10.1"
|
|
lock_ext = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "master" }
|
|
manifest = { version = "0.1.0", path = "manifest" }
|
|
mercurial_derived_data = { version = "0.1.0", path = "derived_data/mercurial_derived_data" }
|
|
mercurial_revlog = { version = "0.1.0", path = "mercurial/revlog" }
|
|
mercurial_types = { version = "0.1.0", path = "mercurial/types" }
|
|
metaconfig_types = { version = "0.1.0", path = "metaconfig/types" }
|
|
mononoke_types = { version = "0.1.0", path = "mononoke_types" }
|
|
packblob = { version = "0.1.0", path = "blobstore/packblob" }
|
|
prefixblob = { version = "0.1.0", path = "blobstore/prefixblob" }
|
|
rand = { version = "0.8", features = ["small_rng"] }
|
|
repo_factory = { version = "0.1.0", path = "repo_factory" }
|
|
revset = { version = "0.1.0", path = "revset" }
|
|
scuba_ext = { version = "0.1.0", path = "common/scuba_ext" }
|
|
segmented_changelog = { version = "0.1.0", path = "segmented_changelog" }
|
|
serde = { version = "1.0.126", features = ["derive", "rc"] }
|
|
serde_derive = "1.0"
|
|
serde_json = { version = "1.0", features = ["float_roundtrip", "unbounded_depth"] }
|
|
skeleton_manifest = { version = "0.1.0", path = "derived_data/skeleton_manifest" }
|
|
slog = { version = "2.5", features = ["max_level_trace", "nested-values"] }
|
|
sql_construct = { version = "0.1.0", path = "common/sql_construct" }
|
|
sql_ext = { version = "0.1.0", path = "common/rust/sql_ext" }
|
|
sqlblob = { version = "0.1.0", path = "blobstore/sqlblob" }
|
|
streaming_clone = { version = "0.1.0", path = "repo_client/streaming_clone" }
|
|
tempfile = "3.1"
|
|
tokio = { version = "1.10", features = ["full", "test-util", "tracing"] }
|
|
tokio-stream = { version = "0.1.4", features = ["fs", "io-util", "net", "signal", "sync", "time"] }
|
|
toml = "=0.5.7"
|
|
|
|
[patch.crates-io]
|
|
curl-sys = { git = "https://github.com/mzr/curl-rust", rev = "97694cf73ea9309d9e8ed067ec0c05367841d405" }
|
|
daemonize = { git = "https://github.com/krallin/daemonize", rev = "f7be28efa1b4a70e43bb37b5f4ff4d664992edca" }
|
|
lru-disk-cache = { git = "https://github.com/mozilla/sccache", rev = "033ebaae69beeb0ac04e8c35d6ff1103487bd9a3" }
|
|
mockall = { git = "https://github.com/fbsource/mockall", rev = "4bc4ff4ab7d04ebaa7e7c9510a3337b7dda9d324" }
|
|
mockall_derive = { git = "https://github.com/fbsource/mockall", rev = "4bc4ff4ab7d04ebaa7e7c9510a3337b7dda9d324" }
|
|
mysql_common = { git = "https://github.com/iammxt/rust_mysql_common", rev = "0e4c86952f1e799960e736c0b2bb9d2a6d935bf1" }
|
|
object = { git = "https://github.com/gimli-rs/object", rev = "9271d2cd06d1fed11259225d915178fe3824a56d" }
|
|
prost = { git = "https://github.com/gabrielrussoc/prost", branch = "protoc-runtime" }
|
|
prost-derive = { git = "https://github.com/gabrielrussoc/prost", branch = "protoc-runtime" }
|
|
prost-types = { git = "https://github.com/gabrielrussoc/prost", branch = "protoc-runtime" }
|
|
quickcheck = { git = "https://github.com/jakoschiko/quickcheck", rev = "6ecdf5bb4b0132ce66670b4d46453aa022ea892c" }
|
|
ring = { git = "https://github.com/fanzeyi/ring", branch = "main" }
|
|
rustfilt = { git = "https://github.com/jsgf/rustfilt.git", rev = "8141fa7f1caee562ee8daffb2ddeca3d1f0d36e5" }
|
|
shellexpand = { git = "https://github.com/fanzeyi/shellexpand.git", rev = "179447a3f8fccd765acfd2eed15a54c716c49cfe" }
|
|
slog-syslog = { git = "https://github.com/slog-rs/syslog", rev = "c783ed8221a8f781b088e11dbf1a31ce40392cb1" }
|
|
tokio-core = { git = "https://github.com/bolinfest/tokio-core", rev = "5f37aa3c627d56ee49154bc851d6930f5ab4398f" }
|
|
toml = { git = "https://github.com/jsgf/toml-rs", branch = "dotted-table-0.5.7" }
|
|
|
|
[workspace]
|
|
members = [
|
|
".",
|
|
"admin",
|
|
"aliasverify",
|
|
"alpn",
|
|
"backfill_derived_data",
|
|
"benchmark_filestore",
|
|
"benchmarks/derived_data",
|
|
"benchmarks/simulated_repo",
|
|
"blobimport",
|
|
"blobimport_lib",
|
|
"blobimport_lib/consts",
|
|
"blobrepo",
|
|
"blobrepo/blobrepo_hg",
|
|
"blobrepo/blobsync",
|
|
"blobrepo/changeset_fetcher",
|
|
"blobrepo/common",
|
|
"blobrepo/errors",
|
|
"blobrepo/override",
|
|
"blobrepo/repo_blobstore",
|
|
"blobrepo_utils",
|
|
"blobstore",
|
|
"blobstore/blobstore_stats",
|
|
"blobstore/cacheblob",
|
|
"blobstore/chaosblob",
|
|
"blobstore/delayblob",
|
|
"blobstore/ephemeral_blobstore",
|
|
"blobstore/factory",
|
|
"blobstore/fileblob",
|
|
"blobstore/if",
|
|
"blobstore/logblob",
|
|
"blobstore/memblob",
|
|
"blobstore/multiplexedblob",
|
|
"blobstore/packblob",
|
|
"blobstore/packblob/if",
|
|
"blobstore/prefixblob",
|
|
"blobstore/readonlyblob",
|
|
"blobstore/redactedblobstore",
|
|
"blobstore/samplingblob",
|
|
"blobstore/sqlblob",
|
|
"blobstore/throttledblob",
|
|
"blobstore/virtually_sharded_blobstore",
|
|
"blobstore_healer",
|
|
"blobstore_sync_queue",
|
|
"bonsai_git_mapping",
|
|
"bonsai_git_mapping/git_mapping_pushrebase_hook",
|
|
"bonsai_globalrev_mapping",
|
|
"bonsai_globalrev_mapping/globalrev_pushrebase_hook",
|
|
"bonsai_globalrev_mapping/if",
|
|
"bonsai_hg_mapping",
|
|
"bonsai_hg_mapping/if",
|
|
"bonsai_svnrev_mapping",
|
|
"bonsai_svnrev_mapping/if",
|
|
"bookmarks",
|
|
"bookmarks/bookmarks_movement",
|
|
"bookmarks/bookmarks_types",
|
|
"bookmarks/dbbookmarks",
|
|
"bookmarks/warm_bookmarks_cache",
|
|
"bulkops",
|
|
"bulkops/bench",
|
|
"cache_warmup",
|
|
"changesets",
|
|
"changesets/changesets_impl",
|
|
"changesets/if",
|
|
"cmdlib",
|
|
"cmdlib/environment",
|
|
"cmdlib/x_repo",
|
|
"cmds/copy_blobstore_keys",
|
|
"commit_rewriting/backsyncer",
|
|
"commit_rewriting/bookmark_renaming",
|
|
"commit_rewriting/bookmarks_validator",
|
|
"commit_rewriting/commit_validator",
|
|
"commit_rewriting/cross_repo_sync",
|
|
"commit_rewriting/cross_repo_sync/test_utils",
|
|
"commit_rewriting/live_commit_sync_config",
|
|
"commit_rewriting/megarepo",
|
|
"commit_rewriting/mononoke_x_repo_sync_job",
|
|
"commit_rewriting/movers",
|
|
"commit_rewriting/synced_commit_mapping",
|
|
"common/allocation_tracing",
|
|
"common/async_limiter",
|
|
"common/async_limiter/examples/tokio_v2",
|
|
"common/bounded_traversal",
|
|
"common/copy_utils",
|
|
"common/dedupmap",
|
|
"common/futures_watchdog",
|
|
"common/iterhelpers",
|
|
"common/path_hash",
|
|
"common/reloader",
|
|
"common/rendezvous",
|
|
"common/rust/caching_ext",
|
|
"common/rust/slog_ext",
|
|
"common/rust/sql_ext",
|
|
"common/scribe_ext",
|
|
"common/scuba_ext",
|
|
"common/sql_construct",
|
|
"common/timeseries",
|
|
"common/topo_sort",
|
|
"common/type_map",
|
|
"common/uniqueheap",
|
|
"derived_data",
|
|
"derived_data/blame",
|
|
"derived_data/changeset_info",
|
|
"derived_data/changeset_info/if",
|
|
"derived_data/deleted_files_manifest",
|
|
"derived_data/derived_generation",
|
|
"derived_data/fastlog",
|
|
"derived_data/filenodes",
|
|
"derived_data/fsnodes",
|
|
"derived_data/manager",
|
|
"derived_data/mercurial_derived_data",
|
|
"derived_data/skeleton_manifest",
|
|
"derived_data/test",
|
|
"derived_data/test_utils",
|
|
"derived_data/unodes",
|
|
"derived_data/utils",
|
|
"edenapi_server",
|
|
"edenapi_service",
|
|
"fastreplay",
|
|
"filenodes",
|
|
"filenodes/if",
|
|
"filestore",
|
|
"git/check_git_wc",
|
|
"git/git-pool",
|
|
"git/git_types",
|
|
"git/git_types/if",
|
|
"git/gitimport",
|
|
"git/import_tools",
|
|
"gotham_ext",
|
|
"hgcli",
|
|
"hgproto",
|
|
"hook_tailer",
|
|
"hooks",
|
|
"hooks/content-stores",
|
|
"hooks/hook_manager_factory",
|
|
"lfs_import",
|
|
"lfs_import_lib",
|
|
"lfs_protocol",
|
|
"lfs_server",
|
|
"manifest",
|
|
"megarepo_api",
|
|
"megarepo_api/async_requests",
|
|
"megarepo_api/async_requests_worker",
|
|
"megarepo_api/commit_transformation",
|
|
"megarepo_api/configo_client",
|
|
"megarepo_api/if",
|
|
"megarepo_api/mapping",
|
|
"megarepo_api/megarepo_config",
|
|
"megarepo_api/megarepo_error",
|
|
"megarepo_api/requests_table",
|
|
"mercurial/bundle_replay_data",
|
|
"mercurial/bundles",
|
|
"mercurial/mutation",
|
|
"mercurial/revlog",
|
|
"mercurial/types",
|
|
"mercurial/types/if",
|
|
"mercurial/types/mocks",
|
|
"metaconfig/parser",
|
|
"metaconfig/types",
|
|
"microwave",
|
|
"microwave/builder",
|
|
"microwave/if",
|
|
"mononoke_api",
|
|
"mononoke_api/types",
|
|
"mononoke_api_hg",
|
|
"mononoke_hg_sync_job",
|
|
"mononoke_types",
|
|
"mononoke_types/if",
|
|
"mononoke_types/mocks",
|
|
"mutable_counters",
|
|
"mutable_renames",
|
|
"newfilenodes",
|
|
"observability",
|
|
"permission_checker",
|
|
"phases",
|
|
"pushrebase",
|
|
"pushrebase/pushrebase_hook",
|
|
"pushrebase_mutation_mapping",
|
|
"quiet_stream",
|
|
"rate_limiting",
|
|
"reachabilityindex",
|
|
"reachabilityindex/common",
|
|
"reachabilityindex/if",
|
|
"reachabilityindex/skiplist",
|
|
"reachabilityindex/test-helpers",
|
|
"regenerate_hg_filenodes",
|
|
"repo_attributes/repo_derived_data",
|
|
"repo_attributes/repo_identity",
|
|
"repo_client",
|
|
"repo_client/getbundle_response",
|
|
"repo_client/mononoke_repo",
|
|
"repo_client/obsolete",
|
|
"repo_client/remotefilelog",
|
|
"repo_client/repo_read_write_status",
|
|
"repo_client/reverse_filler_queue",
|
|
"repo_client/scribe_commit_queue",
|
|
"repo_client/streaming_clone",
|
|
"repo_client/unbundle",
|
|
"repo_client/wirepack",
|
|
"repo_factory",
|
|
"repo_factory/test_repo_factory",
|
|
"repo_import",
|
|
"revset",
|
|
"revset/revset-test-helper",
|
|
"scs/if",
|
|
"segmented_changelog",
|
|
"segmented_changelog/bench/concurrent_idmap",
|
|
"segmented_changelog/types",
|
|
"server",
|
|
"server/context",
|
|
"server/monitoring",
|
|
"server/qps",
|
|
"server/repo_listener",
|
|
"server/session_id",
|
|
"sshrelay",
|
|
"statistics_collector",
|
|
"streaming_clone",
|
|
"tests/fixtures",
|
|
"tests/utils",
|
|
"tests/write_stub_log_entry",
|
|
"time_window_counter",
|
|
"tunables",
|
|
"tunables/tunables-derive",
|
|
"unbundle_replay",
|
|
"upload_globalrevs",
|
|
"walker",
|
|
]
|