Commit graph

302 commits

Author SHA1 Message Date
Chad Austin
e62bf5a185 upgrade nix to 0.26.4
Some checks failed
ci / Check (push) Has been cancelled
ci / Test Suite (push) Has been cancelled
ci / Clippy (push) Has been cancelled
Summary:
I am upgrading nix to 0.29.0. To ensure each step produces clean CI
and is bisectable if something goes wrong, start by going from 0.25 to
0.26.4.

Reviewed By: zertosh

Differential Revision: D66275116

fbshipit-source-id: 63c87ff4f4c631061e5a1c721f52563dc90b7e2b
2024-11-21 18:20:07 -08:00
David Reiss
229c10614d third-party/rust: Update addr2line crate
Some checks failed
ci / Check (push) Has been cancelled
ci / Test Suite (push) Has been cancelled
ci / Clippy (push) Has been cancelled
Summary:
I want a feature in a new version.

Updated some users to handle API changes.

Reviewed By: dtolnay

Differential Revision:
D65797571

Privacy Context Container: L1122763

fbshipit-source-id: 455318b8a33b25eb7f40fce7ea83444d86ac8b33
2024-11-14 16:43:14 -08:00
Cameron Pickett
476ec158d6 Revert D65324129: update platform010 & platform010-aarch64 symlinks
Some checks are pending
ci / Check (push) Waiting to run
ci / Test Suite (push) Waiting to run
ci / Clippy (push) Waiting to run
Differential Revision:
D65324129

Original commit changeset: 8266029f01dc

Original Phabricator Diff: D65324129

fbshipit-source-id: b4f909750fa65b4f549a2d638743896c28e988e4
2024-11-13 16:05:04 -08:00
Cameron Pickett
0bc6f9ad21 update platform010 & platform010-aarch64 symlinks
Summary: Upgrade to 1.82.0 with the minimal set of changes to keep everything building.

Reviewed By: dtolnay

Differential Revision: D65324129

fbshipit-source-id: 8266029f01dcc80dd78c169286b08707f36fc761
2024-11-13 10:42:08 -08:00
Adrian Enache
1bfb484c40 update serde 1.0.203->1.0.214, serde_json 1.0.125->1.0.132
Some checks failed
ci / Check (push) Has been cancelled
ci / Test Suite (push) Has been cancelled
ci / Clippy (push) Has been cancelled
Summary: - fix some cfg for serde_json which changed in the meantime

Reviewed By: dtolnay

Differential Revision: D65182502

fbshipit-source-id: 9234db3ca89334552a0e12ac7e90b59b0bdf2897
2024-10-31 16:04:02 -07:00
Chris Zakian
5c8f734108 Import crates for osstreamer
Some checks are pending
ci / Check (push) Waiting to run
ci / Test Suite (push) Waiting to run
ci / Clippy (push) Waiting to run
Summary: Imports 3P crates needed for os streamer.

Reviewed By: umdemir

Differential Revision: D65103225

fbshipit-source-id: 965a62dca620c67d21dab21e5c86fdadae6df383
2024-10-30 19:20:59 -07:00
Sean Lawlor
ad12ef9ecb Vendor ractor 0.12.4 and upgrade tokio to 1.41.0
Some checks failed
ci / Check (push) Has been cancelled
ci / Test Suite (push) Has been cancelled
ci / Clippy (push) Has been cancelled
Summary:
From release notes:

Ractor v0.12.4 is released!

In this release there are 2 primary changes
1. We're adding the ability to runtime inspect the message type of an untyped `ActorCell` which can be helpful for supervision flows
2. We're also adding helpers for interacting with a supervisor's children (retrieval of the children, stopping them, and draining them) without having to have the supervisor keep additional handles around

Both are in #277

Tokio is being upgraded to add support for `join_all()` in `JoinSet` which `ractor` leverages (easier to upgrade than backport a hack into ractor)

Reviewed By: Imxset21

Differential Revision: D64833735

fbshipit-source-id: 897302bf95467310131348f1ee8c1f766e81f725
2024-10-24 09:02:47 -07:00
generatedunixname89002005287564
a455a6b619 hermetic_infra
Some checks failed
ci / Check (push) Has been cancelled
ci / Test Suite (push) Has been cancelled
ci / Clippy (push) Has been cancelled
Reviewed By: jasonwhite

Differential Revision: D64105413

fbshipit-source-id: 0d3a27a9a3d9deeaa545e42b9e2d96ed307d5c18
2024-10-09 17:24:28 -07:00
James Gill
3bd4cffb7b Upgrade serde_json to 1.0.125
Some checks failed
ci / Check (push) Has been cancelled
ci / Test Suite (push) Has been cancelled
ci / Clippy (push) Has been cancelled
Summary: It has some fixes from the previous 1.0.100

Reviewed By: Imxset21

Differential Revision: D63983796

fbshipit-source-id: 5dc5b48ac515d8901a942d737a1f1f1057060cad
2024-10-07 10:01:13 -07:00
Pierre Chevalier
2afb6babfa Update gitoxide to version with lenient tag parsing
Some checks failed
ci / Check (push) Has been cancelled
ci / Test Suite (push) Has been cancelled
ci / Clippy (push) Has been cancelled
Summary:
ignore-conflict-markers

A while ago, I made the parsing of tags in gitoxide tolerate a missing
timestamp.

We have now seen this situation in two repos:
* aosp/platform/external/brctl
* aosp/platform/external/iproute2

Update all gitoxide crates to their latest version (equivalent to upstream main)
to propagate that fix to us.

I had to list all gitoxide crates explicitely to avoid issues with conflicting requirements
for any crates in the dependency chain.

The commit I'm pointing at in my fork of gitoxide is litterally `main` plus a version update
to propagate the fix throughout the gix ecosystem.

NOTE: I had to slightly edit the integration test to make the failure
representative of the incorrect parsing, but see the updated
integration test for proof that the latest version can parse a tag that's
missing a timestamp.

Reviewed By: RajivTS, singhsrb

Differential Revision: D63771328

fbshipit-source-id: fdbc9d762bacf48c7b17615181371cd92a4a921f
2024-10-03 07:20:59 -07:00
Kevin Vigor
eee9fb2840 add various crates to no_std universe
Some checks failed
ci / Check (push) Has been cancelled
ci / Test Suite (push) Has been cancelled
ci / Clippy (push) Has been cancelled
Summary:
Enable various crates in no_std. These are all used in rivos firmware import
for the MTIA v2 (Olympus) project.

Reviewed By: dreiss

Differential Revision: D62466811

fbshipit-source-id: 7fbc4c9756e6ae17ab46b0e0c3316c1d57d6c840
2024-09-11 17:56:11 -07:00
Neil Mitchell
72fe26f25f Upgrade bitflags
Some checks failed
ci / Check (push) Has been cancelled
ci / Test Suite (push) Has been cancelled
ci / Clippy (push) Has been cancelled
Summary: I need these newer versions in a package I want. Upgrade them so instead of having two copies floating around the repo (one we use, one as a dependency), we only have one.

Reviewed By: zertosh

Differential Revision: D62025056

fbshipit-source-id: 452d440cfa3b22f57f113568774c39fcb2fe2446
2024-08-30 14:28:52 -07:00
Keito Uchiyama
466005db87 Bump anyhow to 1.0.86
Some checks failed
ci / Check (push) Has been cancelled
ci / Test Suite (push) Has been cancelled
ci / Clippy (push) Has been cancelled
Reviewed By: fanzeyi, dtolnay

Differential Revision: D61876827

fbshipit-source-id: 54223a5741114f76152c981ef2bce472970aa8a9
2024-08-27 17:35:14 -07:00
Neil Mitchell
ec8e3594b1 Upgrade to derive_more 1.0.0
Some checks failed
ci / Check (push) Has been cancelled
ci / Test Suite (push) Has been cancelled
ci / Clippy (push) Has been cancelled
Summary: Update to the latest version. See https://fb.workplace.com/groups/rust.language/posts/26766695309619064 for details.

Reviewed By: zertosh, VladimirMakaev, dtolnay

Differential Revision: D61759200

fbshipit-source-id: 2b899a2ed88a2252ff5776d93c771ebaf6876759
2024-08-25 15:57:07 -07:00
David Tolnay
852e08e75d Replace const_cstr!(...) with c"..." CStr literals
Some checks failed
ci / Check (push) Has been cancelled
ci / Test Suite (push) Has been cancelled
ci / Clippy (push) Has been cancelled
Summary: Supported since Rust 1.77: https://blog.rust-lang.org/2024/03/21/Rust-1.77.0.html#c-string-literals

Reviewed By: zertosh

Differential Revision: D59988483

fbshipit-source-id: 756d79612d6d281ce5dbc7973037a5fdb9526f40
2024-07-19 17:56:11 -07:00
David Tolnay
c9c1697a0f Resolve dead_code and unused_variables warnings
Some checks failed
ci / Check (push) Has been cancelled
ci / Test Suite (push) Has been cancelled
ci / Clippy (push) Has been cancelled
Summary:
Rust 1.79's dead code scanner is more precise than previous versions. `pub` is no longer sufficient to hide a data structure field from the lint. It actually looks at whether an unused pub field is reachable from outside the crate.

In the following example, the field `field` is considered dead code by Rust 1.79 and not by 1.78.

```lang=rust
mod module {
    pub struct Struct {
        pub field: i32,
    }

    impl Struct {
        pub fn new() -> Self {
            Struct { field: 0 }
        }
    }
}

pub fn repro() {
    let _ = Struct::new();
}
```

Reviewed By: zertosh, JakobDegen

Differential Revision: D59623034

fbshipit-source-id: 6a4e2fb6e5be410d5127b451704df74ecdd42bf0
2024-07-11 10:11:09 -07:00
David Barsky
12f52a88b3 actually enable valuable on tracing
Some checks failed
ci / Check (push) Has been cancelled
ci / Test Suite (push) Has been cancelled
ci / Clippy (push) Has been cancelled
Summary: I thought `valuable` was enabled; it wasn't. Let's *actually* enable it.

Reviewed By: Wilfred

Differential Revision: D59301882

fbshipit-source-id: 60337d3b69f8babb4cd6f12d044fd2f856539056
2024-07-02 21:05:33 -07:00
Dimitris Iliopoulos
d2480c7e87 upgrade to 0.21.1
Summary:
NOTE: If your `hg bisect` brings you here & the error you are seeing looks like ` expected Result<&PyAny, PyErr>, found Result<Bound<'_, PyAny>, PyErr>` then see these  [migration notes](https://pyo3.rs/v0.21.0/migration.html#from-020-to-021) for the fix or click on `fbcode/security/ace/pyo3/authz.rs` or similar files from bellow to see what the fix is!

In order to upgrade `pyo3` to [`0.21.1`](https://github.com/PyO3/pyo3/releases/tag/v0.21.1), the following had to take place:

## [PyO3]
* Address [migration notes](https://pyo3.rs/v0.21.0/migration.html#from-020-to-021) for `Bound<'py, T>`
* Address [#3595](https://github.com/PyO3/pyo3/pull/3595) - this is done in a crude way for now since there are many call sites depending on `fbcode/dba/rust/common/service_address/py/pyo3_conversion_helper.rs` which would require a more thorough review.
* Address [#3821](https://github.com/PyO3/pyo3/pull/3821) - `pyo3-build-config` is now dependent on and used by PyO3 macros. Currently, the only thing that gets checked is `abi3` compatibility. To address that, we introduce a fixup for that automatically generate `pyo3-build-config*.txt` configuration files, given an `fbsource` Python version. We are tryin to stay as close to `pyo3-build-config*.txt` spec as possible even though only a single bool from that file is ever since there is validation for the other fields but also to future proof future changes. By also generating this file ourselves, we prevent PyO3 from attempting to locate a Python interpreter some other way which seems to start leaking into the PyO3 API as an implementation choice already.

## [PyPi + Rust]
* Upgrade `orjson` to [`3.10.1`](https://github.com/ijl/orjson/releases/tag/3.10.1)
  * Added `README.md` notes for future upgrades
* Upgrade `py-polars` to [`0.20.22`](https://github.com/pola-rs/polars/releases/tag/py-0.20.22)
  * Removed `py-polars` and `polars` from `target_os = "windows"`. The `third-party/pypi/polars` Python extension has only been supported for Mac and Linux for a while now so its only natural to do that on the Rust side as well. What is more, `polars-util` is bringing in `stacker = = "0.1.14"` which does not build on Windows mostly because its using a much more recent version of `libc` than we use in `third-party/rust` (see P1228807344)
* Upgrade `pydantic-core` to [`2.18.2`](https://github.com/pydantic/pydantic-core/releases/tag/v2.18.2)
  *  Removed old `third-party/pypi/pydantic-core` versions
* Upgrade `safetensors` to [`0.4.3`](https://github.com/huggingface/safetensors/releases/tag/v0.4.3)
* Patch `third-party/pypi/cryptography/41.0.7` to account for PyO3's [#2975](https://github.com/PyO3/pyo3/pull/2975) (`0.19.0`) where `pyo3::once_cell` was renamed to `pyo3::sync` (see D56826865)
* Upgrade `tokenizers` and `tokenizers-python` to [`0.19.1`](https://github.com/huggingface/tokenizers/releases/tag/v0.19.1)
  * Removed old `third-party/pypi/tokenizers` versions
  * Fixed `third-party/pypi/tokenizers/BUCK`
  * Migrated `third-party/pypi/tokenizers/0.19.1/BUCK` to mirror other Python packages that bind to Rust crates e.g. `libcst`, `polars` etc.
  * Removed Windows support from `third-party/pypi/tokenizers`

## [Rust]
* Upgrade `indexmap` to [`2.2.6`](https://github.com/indexmap-rs/indexmap/releases/tag/2.2.6)
  * Both latest `pydantic-core` and `c2pa` depend on `serde_json > 1.0.112` which brings in `indexmap = 2.2.1`. The latter has deprecated `.take` and `.remove` on both `IndexMap` and `IndexSet` leading to a bunch of errors (see bellow), all addressed:

```bash
error: use of deprecated method `indexmap::set::IndexSet::<T, S>::take`: `take` disrupts the set order -- use `swap_take` or `shift_take` for explicit behavior.
  --> fbcode/hphp/hack/src/package/types.rs:76:16
   |
76 |         self.0.take(value)
   |                ^^^^
   |
   = note: `-D deprecated` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(deprecated)]`
```

Reviewed By: capickett

Differential Revision: D56671179

fbshipit-source-id: 3ae69c069b7f005570c1a06d37194cf056282a18
2024-05-03 07:58:42 -07:00
Jason White
407899245d Delete experimental code
Summary: This reduces Reverie's maintenance burden going forward. This code isn't used and is in the commit history if it needs to be referenced.

Reviewed By: VladimirMakaev

Differential Revision: D56889383

fbshipit-source-id: 6fe2ca3a945a69a84624f545102283bda0285233
2024-05-03 04:36:51 -07:00
Henry Swanson
374247cc0a Update tokio: 1.36.0 -> 1.37.0
Summary: Followed the wiki page here: https://www.internalfb.com/intern/wiki/Rust/Third_Party_Libraries/Adding_or_Updating_Libraries/

Reviewed By: capickett

Differential Revision: D56484070

fbshipit-source-id: e1ed52d58f7db8ad32ce67b67df2e83a567db123
2024-04-24 09:47:11 -07:00
Shayne Fletcher
ef50616df9 ffi_returns_twice is removed
Summary: forward compat fix: feature ffi_returns_twice is removed in 1.78.0.

Reviewed By: dtolnay

Differential Revision: D56452209

fbshipit-source-id: f5d9f9dbd63c1213ef71d023f08e97a793f9e525
2024-04-23 14:42:40 -07:00
Kevin Hui
d296065b47 Bump SKID_MARGIN_RCBS from 60 to 70
Summary:
For AMD hosts I'm seeing issues with trying to run `mkfs.ext3` at large sizes using Antlir. We can raise it slightly to deal with this issue.

If it becomes too much of a problem for Intel hosts, we can always break out compilation for the two processor types

Reviewed By: jasonwhite

Differential Revision: D56271985

fbshipit-source-id: 1af3a007363a241cfa1c3e12585d6f837b274d19
2024-04-18 12:09:11 -07:00
Astrid Yu
9a1320bb46 third-party/rust: Bump bytes 1.1 -> 1.6.0
Summary:
As it says on the tin. There have been many new features added since the old version. [Staring at the changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md), I don't believe they added breaking changes.

Changes to other libraries:
- *common/rust/folly/iobuf* - the panic message changed so I changed the should_panic rule to match

Reviewed By: diliop

Differential Revision: D55807882

fbshipit-source-id: 8d70a8bae57509fdca82ab18770275111a1f1902
2024-04-05 23:49:22 -07:00
J.T. Conklin
1711463ce3 rust/third-party: update to futures-0.3.30
Summary:
Changelog since last import:

```
# 0.3.30 - 2023-12-24

* Add `{BiLock,SplitStream,SplitSink,ReadHalf,WriteHalf}::is_pair_of` (#2797)
* Fix panic in `FuturesUnordered::clear` (#2809)
* Fix panic in `AsyncBufReadExt::fill_buf` (#2801, #2812)
* Improve support for targets without atomic CAS (#2811)
* Remove build scripts (#2811)

# 0.3.29 - 2023-10-26

* Add `TryStreamExt::try_ready_chunks` (#2757)
* Add `TryStreamExt::{try_all,try_any}` (#2783)
* Add `UnboundedSender::{len,is_empty}` (#2750)
* Fix `Sync` impl of `FuturesUnordered` (#2788)
* Fix infinite loop caused by invalid UTF-8 bytes (#2785)
* Fix build error with -Z minimal-versions (#2761)
```

I'm updating this as I need `TryStreamExt::try_all()` for a Sandcastle Worker change.

Reviewed By: krallin

Differential Revision: D55318002

fbshipit-source-id: 0f64b13570cd1644000c3639bf16c0746266cb8e
2024-03-27 16:23:45 -07:00
Jeremy Fitzhardinge
b5ec95a82c third-party/rust: make tracing and tracing-subscriber available to no-std universe
Summary: They support no-std with a bunch of features turned off.

Reviewed By: dtolnay

Differential Revision: D55333115

fbshipit-source-id: e66ee699cb3bc3e74f6c7b4d9a81e488e9768e40
2024-03-25 21:40:59 -07:00
Stiopa Koltsov
91b8ebf0b6 Upgrade tokio
Summary:
Need to add some third-party, which is pulling newer tokio.

Land upgrade separately for visibility and for easier bisect and revert.

Reviewed By: Imxset21, JakobDegen

Differential Revision: D55030643

fbshipit-source-id: 47b509ce2103d1dd64c66aa250133eb25758a750
2024-03-18 16:57:05 -07:00
Jade Harley
29ce9faab8 Updated timer to add my processor (#31)
Summary:
A quick fix for https://github.com/facebookexperimental/reverie/issues/30. Have not verified timer functionality, but this prevents a crash.

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

Reviewed By: VladimirMakaev

Differential Revision: D54647876

Pulled By: jasonwhite

fbshipit-source-id: e1b1f110e64f5a78589d0b165cb93578efbe3e66
2024-03-07 12:42:52 -08:00
Shayne Fletcher
8298a777ca bitflags: enable feature 'serde'
Summary:
building the "renderdag" package (fbcode/eden/scm/lib/renderdag/Cargo.toml) fails with
```lang=php,counterexample
error[E0277]: the trait bound `InternalBitFlags: Serialize` is not satisfied
   --> /data/users/shaynefletcher/fbsource/fbcode/eden/scm/lib/renderdag/src/render.rs:213:46
```
this diff resolves the issue by enabling the `serde` feature on the bitflags crate

Reviewed By: capickett

Differential Revision: D54067851

fbshipit-source-id: 2f6ababbae0c4667e4896f03a2fb39c973de535c
2024-02-22 09:13:20 -08:00
Dimitris Iliopoulos
4bf3d8d090 Update platform010 & platform010-aarch64 symlinks
Summary:
`1.76.0` release with fixes addressing the following:
* Release notes ([link](https://releases.rs/docs/1.76.0/))
  * Most notable is [#118054](https://github.com/rust-lang/rust/pull/118054/) manifesting as:
```
error: unused implementer of `futures::Future` that must be used
   --> fbcode/mlx/metalearner/housekeeper/housekeeper.rs:213:13
    |
213 |             self.ping_oncall(&oncall, usecases);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: futures do nothing unless you `.await` or poll them
    = note: requested on the command line with `-D unused-must-use`
```
* Changes in `search_index.js` spec for `rustdoc` ([link](https://github.com/rust-lang/rust/pull/118910/files#diff-3ac57789ddcd2856a3b4f0c444f2813315179bdbe55bb945fe64fcb27b53fee5L491))
* Split of `#![feature(exposed_provenance)]` ([link](https://github.com/rust-lang/rust/pull/118487)) from [#95228](https://github.com/rust-lang/rust/issues/95228)
* `buck2` OSS toolchain bump to `nightly-2023-12-11` just before [#11878](https://github.com/rust-lang/rust-clippy/pull/11878) and a bunch of other clippy lint renames.

Reviewed By: dtolnay

Differential Revision: D53776867

fbshipit-source-id: 78db83d8cdd6b0abae2b94ed1075e67b501fcd73
2024-02-20 10:31:00 -08:00
Zixian Cai
d3e069f0bb Add AMD Zen 2 Matisse support (#28)
Summary:
Checked the AMD PPR and confirmed the event encoding

<img width="1182" alt="image" src="https://github.com/facebookexperimental/reverie/assets/2891235/364b15f9-3af9-47a8-a0ac-c2d4cf6981d9">

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

Reviewed By: asm89

Differential Revision: D53796098

Pulled By: jasonwhite

fbshipit-source-id: 9d7e8f29c5b7307819735034decfd2deba60ca3a
2024-02-15 10:30:52 -08:00
Jason White
9f52ff6126 ci: Make clippy less strict (#29)
Summary:
The clippy errors with `clippy::all` aren't too helpful. Plus, with building on nightly, new lints often break CI.

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

Reviewed By: asm89

Differential Revision: D53796464

Pulled By: jasonwhite

fbshipit-source-id: d90323da824a97976c62f46c72aa7c611d31e359
2024-02-15 10:09:51 -08:00
Jason White
17e8f64e94 Fix broken test after toolchain update
Summary: These tests did unaligned reads/writes, which can produce a `SIGABRT` instead of a `SIGSEGV`. Simply align the reads/writes to 8 bytes to fix the tests.

Reviewed By: JakobDegen, dtolnay

Differential Revision: D53597637

fbshipit-source-id: e2ede420b6249223569af6d89d43a47438967ced
2024-02-08 20:02:47 -08:00
Cameron Pickett
06f05e10f4 Rustfix codemod
Summary:
Apply fixes from `./common/rust/tools/rustfix2/scripts/rustfix_codemod`

Then check any remaining lints highlighted and adjust code to correct them.

Reviewed By: zertosh

Differential Revision: D52975050

fbshipit-source-id: b52d4d84557c78110543d250a40173208fca17ca
2024-01-25 07:02:52 -08:00
Pierre Chevalier
b102b3bf49 Add support for Intel Icelake architecture
Reviewed By: jasonwhite

Differential Revision: D52832812

fbshipit-source-id: 6e388a179aea39cfb21197d895fbf5b14a1123b7
2024-01-17 04:35:38 -08:00
Pierre Chevalier
d7d1e7eec6 reverie-syscalls: Fix broken OSS CI
Summary:
My recent diff: D49742979 which upgraded `bitflags` to 2.4 seems to have broken the Open Source CI for a few crates under `hermetic_infra`.

That is because among other changes, `bitflags` 2.x requires the `serde` Cargo feature to `#[derive(Serialize, Deserialize)]` on generated flag types.

See [the release notes](https://github.com/bitflags/bitflags/releases/tag/2.0.0?fbclid=IwAR0BHMz6T_jmIkXaJmkdvc9LdDTW15G5SSU_A-cZvLxof0aGS0BA7Hqnme0)

This change should fix it.

Reviewed By: mitrandir77

Differential Revision: D52801745

fbshipit-source-id: 826c70e5a111ab1a1159cceab6fb40831f355287
2024-01-16 07:37:20 -08:00
Pierre Chevalier
b1516c3941 Update bitflags to 2.4
Summary:
## Motivation

Since the latest compiler update, we are getting `clippy::bad_bit_mask` errors at the callsites of `bitflags!` macros where one of the variant is zero.
[Upstream won't address it in the `1.x` branch](https://github.com/bitflags/bitflags/pull/373) and recommends upgrading to the `2.x` branch.

We are very close to reaching **zero clippy lints** in [Mononoke and other servers](https://fburl.com/code/pd76yn5e), which would feel nice.

## Specific categories of changes (in case it helps with the code review)

The change from `1.x` to `2.x` introduces a number  of backward compatibility breakages which I had to workaround in our codebase.
See [the release notes for 2.0](https://github.com/bitflags/bitflags/releases/tag/2.0.0) for the explanation for the manual fixes I had to perform at each call site.
 ---
**Adding traits to derive:**
```
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
```
> Generated flags types now derive fewer traits. If you need to maintain backwards compatibility, you can derive the following yourself:
 ---
**Replacing read uses of `.bits` with `.bits()`**
> You can now use the .bits() method instead of the old .bits.
> The representation of generated flags types has changed from a struct with the single field bits to a newtype.
 ---
**Replacing raw setting of `.bits` with `.from_bits_retain()`**
Due to the point above, the representation of the type is not exposed anymore. From [the documentation](https://docs.rs/bitflags/latest/bitflags/example_generated/struct.Flags.html#method.from_bits_retain), `from_bits_retain` "convert from a bits value exactly", which matches the old behaviour
 ---
**Replacing the unsafe `from_bits_unchecked` method with `from_bits_retain`**
> The unsafe from_bits_unchecked method is now a safe from_bits_retain method.
 ---
**Extracting some structs outside of the `bitflags!` macro**
Apart from the derives that `bitflags` knows about, such as `serde`, `bitflags` now can't deal with custom derives in macros with the previous syntax. I followed the recommendation from [their documentation](https://docs.rs/bitflags/latest/bitflags/index.html#custom-derives) to declare the `struct` ahead of of the macro call and only declare the `impl` block inside the macro.
 ---
**Changes to test output**
This does not stand out in the release notes, but as of [this upstream PR](https://github.com/bitflags/bitflags/pull/297), the `Debug` output of generated bitflags has changed. This means any tests that rely on this (and of course, there are a few) needed updating.
In particular, the `vespa` tests rely on that output in a non-obvious way. You might have to trust me (and CI) on these ones...

Reviewed By: dtolnay

Differential Revision: D49742979

fbshipit-source-id: c818c37af45f0964e8fdb7ec6173ad66bb982c00
2024-01-16 00:38:02 -08:00
Stiopa Koltsov
d3daaebfe1 format_code_in_doc_comments = true
Summary:
Another attempt to enable the option.

[We agreed](https://fb.workplace.com/groups/rust.language/posts/24184800024475285) we want it everywhere by default.

# Help us, help yourself

If you can help enabling this option, consider running this command ahead of time:

```
hg files . -I 'your_project/**/*.rs' | \
  xargs arc rustfmt --config format_code_in_doc_comments=true
```

Fix the which is not landed yet:

```
hg st --rev .~1 -n -ma -I '**/*.rs' | \
  xargs arc rustfmt --config format_code_in_doc_comments=true
```

Fix the stack of commits: checkout the top commit, and then:
```
# must include changes from D52632478
fbcode/scripts/nga/stack-rustfmt-new
```

# Previous attempt

D42766542

Reviewed By: zertosh, dtolnay

Differential Revision: D52632085

fbshipit-source-id: f45998c76076470d66339eb99f585856d2114999
2024-01-09 22:59:04 -08:00
Stiopa Koltsov
00a4d01ee2 format_code_in_doc_comments = true
Summary: D52632085

Reviewed By: zertosh

Differential Revision: D52640376

fbshipit-source-id: da918401a991b1f15dd84e1e9066cca1457afd28
2024-01-09 16:54:59 -08:00
Andreas Backx
9a92f2f4e9 colored 1.9 -> 2.1.0
Summary: A newer version of colored adds support for true color terminal text coloring. The changelog only indicates "Alter Color interface to return Cow<'static, str>" besides the true color support as a "change" in the changelog and I'm not expecting people to really use this. If they do, I'll see it in Sandcastle?

Reviewed By: dtolnay

Differential Revision: D52391497

fbshipit-source-id: c08fffc171f7d5f9b75f96617aa673867ab45312
2024-01-02 15:28:35 -08:00
Andres Suarez
9ce4ac6e2b Add default crate information
Summary: Adds basic info that every crate should have.

Reviewed By: dtolnay

Differential Revision: D52051107

fbshipit-source-id: 828ac6a752dbb4b419577fca08815014c8b96c42
2023-12-11 15:49:03 -08:00
Jake Bailey
7d08fc8085 Upgrade heapless 0.7.15 -> 0.8.0
Summary: Sync with fw-rust.

Reviewed By: zertosh

Differential Revision: D51963086

fbshipit-source-id: 22021abffef9d8815f98b0c6fc3c9d4e3971331f
2023-12-08 02:19:57 -08:00
David Tolnay
b5d1131efc Update gimli from 0.26.1 to 0.28.1
Summary:
This release includes https://github.com/gimli-rs/addr2line/pull/260 which unblocks supporting Split DWARF in reverie and cadaverdog.

Separately, ayermolo is looking into whether this gimli update fixes an issue with an iOS test that uses lionhead, and uses gimli to dump debuginfo, which is blocking the land of DWARF5.

Reviewed By: jasonwhite

Differential Revision: D51814926

fbshipit-source-id: ae0882432019250060c65792476a0f6e296daffb
2023-12-04 13:20:36 -08:00
David Tolnay
ccaa2e5f1d update platform010 & platform010-aarch64 symlinks
Summary:
Release notes: https://blog.rust-lang.org/2023/10/05/Rust-1.73.0.html

This release is coupled with an update of the `anyhow` and `thiserror` crates because the unstable standard library API for backtraces has changed.

Fbcode changes:

- `feature(default_free_fn)` deleted (D50300881)
- `noop_method_call` lint becomes warn-by-default (D50486032, D50516201)
- stronger `invalid_reference_casting` detection (D50488164)
- `feature(unix_chown)` has been stabilized
- `feature(provide_any)` and `std::provider` deleted
- `clippy::unwrap_or_else_default` renamed to `clippy::unwrap_or_default`
- type inference ambiguities (D51780425)
- `nu-command` build error (D51779062)

Reviewed By: AndreasBackx, shayne-fletcher

Differential Revision: D50294321

fbshipit-source-id: 0fac87f6ba072ad029f9ce41ce94ed813e855b20
2023-12-02 13:52:50 -08:00
Andres Suarez
d22b5fa9de Update autocargo component on FBS:master
Reviewed By: dtolnay

Differential Revision: D51692353

fbshipit-source-id: 44864a348711875983de81758bbe05b46ad4c604
2023-11-29 18:35:29 -08:00
David Tolnay
d744c1f65b Update proc-macro2 to 1.0.70
Summary:
This release includes a fix to `proc_macro2::Ident::new` to report invalid input at the call site using #[track_caller], instead of inside proc-macro2 code.

This affects LLVM staging (which is LLVM 18) because old bindgen (<0.62.0) is incompatible with Clang 16+, manifesting as panicks in `Ident::new`. See {D40685340}.

**Before:**

```
Action failed: fbsource//third-party/rust:loopdev-0.4.0-build-script-run (buildscript)
thread 'main' panicked at '"enum_(unnamed_at_/usr/include/linux/loop_h_21_1)" is not a valid Ident', third-party/rust/vendor/proc-macro2-1.0.69/src/fallback.rs:817:9

Action failed: fbsource//third-party/rust:virt-sys-0.1.0-build-script-run (buildscript)
thread 'main' panicked at '"_virTypedParameter_union_(unnamed_at___/__/__/__/__/__/fbcode/ca3f1b68f56b9220/third-party-buck/platform010/build/libvirt/__include__/include/include/libvirt/libvirt-common_h_206_5)" is not a valid Ident', third-party/rust/vendor/proc-macro2-1.0.69/src/fallback.rs:817:9
```

**After:**

```
Action failed: fbsource//third-party/rust:loopdev-0.4.0-build-script-run (buildscript)
thread 'main' panicked at '"enum_(unnamed_at_/usr/include/linux/loop_h_21_1)" is not a valid Ident', third-party/rust/vendor/bindgen-0.59.2/src/ir/context.rs:878:9

Action failed: fbsource//third-party/rust:virt-sys-0.1.0-build-script-run (buildscript)
thread 'main' panicked at '"_virTypedParameter_union_(unnamed_at___/__/__/__/__/__/fbcode/ca3f1b68f56b9220/third-party-buck/platform010/build/libvirt/__include__/include/include/libvirt/libvirt-common_h_206_5)" is not a valid Ident', third-party/rust/vendor/bindgen-0.59.2/src/ir/context.rs:878:9
```

Of course, that panic still needs to be fixed properly. I will pursue that next. But at least the location of the faulty code is reported correctly.

Reviewed By: zertosh

Differential Revision: D51633230

fbshipit-source-id: db9794ed4ea70f773925bdaf9a11de289d2aa25c
2023-11-28 15:53:02 -08:00
Facebook Community Bot
3db2bda062
Re-sync with internal repository (#26)
The internal and external repositories are out of sync. This Pull Request attempts to brings them back in sync by patching the GitHub repository. Please carefully review this patch. You must disable ShipIt for your project in order to merge this pull request. DO NOT IMPORT this pull request. Instead, merge it directly on GitHub using the MERGE BUTTON. Re-enable ShipIt after merging.
2023-11-22 07:54:51 -08:00
Jason White
b7647f1572 Add support for Intel Sapphire Rapids
Reviewed By: VladimirMakaev

Differential Revision: D51477614

fbshipit-source-id: 244ad482dc4758b410b5262f2c477af9e70b1e05
2023-11-20 13:46:37 -08:00
David Barsky
7be2fd4ca9 clippy: prevent holding a span guard over an .await
Summary:
X-link: https://github.com/facebookresearch/Private-ID/pull/119

We should probably lint against using an `.enter()` guard over `.await` points for the reasons outlined in https://docs.rs/tracing/latest/tracing/struct.Span.html#in-asynchronous-code.

Reviewed By: zertosh

Differential Revision: D50528695

fbshipit-source-id: 82fcc97a83b5d820c8673e6f56794dc47fd4d77f
2023-11-16 07:31:54 -08:00
Andres Suarez
25dd528f72 Update (and unfork) tracing from 0.1.37 to 0.1.40
Summary:
Replaces the various `tracing` forks for [tokio-rs/tracing#2407] with
crates-io releases containing those changes.

[tokio-rs/tracing#2407]: https://github.com/tokio-rs/tracing/pull/2407

Reviewed By: capickett, davidbarsky

Differential Revision: D51266382

fbshipit-source-id: 5ad0b7b9477e5fa450e52c639357fe485e0e89ff
2023-11-13 18:18:35 -08:00
Sebastian Messmer
dd1490f9f3 Update paste to 1.0.14
Summary: This is needed for D50668794, which is updating webauthn-rs

Reviewed By: zertosh

Differential Revision: D50678571

fbshipit-source-id: b7aadd10b7c44377bd04363cf6105c93ecebd302
2023-10-26 00:06:40 -07:00