Commit graph

302 commits

Author SHA1 Message Date
Jason White
38a3818c48 third-party/rust: Update syscalls v0.6.6 -> v0.6.7
Reviewed By: rrnewton

Differential Revision: D40312880

fbshipit-source-id: b6386d3821507787e7d76c86c1f63c265be86319
2022-10-12 14:29:02 -07:00
Jason White
19d2c786d1 third-party/rust: Enable "env" feature for clap
Reviewed By: zertosh

Differential Revision: D40156451

fbshipit-source-id: 4843099d10b7ca51467c24e849144955503240e3
2022-10-06 19:35:54 -07:00
Sophia Sun
aadb1865e7 Update nix crate from 0.23 to 0.25
Summary:
When I was trying to use `nix::unistd::gethostname` in D39783468, the version `0.23.0` will require users to pass in a `buf` as a parameter, however, in `0.25.0`, there is no need to pass in a `buf` as a parameter. Hence, I would love to update `nix` crate from `0.23` to `0.25` in order to not pass a redundant `buf` while calling `nix::unistd::gethostname`.

I fixed conflicts reflected from the signals manually so this diff is more than a few lines of code in `Cargo.toml`.

Here are the [changes](https://github.com/nix-rust/nix/compare/v0.23.0..v0.25.0) between `0.23` and `0.25`. See `CHANGELOG.md` for the most significant changes in this version.

Reviewed By: bgw

Differential Revision: D39919100

fbshipit-source-id: 7f62585ff72230bd2608aeb5a4780dc0128795f7
2022-10-03 15:31:17 -07:00
Vladimir Makaev
be457c2dc3 Migrate from structopt to clap3
Summary:
See rationale in the linked task
I was planning to build a new CLI and decided to follow CLI Foundation recommentation. Since hermit is effectively not released it's a good time to migrate now which hasn't been hard mostly followed the fastmods on the task and and some manual fixes of the remaining code

Reviewed By: jasonwhite

Differential Revision: D39953166

fbshipit-source-id: 6e917c6a8ea2ee8258e7e6068e9c9e787ebf0989
2022-10-03 12:18:55 -07:00
Andres Suarez
42214f8ec2 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
Paul Saab
90da155f18 Fix aarch64 build for fbcode//hermetic_infra/reverie:reverie-process
Summary: aarch64 is unsigned char so cast to libc::c_char

Reviewed By: dmm-fb

Differential Revision: D39802725

fbshipit-source-id: edaef4a14d88519abbd59bffa6ef6a74a0a96397
2022-09-25 10:32:37 -07:00
Andres Suarez
2364202dfc Update raw-cpuid-10.2.0 to raw-cpuid-10.6.0
Reviewed By: dtolnay

Differential Revision: D39622388

fbshipit-source-id: 10329e7037400986fd7c08a0d0dfbbd48332088a
2022-09-19 10:25:55 -07:00
Vladimir Makayev
de2fea408e Handle 'sysinfo' system call deterministically: use static values
Summary: Currently 'sysinfo' isn't being captured and determinized this might be a source of some divergencies in heap & stack. This diff with handle 'sysinfo' with hardcoded reasonable values. Follow up diffs with further enhance this

Reviewed By: rrnewton

Differential Revision: D39546772

fbshipit-source-id: a5a49e882a0fea4512bf991d257b0f8072f7f792
2022-09-18 18:49:13 -07:00
Andres Suarez
0f60462d16 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
David Tolnay
3deaf0e0c0 third-party/rust: Revert D39418421 "unpin thiserror"
Summary: D39418421 (8fef664fab) prematurely upgraded `thiserror`. Various projects in fbcode use nightly features including std::backtrace but the current fbcode Rust toolchain is 1.63.0, in which the backtrace API is different from the API of the latest nightlies.

Reviewed By: quark-zju

Differential Revision: D39562441

fbshipit-source-id: d1f8a993ec776cf82b1736b242bd4466def21230
2022-09-15 17:20:40 -07:00
Edwin Smith
8fef664fab unpin thiserror
Reviewed By: bolinfest, zertosh

Differential Revision: D39418421

fbshipit-source-id: 2f0246f190403a6f481e8803834174f229c0849a
2022-09-13 07:15:29 -07:00
Michael Bolin
c013909676 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
Michael Bolin
3c618d400d use git-config@0.7.1 instead of patched version
Reviewed By: mzr

Differential Revision: D39331880

fbshipit-source-id: 5990d68d718297a6df72e5eea3c16fed5b84169e
2022-09-09 21:01:16 -07:00
Jan Mazur
0a18bdf95f futures 0.3.21 -> 0.3.24
Summary: We have some deprecated functions in GH builds.

Differential Revision: D38909563

fbshipit-source-id: 3e8b77b10c352bfdfcbfe344f0ea2e95d4a339ad
2022-09-05 13:49:07 -07:00
Facebook Community Bot
2f6328ac8d
Re-sync with internal repository (#16)
Co-authored-by: Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com>
2022-09-01 12:34:47 -07:00
Jason White
6e18487a85 Remove dead code
Reviewed By: johnhurt

Differential Revision: D39036935

fbshipit-source-id: ca5febf045b279d421e2547e102c26e98d725d10
2022-08-29 12:25:19 -07:00
Jason White
89e2e8e431 Refactor trace module into its own crate
Reviewed By: johnhurt

Differential Revision: D36788853

fbshipit-source-id: 8a3765fb58d94188514ed1aba406a2dcd1e6551a
2022-08-26 09:27:58 -07:00
Charles Cady
120fbac957 Populate mmapped page trampoline with aarch64 instructions
Summary: This will help reverie-ptrace slowly migrate towards supporting `aarch64` as well as `x86_64`.

Reviewed By: jasonwhite

Differential Revision: D38787872

fbshipit-source-id: e747c59da8f0c59f0b85a50888c884dbbed65824
2022-08-19 01:37:10 -07:00
Jason White
357e7cac79 third-party/rust: Update syscalls crate v0.6.5 -> v0.6.6
Summary:
Updates the `syscalls` crate.

Changelog:
 - Added aarch64 support.

Reviewed By: psaab

Differential Revision: D38730424

fbshipit-source-id: fa7e0f65401a11c669058c5ffe280cce605ca017
2022-08-17 01:21:44 -07:00
Stiopa Koltsov
df4fca7482 rustfmt.toml: group_imports = StdExternalCrate
Summary:
To be landed when reformat changes land.

[Context](https://fb.workplace.com/groups/rust.language/posts/9143028552412345).

Reviewed By: zertosh

Differential Revision: D38485268

fbshipit-source-id: 2a193d675b60f67860fc437b0e2ee4982af8706f
2022-08-06 12:33:42 -07:00
Stiopa Koltsov
e53c5ef362 Apply rustfmt
Reviewed By: zertosh

Differential Revision: D38485027

fbshipit-source-id: 0f5e5b743e002045c95aca427b76e969d6bce347
2022-08-06 08:21:44 -07:00
Eddie Shen
0eaea9b139 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
Andres Suarez
d9836f722e Remove unnecessary prelude imports
Reviewed By: dtolnay

Differential Revision: D38192955

fbshipit-source-id: 1c4cb1399e08d6688b28b2556c5cbac891a71c0b
2022-07-27 14:19:15 -07:00
Stiopa Koltsov
4192366432 Remove ::{self}
Summary: Cleanup after reformat one import per line.

Reviewed By: zertosh

Differential Revision: D38207167

fbshipit-source-id: e463575513a72583ea8d6359636e8eaeebb488e2
2022-07-27 09:53:37 -07:00
Kaustav Haldar
00f0643ae1 Add bundlr-sdk to rust 3p crates
Summary:
Add bundlr-sdk to rust 3p crates.

Also needed some new fixups for a couple deps, and a custom fork of bundlr to use derive_builder 0.9 which is pinned in 2 deps we use, and fixed a missing out of scope trait bug in bundlr sdk.

Reviewed By: zhuomingfb0

Differential Revision: D37962056

fbshipit-source-id: 878048840d66dffcf558351614c45f9beef2f626
2022-07-22 07:22:52 -07:00
David Barsky
b475f69187 third-party: update tracing-core, tracing-subscriber, and tracing-appender
Summary:
This diff updates tracing. New features include:

## `tracing`
- New `Value` implementations for `String` and 128-bit integers. The `Value` implementation for `String` allows recording a `String` without needing to call `.as_str()` or similar. The `Value` implementation allows recording 128-bit integers, resolving this papercut: https://fb.workplace.com/groups/learningrust/permalink/3208916922712504/.
- There are additional methods on different trait objects of` Subscriber`s.

## `tracing-subscriber`

- Fixes multiple filtering bugs in the `Layer` implementations for `Option<impl Layer>` and `Vec<impl Layer>` (this is how folks are able to do arbitrary/dynamic numbers of loggers in `tracing`).
- Increases the minimum version of `tracing-core`.
- Adds a new `Layer::event_enabled` method, which allows Layers to filter events _after_ their field values are recorded. This is import for
- Some bug fixes in the `Filter` implementation for `EnvFilter`.

## `tracing-appender`

- Fixes bug in `RollingFileAppender` that could result in a failure to rotate the log file, or in panics in debug mode.

Notice to self: it seems like the filtering implementation in `tracing-subscriber` is kinda complex: it could make sense to fuzz it.

 ---

## Linked Change Logs
- `tracing-core`: https://github.com/tokio-rs/tracing/blob/v0.1.x/tracing-core/CHANGELOG.md#0128-june-23-2022
- `tracing-subscriber`: https://github.com/tokio-rs/tracing/blob/v0.1.x/tracing-subscriber/CHANGELOG.md#0314-jul-1-2022
- `tracing-appender`: https://github.com/tokio-rs/tracing/blob/v0.1.x/tracing-appender/CHANGELOG.md#022-march-17-2022

(Note: this ignores all push blocking failures!)

Reviewed By: jsgf

Differential Revision: D37932030

fbshipit-source-id: bee53e5ba219ffbcc9009781d347cd6b40f577ee
2022-07-21 11:36:12 -07:00
Jason White
88e67ee591 Use SysnoSet in Subscription
Summary: The `syscalls` crate now has the ability to create a statically-allocated bitset of syscalls. This gets rid of our usage of the dynamically-allocated `BitVec` and no longer makes assumptions about the size and offset of the syscall table. These assumptions are wrong for some architectures where syscall numbers start at 4096 instead of 0.

Reviewed By: johnhurt

Differential Revision: D37890556

fbshipit-source-id: 8d0d51e93c1a09c7390fd3898cea7955ef786e96
2022-07-20 13:54:33 -07:00
Jason White
f5c1175aa9 third-party/rust: Update syscalls 0.6.2 -> 0.6.5
Summary:
## v0.6.5

 - Renamed `with-serde` feature to just `serde`. The `with-serde` feature will
   be removed in the next major release.
 - Implemented `Serialize` and `Deserialize` for `SysnoSet`.

## v0.6.4

 - Implemented `Default`, `BitOr`, and `BitOrAssign` for `SysnoSet`.

## v0.6.3

 - Added features to expose the syscall tables of other architectures besides
   the target architecture. There is one feature per architecture and have the
   same name. For example, if the target architecture is `x86-64` and we also
   want the syscall table for `x86`, the `x86` feature can be enabled. Then,
   `syscalls::x86::Sysno` will be exposed.
 - Added the `all` feature, which enables the syscall tables for all
   architectures.
 - Added the `full` feature, which enables all current and future features for
   the crate.
 - Added man page links for all syscalls. Since these are generated, some links
   may be broken.

Reviewed By: johnhurt

Differential Revision: D37871066

fbshipit-source-id: 4aa4674d0dcf1168d989a34062befa3b07456d68
2022-07-15 12:52:06 -07:00
Jason White
9f7a420da6 Improve AMD support for PMU timers (#14)
Summary:
This fixes a few things related to timers on AMD CPUs:
 1. Fixes a breakage caused by updating to `raw-cpuid` v10. `FeatureInfo::{family_id,model_id}` no longer behave as they once did. This actually cleans up the code a bit.
 2. Fixes some invalid assembly code in a test that only runs on AMD CPUs. This would cause a SIGILL.
 3. Adds support for a few more AMD microarchitectures (Pinnacle Ridge, Castle Peak, and Cezanne).

Pull Request resolved: https://github.com/facebookexperimental/reverie/pull/14

Reviewed By: andronat

Differential Revision: D37638404

Pulled By: jasonwhite

fbshipit-source-id: f39c4aa166dab88917b56b0a0a16d319031a213a
2022-07-06 07:46:19 -07:00
Jason White
d913bf6e4f Fix unused imports warning
Reviewed By: wkhughes

Differential Revision: D37566816

fbshipit-source-id: 496361c582ef90ac469260023a83813de420f1b9
2022-07-05 11:28:41 -07:00
Stiopa Koltsov
5e71d185bb imports_granularity=Item
Summary: [Post about this change](https://fb.workplace.com/groups/rust.language/posts/8804682282913642)

Reviewed By: zertosh

Differential Revision: D37459034

fbshipit-source-id: d9b29a4ac5749aaf48322a148ba317f052fe7c6e
2022-07-01 16:24:42 -07:00
Jason White
5df280b851 Don't return a Result for RPC messages
Summary: If an RPC fails to send, there isn't much that can be done to handle it. In all call sites so far, they all just unwrap the error because it can't be handled properly. If an RPC fails, it is a programmer error (because the request/response failed to serialize/deserialize) and indicates a bug in our code.

Differential Revision: D37563857

fbshipit-source-id: 267072709f4230732a13989aaf74b50fd0908337
2022-06-30 16:59:53 -07:00
Jason White
6813d9a7b2 rustfmt with imports_granularity=Item
Summary: This makes merge conflicts much easier to handle.

Reviewed By: johnhurt

Differential Revision: D37564000

fbshipit-source-id: a7f1a2711ffbdbb23c93e2f479f47d0368a2dad9
2022-06-30 14:56:20 -07:00
Jason White
d34189fda6 third-party/rust: Update syscalls crate 0.6.1 -> 0.6.2
Summary:
From the changelog:
 - Added `SysnoSet` for constructing sets of syscalls. It uses a bitset under
   the hood and provides constant-time lookup and insertion of `Sysno`s.
 - Fixed `Sysno::len()` returning the wrong value for architectures with large
   syscall offsets.
 - Deprecated `Sysno::len()`. Use `Sysno::table_size()` instead. This will be
   removed in the next major version.

Differential Revision: D37556871

fbshipit-source-id: a287f2146a0776e6f0459a08b43a1d5a92bb6176
2022-06-30 11:59:56 -07:00
Jason White
884cba2bb0 Add log output for thread and process exits
Summary: Adds log output to the strace example tool. The real strace does this and so should we.

Reviewed By: johnhurt

Differential Revision: D37524309

fbshipit-source-id: e4f67a1e32b6ad4efedf84f570cb50cffad4fb3d
2022-06-29 10:59:11 -07:00
Robert Kelly
d8c87ad6ce ethers.rs
Summary:
This is a pretty in depth third party library being added.  The main changes are...

**version bumping**:
dunce = "1.0.0" => "1.0.2"
once_cell = "1.8" => "1.12"
tracing = "0.1.32" => "0.1.35"

adding ethers-rs fork:
https://github.com/rlkelly/ethers-rs.git

this depends on forks of:
coins-bip32  = https://github.com/rlkelly/bitcoins-rs.git
coins-bip39  = https://github.com/rlkelly/bitcoins-rs.git
eth-keystore = https://github.com/rlkelly/eth-keystore-rs.git

this was necessary to remove the wasm target, which creates a cyclic dependency for "indexmap".  This was ran into previously here:

https://fb.workplace.com/groups/rust.language/permalink/8603206789727860/

also, some fixups were created for a few packages to facilitate build.  I'm not a fan of libraries creating a build step to generate documentation...
----

This still does not have the ethers-middleware crate or the ethers-solc crate because it has the external build dependency of solc, which would make this a bit more complex to add:
https://docs.soliditylang.org/en/latest/installing-solidity.html

adding the crates without solc makes the process of integrating this library much easier, but it would be beneficial in the future.

@public
update rust deps

Reviewed By: jsgf

Differential Revision: D37320246

fbshipit-source-id: 251bd1c3c0e51733347a534fa597dea33d1df74b
2022-06-23 20:03:16 -07:00
Ryan Newton
d3f1af59a9 tweak timer lib to suppport new processor type
Summary: This is to enable development on my Alder Lake Fedora laptop.

Reviewed By: jasonwhite

Differential Revision: D37300482

fbshipit-source-id: cf881caa854ca4f8ab84b23454faa5dba0445e8a
2022-06-22 07:15:17 -07:00
Igor Sugak
53c3abb5da update goblin to 0.5.2
Summary: As titled.

Reviewed By: dtolnay

Differential Revision: D37300975

fbshipit-source-id: bdc6c97735c19ab789af902bfa2244e0f06c9440
2022-06-21 08:14:33 -07:00
Ryan Newton
a11fa11768 switch tests to only log reverie messages
Summary:
Right now we get a whole bunch of annoying messages from tokio that spam our test logs:

    2022-06-10T15:09:59.751928Z TRACE runtime.spawn{kind=block_on task.name= loc.file="hermetic_infra/reverie/reverie-ptrace/src/testing.rs" loc.line=58 loc.col=8}:runtime.spawn{kind=local task.name= loc.file="third-party/rust/vendor/tokio-1.15.0/src/task/local.rs" loc.line=302 loc.col=22}: tokio::task::waker: op="waker.drop" task.id=26

This diff makes the filter more restrictive for reverie tests.

Reviewed By: johnhurt

Differential Revision: D37071398

fbshipit-source-id: fe93ec3cc0cf61938be10d40df6fe2f46979fbf9
2022-06-10 09:06:33 -07:00
Jason White
674fbb2af5 third-party/rust: Update syscalls 0.6.0 -> 0.6.1
Reviewed By: johnhurt

Differential Revision: D37051530

fbshipit-source-id: e21fc86f98c5f55817ba6f412d7271b3da63d7bb
2022-06-09 18:12:21 -07:00
David Tolnay
3ca948fc77 third-party/rust: Update async-trait from 0.1.52 to 0.1.56
Summary:
Release notes:

- https://github.com/dtolnay/async-trait/releases/tag/0.1.53 (improved error messages)
- https://github.com/dtolnay/async-trait/releases/tag/0.1.54 (`impl Trait` support)
- https://github.com/dtolnay/async-trait/releases/tag/0.1.55 (compatibility with 2021 edition closure capture rules)
- https://github.com/dtolnay/async-trait/releases/tag/0.1.56 (more `impl Trait` work)

Reviewed By: zertosh

Differential Revision: D36881793

fbshipit-source-id: ce9b86693dd18efa6884d29419970b41ebff5447
2022-06-02 17:05:05 -07:00
Jason White
20c7020868 Appease the copyright linter
Summary: The OSS license linter doesn't like the word "its".

Reviewed By: johnhurt

Differential Revision: D36856385

fbshipit-source-id: 909037d96de8976f08004497d28b77838f8c6870
2022-06-02 11:51:06 -07:00
Jason White
d16ca7d7c0 Change Facebook -> Meta Platforms in Cargo.toml files
Reviewed By: johnhurt

Differential Revision: D36727976

fbshipit-source-id: 0449545ee3fb2faf4febcdec0be1d5940af5e937
2022-05-27 10:20:35 -07:00
Jason White
1bbfa8a5a2 Update copyright headers
Reviewed By: johnhurt

Differential Revision: D36727878

fbshipit-source-id: 2529052f6a81fb5a177ccdba51b7e0051577c148
2022-05-27 09:51:26 -07:00
Jason White
011e521c08 third-party/rust: Update syscalls crate 0.5 -> 0.6
Summary:
Changelog:
 * Removed `build.rs` and switched to Rust's inline assembly syntax. This should enable better codegen, including the ability to have syscalls get inlined.
 * **Breaking**: Architectures besides `arm`, `x86`, and `x86-64` now require nightly.
 * **Breaking**: Removed top-level `SYS_` constants. Just use the `Sysno` enum instead.

Reviewed By: johnhurt

Differential Revision: D36606892

fbshipit-source-id: 9d20addfec65fa712b25d9449ec6e414187565ca
2022-05-24 09:29:52 -07:00
Jason White
1e5ed86ae1 Prepare for syscalls crate update
Reviewed By: johnhurt

Differential Revision: D36607034

fbshipit-source-id: f50f6a21ef9c3febf6bb8fcf4a8f0b30514e6e61
2022-05-24 06:43:45 -07:00
Anastasios Andronidis
1aac7d0ad2 Get guest registers
Reviewed By: jasonwhite

Differential Revision: D36315857

fbshipit-source-id: bd00a87fea9b17a28d5afc438d640f2b68bd5975
2022-05-11 09:05:58 -07:00
CodemodService Bot
9899fe55c4 Daily common/rust/cargo_from_buck/bin/autocargo
Reviewed By: Croohand

Differential Revision: D36239957

fbshipit-source-id: 3f4cb4b55927f437e95dfd2d2563fdbafbeb2988
2022-05-09 04:05:21 -07:00
Jason White
f507b56319 third-party/rust: Update syscalls crate to v0.5.0
Summary:
See https://github.com/jasonwhite/syscalls/blob/master/CHANGELOG.md

The biggest change here is that the type of syscall registers and return values was changed from `u64` to `usize` (to support 32-bit architectures).

Reviewed By: zertosh

Differential Revision: D36157822

fbshipit-source-id: d8776b6809dd00df93b147ee34deb37df61a2675
2022-05-05 13:15:19 -07:00
Ryan Newton
05446620a2 minor compiler warning
Summary: Just another simple compiler warning fix.

Reviewed By: jasonwhite

Differential Revision: D35966952

fbshipit-source-id: 9656519ef0e0164cfda98326d0fa9b74e6a3f78d
2022-04-29 08:06:47 -07:00