Commit Graph

52 Commits

Author SHA1 Message Date
Arun Thulasi
6f3e24f89a Update libc-0.2.137 to libc-0.2.139
Reviewed By: zertosh

Differential Revision: D43203556

fbshipit-source-id: 460f339f603fec97f367967a20a4c6e7a81ad027
2023-02-12 16:30:00 -08:00
David Tolnay
d4b0cd87de Update libc to 0.2.137
Summary: Update from 0.2.135 to 0.2.137, the latest version on crates.io, in preparation for backporting a PR in the diff after this one.

Reviewed By: zertosh

Differential Revision: D40874274

fbshipit-source-id: debf9dae82ecc20201470e634f10904a2b308e51
2022-11-01 02:16:19 -07:00
Sargun Dhillon
66a8f96198 Update Rust libc crate to 0.2.135
Summary: This updates the libc crate to 0.2.135, which includes the FICLONE constant needed to the given ioctl.

Reviewed By: justintrudell

Differential Revision: D40286796

fbshipit-source-id: acfa115479cd289f478d8d73937be34ced5c4bbb
2022-10-13 18:51:18 -07:00
Andres Suarez
25bec96f4c update to rust 1.64.0
Summary: https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html

Reviewed By: diliop, dtolnay

Differential Revision: D39825734

fbshipit-source-id: 4a789f2c24707fbc6a14b506448d405d5a60a53d
2022-09-27 15:18:58 -07:00
Andres Suarez
3c912389d9 Update libc-0.2.125 to libc-0.2.132
Reviewed By: dtolnay

Differential Revision: D39578353

fbshipit-source-id: 800721931e82485678e8ecf997afcc6711f6d4cf
2022-09-16 20:06:28 -07:00
Michael Bolin
9b6ccfaccb pin libc crate to 0.2.125
Reviewed By: ImanolBarba

Differential Revision: D39433159

fbshipit-source-id: 4442651a0874ebc6724796206db02c20e455a1c0
2022-09-12 09:55:50 -07:00
Jun Wu
e427765b8d config: move to subdirectory
Summary:
Move config related crates to a subdirectory to make top-level lib/ cleaner:
- configmodel -> config/model
- configparser -> config/parser (or maybe should be called "loader"?)
- configparser/pest-hgrc -> config/pest-hgrc

New crates will be added to config/ later.

Differential Revision: D39033975

fbshipit-source-id: 2b55491c3097442c0787fef33a811a809cbcb7d3
2022-09-01 17:43:38 -07:00
Eddie Shen
8f1baefee1 Codemod away ::{self}; (#71)
Summary:
X-link: https://github.com/facebookresearch/Private-ID/pull/71

Previous codemod left some crust. This commit cleans up useless uses to use less uses.

Reviewed By: stepancheg

Differential Revision: D38211793

fbshipit-source-id: c852dd1ec617fe81a1d9bd0d8a9e5d2357b9b502
2022-08-01 10:56:01 -07:00
Muir Manders
3a1078a66b runlog: use better method to get pid
Summary: Not sure how I missed this, but the std library exposes getpid via std::process::id().

Reviewed By: quark-zju

Differential Revision: D36016277

fbshipit-source-id: 263ffdee1b3f7132198abe340c942d0da73a1b1b
2022-05-12 16:52:14 -07:00
Muir Manders
60208fb167 atomicfile: improve usability
Summary: Add wrapper func to util::file that fills in mode perms for you and sets fsync=false. fsync has serious performance costs we don't want to pay normally.

Reviewed By: DurhamG

Differential Revision: D35985476

fbshipit-source-id: 96925bd89f88ed3e15ab3adf1791ebadc3fb6a73
2022-05-10 22:04:30 -07:00
Muir Manders
2407963405 configmodel: impl Config for BTreeMap<&str, &str>
Summary:
This is often more convenient in tests inserting &'static str. I left the String impl since I can imagine cases where borrowed data is not convenient.

I tried to make it generic, but couldn't come up with something that maintained ergonomics for users.

Reviewed By: sggutier

Differential Revision: D35985480

fbshipit-source-id: e3802c35ebd3f945692c004eb34b454e576c9195
2022-05-10 07:38:55 -07:00
Jason White
55695a98ac third-party/rust: Update tempfile to v3.3.0
Reviewed By: jsgf

Differential Revision: D35477506

fbshipit-source-id: ef10c8f7548a21c0fb3d83d5debfe2e000657d08
2022-04-11 15:18:36 -07:00
Huapeng Zhou
2d8e387606 rust: update serde_json to 1.0.79 and serde to 1.0.136
Summary:
Needed to import [cloud-hypervisor](https://github.com/cloud-hypervisor/cloud-hypervisor).

(Note: this ignores all push blocking failures!)

Reviewed By: dtolnay

Differential Revision: D34433589

fbshipit-source-id: f92ea3ba640d19f170513b558f3d5208790bab67
2022-04-10 23:39:55 -07:00
Huapeng Zhou
a232791ef1 rust: update anyhow to 1.0.56
Summary:
Needed by cloud-hypervisor https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/Cargo.toml#L19.

(Note: this ignores all push blocking failures!)

Reviewed By: jsgf

Differential Revision: D34432496

fbshipit-source-id: deaa320c74a22e325a116bcc0d5b0120c4f3744b
2022-04-07 04:31:34 -07:00
David Tolnay
1194f1a5e0 Prepare for rustfmt upgrade 6/13
Summary:
Context: I am upgrading rustfmt in D35234535.

 ---

This diff contains all the formatting changes which are idempotent between the old and the new version of rustfmt. It's generated by formatting with the new rustfmt, then formatting immediately again with the old rustfmt. If there are any big changes in here, that's code that old rustfmt used to crash on but new rustfmt handles correctly.

Separating out this part of the changes prior to flipping the rustfmt version switch globally allows the amount of code that needs to be landed atomically to be smaller, since this diff is independent and can land at any point before the rest of the stack.

 ---

Reviewed By: zertosh

Differential Revision: D35234531

fbshipit-source-id: 2ab036e03d602f6385992283c2b04381550ebae7
2022-03-29 18:54:21 -07:00
Muir Manders
a413d7e9d3 runlog: fix panic when "hg" invoked without args
Summary: Count a naked "hg" invocation as "boring" command instead of panicking.

Reviewed By: sggutier

Differential Revision: D35194336

fbshipit-source-id: 3c3ffcf2b9a136f64f5c5ade7d3d4a7a12dfb85f
2022-03-28 16:25:17 -07:00
Muir Manders
4ffa2d73b8 runlog: infer command boringness in some cases
Summary:
Now the runlog infers than an hg command is "boring" if the command disables the blackbox. "boring" means the runlog won't touch the watchfile to notify VSCode, and runlog will more aggressively clean up the runlog files.

This is not a good solution, but disabling the blackbox seems to be the only indicator that commands are known spammy. We should probably introduce an explicit option like that can inform the blackbox, runlog and other things that want to separate interesting commands from spam commands.

Reviewed By: quark-zju

Differential Revision: D34979231

fbshipit-source-id: 5aa4291360b71fdab5efa97514977acb085c80e0
2022-03-23 14:19:03 -07:00
Muir Manders
7576f9b1c7 runlog: clean up boring runlog files immediately
Summary: If an hg command determined to be "boring" and the runlog exits cleanly, the runlog now deletes the boring command's runlog entry immediately. This should help keep the number of runlog files under control.

Reviewed By: quark-zju

Differential Revision: D34979233

fbshipit-source-id: d3134fe6fd0c992cbabed16397bfde028582b235
2022-03-23 14:19:03 -07:00
Muir Manders
6ab55795e9 runlog: decouple logger from repo object
Summary: Rename Logger::new to Logger::from_repo and add Logger::new which can create a logger directly from the required elements. This makes it easier to unit test the Logger.

Reviewed By: quark-zju

Differential Revision: D34979232

fbshipit-source-id: 0963baa7f622893b48b96c7c400c292243321ba2
2022-03-23 14:19:03 -07:00
Huapeng Zhou
f0068c4f42 rust: update libc from 0.2.117 to 0.2.121
Summary: Needed to import cloud-hypervisor https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/Cargo.toml#L25.

Reviewed By: dtolnay

Differential Revision: D35052728

fbshipit-source-id: bdd60925501c446ee6d429fad6e95d6593ff2544
2022-03-23 10:00:47 -07:00
Muir Manders
6d8c87133d runlog: kebabify existing config knobs
Summary: I think we prefer dashes over underscores for config flags. These config values aren't actually configured anywhere, so it should be safe to change.

Differential Revision: D34592509

fbshipit-source-id: 4a5e808b492f65b3baa954ce37d66e8ab3bb5770
2022-03-10 18:16:05 -08:00
Muir Manders
196ce7cf9f runlog: move watchfile directly under .hg/
Summary: VSCode can't use watchman to watch the current location .hg/runlog/watchfile since watchman only lets you watch files at the top level of .hg. Move the runlog watchfile up to .hg/runlog_watchfile to compensate.

Reviewed By: DurhamG, quark-zju

Differential Revision: D34767447

fbshipit-source-id: 67f660d4255603402b0d846081db9034bced10ff
2022-03-10 12:57:15 -08:00
Muir Manders
7b1c750a1e runlog: add mechanism to watch for interesting commands
Summary: Add a "watchfile" file that gets touched only when an interesting command is written out to the runlog. "interesting" is defined as not in the runlog.boring-commands config value.

Reviewed By: quark-zju

Differential Revision: D34592501

fbshipit-source-id: f4506ca06649da6adc223990dc83ffda99541a29
2022-03-03 09:09:58 -08:00
Alex Hornby
f628e4793f remove generated thrift code and fix external CI (#26)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/rust-shed/pull/26

Pull Request resolved: https://github.com/facebookexperimental/eden/pull/104

No need for the checked in generated code anymore

Successful external CI Linux run on Git Hub PR: https://github.com/facebookexperimental/eden/runs/5130405984?check_suite_focus=true

Mac PR run fails with a SSL cert issue, will look separately

Reviewed By: chadaustin, mitrandir77

Differential Revision: D33840545

fbshipit-source-id: eafc2a0e2191d438fd828adeebc2e318d319025f
2022-02-09 12:21:32 -08:00
Facebook Community Bot
20a78c4882 Re-sync with internal repository 2022-02-09 18:47:06 +00:00
Wez Furlong
fb40a9c55f Back out "Bump parking-lot to version 0.12.0"
Summary:
Original commit changeset: ce571ef50289

Original Phabricator Diff: D33985872 (c94dada73b)

Reviewed By: dtolnay

Differential Revision: D34060091

fbshipit-source-id: c1ddcdd1848a51f83dcbc9b2eec5f316bb6e44e5
2022-02-08 11:37:32 -08:00
Mofei Zhang
c94dada73b Bump parking-lot to version 0.12.0
Summary:
~~~Added new parking-lot version named parking_lot_0_12~~~
allow-large-files

previous versions of parking-lot are incompatible with wasm compilation targets

https://github.com/rustwasm/wasm-bindgen/issues/2160
https://github.com/Amanieu/parking_lot/pull/302

Reviewed By: dtolnay

Differential Revision: D33985872

fbshipit-source-id: ce571ef50289fe97ff89dbf72d2c7f39fbd47758
2022-02-07 05:21:28 -08:00
Facebook Community Bot
9728bf52e9 Re-sync with internal repository 2022-02-07 12:59:09 +00:00
Facebook Community Bot
88edb37132 Re-sync with internal repository 2022-02-03 21:43:02 +00:00
Saul Gutierrez
a237ae47e7 repo: move the repo module to its own crate
Summary: Since `Repo` will soon contain more logic on its own not related to `clidispatcher`, we are moving its own crate.

Reviewed By: DurhamG

Differential Revision: D33883867

fbshipit-source-id: 94414e1e2692962bf491cc2abb4e1d3799cbcc03
2022-02-01 11:32:42 -08:00
Saul Gutierrez
248ad92776 runlog: add fields for network monitoring
Summary: Adds a field for the total of downloaded bytes and another one for the total of uploaded bytes

Differential Revision: D33344429

fbshipit-source-id: ed8a0d15f077f8b3490d5f808f2e8b6f7d674511
2022-01-10 14:13:19 -08:00
Saul Gutierrez
ce24ccc833 top: initial version of hg debugtop
Summary:
This adds a top command for `hg` by leveraging `runlog`. Currently it has four columns:
- `PID`: The process ID of the mercurial command
- `PROGRESS`: In case the process has progress bars, the position of the first one divided by the total of the first one. Otherwise `-`.
- `TIME SPENT`: The number of hours, minutes, seconds, and milliseconds the process has been running for. Has the same format as the original top.
- `CMD`: The `hg` subcommand and its arguments.

By now it prints a table instead of refreshing.

Differential Revision: D33177164

fbshipit-source-id: e2a1f274ca86f392cb086fabb46ddf03c2afdadb
2022-01-06 09:28:04 -08:00
Jun Wu
2a99866d7b codemod: update license headers
Summary:
The "Portions" license cannot be updated automatically. So this is a manual
update using:

  sd -s 'Portions Copyright (c) Facebook, Inc. and its affiliates.' 'Portions Copyright (c) Meta Platforms, Inc. and affiliates.' `rg -l Facebook`
  sd -s 'Copyright (c) Facebook, Inc. and its affiliates.' 'Copyright (c) Meta Platforms, Inc. and affiliates.' `rg -l Facebook`

Differential Revision: D33420114

fbshipit-source-id: 49ae00a7b62e3b8cc6c5dd839b3c104a75e72a56
2022-01-05 14:43:32 -08:00
Bob Yang
f89f7004db Upgrade to parking_log 0.11.2 and add feature send_guard
Summary: ^

Reviewed By: ndmitchell

Differential Revision: D32856682

fbshipit-source-id: adf920ce0affeb2a43f52034b818e073513b89a9
2021-12-15 14:37:44 -08:00
David Tolnay
9dea6e43a8 third-party/rust: Update anyhow from 1.0.48 to 1.0.51
Reviewed By: aaronabramov

Differential Revision: D32699872

fbshipit-source-id: 4ae6ae6916e0318c2b05c904c1436151de9c5a23
2021-11-29 14:14:17 -08:00
David Tolnay
56dbf182e3 third-party/rust: Update anyhow from 1.0.47 to 1.0.48
Summary:
For invocations of `ensure!` where the argument is one of the comparison operators `==` `<=` `<` `!=` `>=` `>` and the lhs and rhs of the operator both have a `Debug` impl, we now render both sides as part of the error message.

### Example:

```
ensure!(flags.len() <= 40);
```

```
ensure!(kind == Kind::File);
```

Before:

```
Condition failed: `flags.len() <= 40`
Condition failed: `kind == Kind::File`
```

After:

```
Condition failed: `flags.len() <= 40` (99 vs 40)
Condition failed: `kind == Kind::File` (Symlink vs File)
```

Reviewed By: zertosh

Differential Revision: D32598267

fbshipit-source-id: 70fdab6d8f0e3ceceb98e651eab0a73795cadaeb
2021-11-22 13:19:04 -08:00
David Tolnay
8b29b9f7bb third-party/rust: Update anyhow from 1.0.44 to 1.0.47
Summary:
This release helps catch places that the `anyhow!` or `bail!` macros are invoked with a missing fmt argument, such as:

```
-     anyhow!("unsupported redirect operation {:?}")
+     anyhow!("unsupported redirect operation {:?}", op)
```

All instances of this in fbcode were fixed in D32266567 (2f440eac7e).

Reviewed By: wqfish

Differential Revision: D32564287

fbshipit-source-id: e9cf5a1376e6c83343de3f3c6ba2925d88334a30
2021-11-19 15:57:13 -08:00
Muir Manders
9db0d4fcb7 runlog: disable runlog when running as root
Summary: The hg runlog causes every hg command to write out a runlog file (and create the runlog directory if it doesn't exist). If hg is run as root this can cause permission issues for subsequent hg commands. To mitigate this issue, the runlog feature now disables itself on unix platforms if the process's effective user id is 0 and the .hg directory is _not_ owned by root. The presumption is that if .hg is owned by root then it is normal for hg commands to be run as root.

Reviewed By: quark-zju

Differential Revision: D32368400

fbshipit-source-id: e6cbeb37e28a414a705b7a4eb350e87e34f6faf5
2021-11-15 12:02:32 -08:00
Victor Gao
e625e8d934 update Diem crates to release 1.5
Summary:
This updates the existing Diem & Move crates to the latest release (1.5).

A patch was needed to make feature unification work.
- `diem-crypto` has two exclusive features "fiat" and "u64", with ["fiat"] being the default feature set
- `diem-types` depends on `diem-crypto`, but it doesn't disable the default features, so "fiat" is enabled as a result
- jellyfish-merkle uses both `diem-types` and `diem-crypto` with feature "u64" enabled. This is problematic since "u64" and "fiat" cannot coexist.
- The patch simply disables the default features from `diem-crypto` in the `Cargo.toml` of `diem-types`

The following libraries have been bumped to satisfy version selection:
1. hex: 0.4 => 0.4.3
2. proptest: 0.1 => 1.0
3. proptest-derive: 0.2 => 0.3
4. serde_json: 1.0.60 => 1.0.64

#buildmore

Reviewed By: jsgf

Differential Revision: D31842317

fbshipit-source-id: c4d75b167e32f5f004dc8ed578750d7b2c6fe0ff
2021-11-03 01:46:13 -07:00
David Tolnay
2ea696cb5a Regenerate Cargo.tomls to 2021 edition
Summary: Generated by `sed -i 's/edition = "2018"/edition = "2021"/' common/rust/cargo_from_buck/project_configs/*.toml` and `cargo autocargo` following the autocargo code change in D31830985 and its corresponding MSDK rebuild in D31832311.

Reviewed By: zertosh

Differential Revision: D31832698

fbshipit-source-id: db79024cad311467d5b7c13b7abedc6464f09366
2021-10-21 12:40:28 -07:00
Muir Manders
5ac8d7559b util: move file::atomic_create to separate crate
Summary:
Now lower level crates such as indexedlog don't have to pull in the entire util crate.

Note that I also changed atomic_write to no longer apply the umask to the specified mode perms. Since mode perms are required to be explicitly specified, it is a bit weird to modify the perms via umask. I changed the writing of hgrc.dynamic to specify 0644 to match what its previous effective permissions were.

Reviewed By: quark-zju

Differential Revision: D31743404

fbshipit-source-id: a6cc56e1111a345b2c6d2c95c98d771ead076387
2021-10-19 17:35:45 -07:00
Muir Manders
dc8c6a1937 util: add fsync option to atomic_write
Summary: Move fsync logic from indexedlog::utils into util::file's atomic_write. It isn't obvious all the various syncing you need to do to minimize the risk of data loss.

Reviewed By: DurhamG

Differential Revision: D31733192

fbshipit-source-id: 48d7536dc783677901015c1e70b92b1f79ea5f73
2021-10-19 17:35:45 -07:00
Muir Manders
9ae31266df runlog: use new atomic_write file utility
Summary: This forces you to set the permissions properly. We now write the runlog files at 0644 instead of tempfile's default of 0600.

Reviewed By: DurhamG

Differential Revision: D31702359

fbshipit-source-id: 874d6676634c78aed8b0f6e918f1d839d6167bd8
2021-10-19 17:35:45 -07:00
Jun Wu
ae33ddb533 rustfmt: format codebase
Summary:
See previous diff for context. The reorders the `use` statements to make
things a bit more consistent.

Reviewed By: yancouto

Differential Revision: D31751166

fbshipit-source-id: 09c4ddba69ddeae1fc1b996d93fbfa6063e3407d
2021-10-19 11:07:24 -07:00
Jun Wu
d2fd54d036 rustfmt: format part of codebase
Summary:
The current rustfmt we use cannot handle `#[cfg(...)] use ...::{...}` properly.
Let's format the files that do not have `#[cfg] use` or are generated first.

The change is done by Ruby code:

  list = Dir['{lib,edenscmnative}/**/*.rs'].select {|p|!File.read(p)["generated"]}
  system 'rustfmt', *list

  $fn = nil
  reverts = `hg diff`.lines.map do |l|
    $fn = l[/diff --git a\/fbcode\/eden\/scm\/([^ ]*) b\//, 1] || $fn
    $fn if l[/-\s*#\[cfg/]
  end.compact.uniq
  system 'hg', 'revert', *reverts

Reviewed By: yancouto

Differential Revision: D31751037

fbshipit-source-id: dbe0b39e35345b7d1c54cbdf67b8aafd19df9c70
2021-10-19 11:07:24 -07:00
Davide Cavalca
5ad11146fc Bump some dependencies for below
Summary: Bump in preparation for a new release

Reviewed By: brianc118

Differential Revision: D31657479

fbshipit-source-id: eeb2a08c54f6db75b6e515ca0966637f31b906a8
2021-10-14 17:36:29 -07:00
Muir Manders
94ed1c88f5 runlog: add basic runlog CLI command
Summary:
Add runlog command to dump out runlog entries. Supports newline delimited JSON or plain text (currently just outputting pretty debug format).

By default it filters to only show running commands, but --all will show all commands (i.e. including exitted/crashed commands).

Reviewed By: quark-zju

Differential Revision: D31128812

fbshipit-source-id: c5b86f4717c2289a99109ba7754080084d7a3ed0
2021-10-14 09:46:24 -07:00
Muir Manders
c62e8a2bf8 runlog: automatically clean up old entries
Summary:
When initializing the runlog logger, we probabilistically invoke a cleanup function to delete old log entries. Cleanup happens with a chance of runlog.cleanup_chance [0-1) (i.e. cleanup can be disabled with 0, or run every time with 1). Default chance is 0.01 or 1% of command invocations.

Cleanup iterates over each runlog file and removes it if both:
1. Can acquire shared file lock, meaning the command is no longer running, AND
2. The file's mtime is at least as old as runlog.cleanup_threshold seconds.

Reviewed By: quark-zju

Differential Revision: D31128863

fbshipit-source-id: 7cbb709ab1006e5c86aa265db4ad430db7e69741
2021-10-14 09:46:24 -07:00
Jeremy Fitzhardinge
66e1fc5370 rust: rerun autocargo after thrift/rust changes
Summary: Need this for cargo check/rust-analyzer to work.

Reviewed By: guswynn

Differential Revision: D31319911

fbshipit-source-id: ebd3fa72d8fc3667391a2067f95cab9e5f53301f
2021-09-30 17:40:04 -07:00
Qinfan Wu
dbac51105d Fix broken builds caused by rand upgrade
Summary:
A previous commit updated `rand` from 0.7 to 0.8. One breaking change introduced was that `Alphanumeric` now samples `u8` instead of `char`.

See https://docs.rs/rand/0.7.3/rand/distributions/struct.Alphanumeric.html and https://docs.rs/rand/0.8.4/rand/distributions/struct.Alphanumeric.html.

Reviewed By: bolinfest

Differential Revision: D31298553

fbshipit-source-id: 5d0d588550f17bac5ca4788748ec3f873398bf35
2021-09-29 23:09:58 -07:00