Commit Graph

89539 Commits

Author SHA1 Message Date
Rajiv Sharma
a0a7a9129d Integration test highlighting failure during git pull with tag in GRit server
Summary:
The negotiation part of the git protocol involves the client specifying its `WANTS` and `HAVES` and the server realizing the set of objects to send to satisfy the client's need. The first version of the server expected only commit Object Ids as part of `WANTS` and as a result it failed straight away in the presence of tags. The current version of the server allows for tag Object Ids as part of `WANTS` but it converts it into commits pointed to by the tag. That works in the cases when the commit pointed to by the tag is part of the packfile being sent by the server.

If the packfile does not include the commit that the tag points to, then we completely omit sending the tag even though the client explicitly requested it. This integration test highlights that we do not support this behavior yet and fail with a fatal in such a case. I will fix this in a follow up diff along with an updated integration test.

Reviewed By: mitrandir77

Differential Revision: D56979846

fbshipit-source-id: 4cff34b4d5ba55a652b91d57ce5ac95a1ca0b162
2024-05-07 03:11:41 -07:00
Rajiv Sharma
cd3d2615b1 Update integration tests to use valid git pull
Summary:
All the integration tests related to `git pull` used it as `git pull https://hostname/repos/git/ro/repo.git`. This doesn't function as a standard pull, i.e. just `git pull`. [This SO post](https://stackoverflow.com/questions/48749715/what-does-git-pull-link-to-remote-do) explains the detailed difference but fundamentally using pull with a remote URL ends up using a default ref spec that works only for branches (i.e. `+refs/heads/*:refs/remotes/origin/*`). This makes us miss out tags from the server.

This diff updates the integration tests to make use of just `git pull` so that we pull all refs (heads and tags).

Reviewed By: mitrandir77

Differential Revision: D56979746

fbshipit-source-id: a309ef656dfb1e179cf342041729a9e5920539e6
2024-05-07 03:11:41 -07:00
Liubov Dmitrieva
6c1dbeeca4 introduce basic types
Summary: introduce basic types that mirrors thrift types

Reviewed By: mitrandir77

Differential Revision: D56932828

fbshipit-source-id: fdc0b2497e40b5fa4343c5b683f846e93ce8c8ca
2024-05-07 03:09:30 -07:00
Mark Juggurnauth-Thomas
3f3ddf85f3 add the option for log to use the committer date instead of the usual date
Summary:
In repositories imported from Git there are two dates: the author date and committer date.  Depending on whether they were imported into Mononoke first (which uses the same style as hg-git), or imported into Sapling directly, these dates are mapped differently.

In the cases where Mononoke did the import, we may want to configure repositories to prefer the committer date, rather than the author date, which is what is used by default.  Add a new config option `log.use-committer-date` which does exactly this.

We also extend the JSON format for `hg log` to include both author date and committer date if they are available.  This means tooling that knows specifically which one it wants can be modified to fetch exactly that.

Reviewed By: quark-zju

Differential Revision: D56941671

fbshipit-source-id: 0d68a333caf06b8b82e08b581f06df6394520992
2024-05-07 00:56:32 -07:00
Kaveh Ahmadi
3ee8be5d7b Add counter for RootTree and ManifestForRoot
Summary:
This diff adds a new private enum to differentiate between the different types of Trees that can be get from backing store.
 All `getTree()`, `getRootTree()`, and `importManifestForRoot()` at some point call `retryGetTree()` or `importTreeManifest()` to get Tree from backing store. This new enum is passed in the params then these two functions will know which type of Tree they are getting from baacking store. We will use it to collect correct metrics.

## Note
This doc explains all the SaplingBackingStore ODS counters/duration after this stack changes: https://docs.google.com/document/d/1o355e8JGvq3fBYFD738Jkx9tPSWzH4bmxcM8YRKMziU/edit?usp=sharing

Reviewed By: kmancini

Differential Revision: D56842474

fbshipit-source-id: 0699e215ba7d488ac2c2b873fb97ca331dc207f2
2024-05-06 16:21:47 -07:00
Shayne Fletcher
352a79c30c eliminate rerun_c dependence on brotli-decompressor
Summary:
the diff eliminates dependencies on brotli-3.3.4 and brotli-decompressor-2.3.5.

the reason is for the avoidance of duplicate symbols that result from combining targets that depend on `fbsoure//third-party/rust:brotli_decompression` (e.g. `rerun_c` via `ureq`) AND `fbsource//third-party/brotli:brotli_decode` (e.g. `fbsource//third-party/apache-arrow:arrow`).

with these changes in place then remove occurrences of the link flag `"/FORCE:MULTIPLE"` introduced by D56797954 and D56821592 to work around this problem.

Reviewed By: jdonald

Differential Revision: D56943460

fbshipit-source-id: b38d69503f6be85a2055a89da2a161d114030c4c
2024-05-06 15:12:46 -07:00
Peter Delevoryas
d7e01e93a4 Import pcics crate
Summary:
- This crate provides a parser for PCI configuration space
- Really useful for writing tools for PCI configuration space that don't just shell-out to `setpci`

Differential Revision: D56983535

fbshipit-source-id: 0407d9e0f856a9b7042f82180f32ee4aedd0436e
2024-05-06 14:44:41 -07:00
Luisa Vasquez Gomez
2c7dcd5dfb commit cloud: Use HgId instead of String for Changeset Ids
Summary: Per markbt suggestion previously on this stack (will update client diffs)

Differential Revision: D56905493

fbshipit-source-id: 9263e5a3863e7207900683ee15017f3830ddaa21
2024-05-06 14:31:53 -07:00
Luisa Vasquez Gomez
9e4a0b3de2 commit cloud: remote bookmarks: delete based on name, not commit
Summary: I skipped this during the update references impl.

Differential Revision: D56903500

fbshipit-source-id: 12e75b993ca6d40ff5c994125b6bf460b23420e4
2024-05-06 14:31:53 -07:00
Michael Cuevas
716c5ebe7a avoid crashing when invalid FilteredObjectIDs are parsed
Summary:
# Context

Genna discovered that passing junk to `eden debug blob` on a FilteredFS repo would cause the Eden daemon to crash. This is because `XCHECK_EQ()` eventually resolves to `XLOG(FATAL, ...)` if the equality check fails[1]. We don't actually want to crash in this case, since a user can pass non-sense to 'eden debug blob' whenever they'd like

# The Fix

We should just throw an invalid argument exception if the ID we get passed in looks like garbage. This causes the thrift call to fail instead of making the daemon crash.

In addition, I moved the `XCHECK()` lower in the function to be an `XDCHECK()` so that we only crash the daemon in debug mode (not production). This is fine, since that check is meant to be hit during development, not in produciton!

Reviewed By: genevievehelsel

Differential Revision: D56846354

fbshipit-source-id: 3623eb05ccff83b4186b7f4e4363fa769df872bd
2024-05-06 11:31:00 -07:00
Zhaolong Zhu
dd020e59bd context: fix the comment of isabsent()
Reviewed By: quark-zju

Differential Revision: D56937709

fbshipit-source-id: cd2be3434d23567a55101abd3c29d7d494dd9947
2024-05-06 10:18:26 -07:00
Chris Dinh
f3e464f0cf Add auto wire tests
Summary: Adds auto wire tests for suffix query

Reviewed By: liubov-dmitrieva

Differential Revision: D56833476

fbshipit-source-id: d40fa141cf4419cd74f62de2286b2e5bf5837764
2024-05-06 10:17:19 -07:00
Open Source Bot
cc76ca40ed Updating submodules
Summary:
GitHub commits:

26d4425779
e22b7cb4d7
d171298a02
eb09127798
2d675054fa
dd8552e9c7
a62bcf653c
885d00ca26
9afd7bd96f
c0b720448a

Reviewed By: jurajh-fb

fbshipit-source-id: 95e706dbb6246f924535eff1bc53194ef69d5cdb
2024-05-06 09:35:41 -07:00
Evan Krause
202490db3c Bump test timeout in CI
Summary: increase the timeout for jest tests in CI. We previously increased the `waitFor` timeout, but we shoudl also bump the general test timeout too.

Reviewed By: quark-zju

Differential Revision: D56954680

fbshipit-source-id: 65145914071d4452f0487e486e593ebf13f75aff
2024-05-06 09:35:01 -07:00
Saul Gutierrez
33b8c64e63 revsets: search Git diffs locally if phrevset.graphqlonly is set to False
Summary:
Even with the changes from D56443510 it's not enough to make Sapling look for
local Git commits in case there is a newer Phabricator version. Sapling commits
do not have this issue since they are backed up by commitcloud, so those usually
get autopulled if Phabricator's version is more recent than the local one.

This diffs changes that for Git repos, showing a warning telling users to use `jf get` to get the latest version since that error message should be more useful for them.

Reviewed By: muirdm

Differential Revision: D56447240

fbshipit-source-id: 54025ac7f330c629b3b804a3b9dc1a3013e29d83
2024-05-06 05:36:50 -07:00
Saul Gutierrez
65680619ef revsets: make Phabricator revsets work for the most part again for Git repos
Summary:
Some time ago Phabricator revsets were usable on Git repos, but seems like
recently something broke and it's not possible to use them for finding
local commits anymore, which this diff fixes. Additionally, this diff
makes it possible again to find public commits by Phabricator revsets,
which seems to have been broken for a much longer time.

There are two root causes for these issues:
- `remotefilelog.reponame` has the name of Git repos as `reponame` instead
of `reponame.git`, which in turn causes `sl` to error out with issues like
`abort: D123 is for repo foo/bar/baz.git', not this repo ('baz')`
(fixed in D56444313)
- The logic for resolving Git revisions from Phabricator was written 10 years
ago, and depends on using sshpeer which is not really supported anymore: D1458491

Reviewed By: muirdm

Differential Revision: D56443510

fbshipit-source-id: 14e176cac5de1216b1e170d0863d7b7c6382df59
2024-05-06 05:36:50 -07:00
Saul Gutierrez
71860e5cea revsets: better match Git repo names
Summary: Git repo names are not being properly compared with JSON results from Phabricator, causing various issues as explained in D56443510, which this diff fixes. This is however not enough for making Phabricator revsets work again, but that is done in D56443510

Reviewed By: muirdm

Differential Revision: D56444313

fbshipit-source-id: c646de21bfa5c6d0813f5d66977aa90f9f799908
2024-05-06 05:36:50 -07:00
Saul Gutierrez
c972eb859f config: try to better determine Git repo names
Reviewed By: muirdm

Differential Revision: D56655576

fbshipit-source-id: fb1d3295389061adbce8a5a3ff69574914f8dce7
2024-05-06 05:36:50 -07:00
Saul Gutierrez
2409cca46b tests: enable modernclient by default on debugruntest .t tests
Summary:
This makes most of our existing tests have the equivalent configs and files in the repo that adding `$ configure modernclient`. There are a few reasons for doing this:
1. This makes eventually migrating tests to be compatible with EdenFS considerably easier, especially if they don't have `configure modernclient` in them
2. This reduces overhead for creating new tests and makes it easier for test writers to use the recommended setup
3. This opens the path for doing arbitrary actions for setting up a test. Before this diff the best we could do was editing configs in `default_hgrc.py`, but this already does some file manipulation for all tests.
4. This allows modernizing only debugruntest tests, since Mononoke tests aren't really compatible with it right now and just enabling more modern files breaks a number of those tests. Also, the option for using more modern configs in our own test without breaking the Mononoke ones possible.

Reviewed By: muirdm

Differential Revision: D56766291

fbshipit-source-id: dfa4a34e9dcb2784610d77cfeaa629bb6dea492d
2024-05-06 05:31:55 -07:00
Open Source Bot
5cd4d589dd Updating submodules
Summary:
GitHub commits:

ea32c6fc43
12982bde21
00b4d3230d
df1b77cfce
cb160be632
a02ffa9522
f7d8d12c59
e02c93e670
906c4e890d

Reviewed By: jurajh-fb

fbshipit-source-id: 6d6fbf703080f53e727a8f988b1abe012da2dbe8
2024-05-05 09:33:25 -07:00
Open Source Bot
dbe657b51a Updating submodules
Summary:
GitHub commits:

2c1bcde2d4
1c51d35021
83ad0611d7
9f125c94e1
2517f47ae7
cb3a567fa1
b399400876
78dbdc21c7
55d4fd0441
eda275a0f3

Reviewed By: jurajh-fb

fbshipit-source-id: 007dbf88fdd05dcb2dfa45b1a2df849162e0784e
2024-05-04 09:34:15 -07:00
Kaveh Ahmadi
34ebf73eeb print blank for fetched source in start and queue events
Summary:
Now, the `SaplingBackingStore` know the source of each request. However, the sourced is available only for the finish event. The start and queue event doesn't know the source. In the last diff we used UNKNOW for these events. This diff changed the FetchedSource to a std::optional. Therefore for these events we don't need to populate it.
On the other hand, eden.thrift has a NOT_AVAILABLE_YET option. It chooses this option when the std::option doesn't have value.
The kFetchedSource map also update then if we have NOT_AVAILABLE_YET as the fetchedSource, it will give us a blank space character " " and the trace hg will print blank space char for start and queue events.

Reviewed By: kmancini

Differential Revision: D56942308

fbshipit-source-id: 732d5b4fd11cd2e9c5b8ff8e6dc1ec70bc262033
2024-05-03 18:29:19 -07:00
Evan Krause
4bd225fad8 Fix integration tests
Summary:
Revive integration tests. These had broken from a bunch of changes along the way

- fix jest config to match normal jest tests and transforms and version upgrades
- make sure tests don't import from `isl/src`
- use explitily `refresh()` to make it less flakey
- wrap cleanup in `act()` to remove warnings
- bump timeouts
- make logging output be annotated with the source: `[server]`, `[client]`, `[test]` (for messages during test or in test infra), `[c -> s]` and `[c <- s]` (for RPC messages)
- add README to explain how to write integration tests

TODO in another diff: get this working on CI

Reviewed By: zzl0

Differential Revision: D56916269

fbshipit-source-id: 4b2c997a26fb2476ae996859f7205205b769cc1f
2024-05-03 15:07:08 -07:00
Evan Krause
91f52a835d Fix typo and imports
Summary: Minor fixes I noticed

Reviewed By: zzl0

Differential Revision: D56916268

fbshipit-source-id: e25b530a898427b47ef6223128d674a33f4758ca
2024-05-03 15:07:08 -07:00
Evan Krause
54e9ff9830 Recheck merge conflicts when pressing refresh button
Summary: If you click refresh, it should refresh as much data as possible. Somehow that wasn't already including merge conflicts. Make sure clicking refresh rechecks the conflict state. Most of the time, this does the cheap `.sl/merge` file check and doesn't requiring the full `sl resolve --tool internal:dumpjson`.

Reviewed By: zzl0

Differential Revision: D56916270

fbshipit-source-id: b34a472e587873b51b22044b1d0e83489c512c93
2024-05-03 15:07:08 -07:00
Youssef Ibrahim
19926f39a6 derivation_queue: wait for zelos watch when encountering an empty ready queue
Summary:
When dequeuing items from the zelos derivation queue, first we query zelos for all nodes in the ready directory, and if the ready directory is empty, we will end up sleeping for 10 ms (current value of "scm/mononoke:derivation_worker_sleep_duration_ms") and then querying zelos again. For most repos this is excessive and puts a large load on zelos unnecessarily.
This diff instead makes use of Zelos' ability to set watches, by setting a watch on the ready queue when it's empty, and only querying zelos again when the watch returns a notification.

Differential Revision: D56939625

fbshipit-source-id: 6ac6c420b63c793ffd7b94d195f77173c4020a13
2024-05-03 14:51:58 -07:00
Gustavo Galvao Avena
be63c56e6b Store submodule dependencies in LargeToSmall direction
Summary:
We'll be needing it soon to support backsyncing and I'm working on fixing a bug that's partly caused by the fact that `CommitSyncRepos::new` takes submodule deps but drops it silently when creating `LargeToSmall`.

The call to `get_submodule_deps` then always returns `NotNeeded`.

This is the case because when I initially implemented this, we were under the assumption that we would only be supporting forward syncing.

Reviewed By: mitrandir77

Differential Revision: D56881703

fbshipit-source-id: bb90fbc39b25d4fadc5342dafa35c02f93b25bd0
2024-05-03 14:51:13 -07:00
Gustavo Galvao Avena
b17c1dd182 Small CommitSyncRepos refactoring
Summary:
Small refactoring to simplify the logic in `CommitSyncRepos::new` and also reuse code later.
Also simplified an if-else block in commit_syncer

Reviewed By: mitrandir77

Differential Revision: D56826691

fbshipit-source-id: 5c24538d5c1bc5079d6cd0e88113afb11077e600
2024-05-03 14:51:13 -07:00
Gustavo Galvao Avena
909c27f37a Debug functions and formatting
Summary:
Just implementing debug for some data types so I can use `dbg!` with these.
Also small formatting changes

Reviewed By: mitrandir77

Differential Revision: D56826269

fbshipit-source-id: 3c6cc44bda6fa3f59a5d441d6bb61a5edeb2b046
2024-05-03 14:51:13 -07:00
Gustavo Galvao Avena
2c039d8eaa Automatically derive all data types during initial import
Summary:
In D56706360 I started automatically deriving fsnodes, because to expand submodules from a commit, you need the fsnodes from its parents.

But in the merge process, we currently manually backfill derived data after running the initial import.
I don't think this makes much sense, so let's automatically derive everything by default.

One note though: I don't want derivation to block the import's progress, so I'm spawning a tokio task for all the types except fsnodes.

Differential Revision: D56877240

fbshipit-source-id: c0da1998a8b73c75c88c9bc0cd08f7c3730ca3f4
2024-05-03 14:51:13 -07:00
Gustavo Galvao Avena
543c0e8072 Rename target_repo to large_repo in forward syncer
Summary:
I'll try to make these small changes as I work on the codebase.
Forward syncer always uses small repo as source and large repo as target, so naming them properly will make its code easier to understand.

Differential Revision: D56817782

fbshipit-source-id: 9e0cba01755e2b08d1c2b3875711258ba41f63c1
2024-05-03 14:51:13 -07:00
Chris Dinh
8acb3b8b6c Implement suffix querying
Summary:
This Diff implements the EdenAPI Suffix Query handler.

The handler extracts the changeset from the eden context and uses it to call find_files_with_bssmv3.

The output of that function is a stream of MPaths. These are transformed into SuffixQueryResponses and returned in and async stream.

This Diff also implements several traits for CommitID to help in the functionality of above.

Reviewed By: markbt

Differential Revision: D56433194

fbshipit-source-id: 28085e6c345cb33bfa33f9cef9c9ed5708d483dd
2024-05-03 14:28:19 -07:00
Chris Dinh
16b877be6b Add stub handler for Suffix query
Summary: This Diff implements a stub handler for handling suffix queries on  EdenAPI. The stub handler only returns a static message. It will be implemented in a followup diff

Reviewed By: liubov-dmitrieva

Differential Revision: D56275449

fbshipit-source-id: 3234d7d1fe48744bde3e0c4c7eead75cbd482075
2024-05-03 14:28:19 -07:00
Chris Dinh
36b74fcb5b EdenAPI suffix Query client
Summary:
This PR implements the client and py bindings for EdenAPI suffix queries.

The endpoint will be at /suffix_query

Return types are currently placeholder. They will be updated once the handler is set up

Reviewed By: liubov-dmitrieva

Differential Revision: D56275448

fbshipit-source-id: 68b0dfb9ba6ba4893a95c37b2f13d11ded9ecb34
2024-05-03 14:28:19 -07:00
Chris Dinh
d13fd4a87f EdenAPI suffix query types
Summary:
This diff impelemnts the type skeletons that will be used for making suffix queries to EdenAPI.

SuffixQueryRequest should be close to what the final version will look like, but SuffixQueryResponse should change when the handler is actually hooked up to the BSSM querier

Reviewed By: liubov-dmitrieva

Differential Revision: D56219419

fbshipit-source-id: 0d6cc11b0932c32bdfa7f4d1e647cadcaccc4ec0
2024-05-03 14:28:19 -07:00
Saul Gutierrez
ee6450b63d tests: mark tests incompatible with modernclient as such
Summary: This is done in preparation for D56766291

Reviewed By: muirdm

Differential Revision: D56828983

fbshipit-source-id: 182004749ea74b422440c221b8601c5903ad03b1
2024-05-03 13:46:57 -07:00
Muir Manders
f7512e11b9 config: fix unix_socket_path input to dynamic config generation
Summary:
D56592499 accidentially changed the order of things so load_dynamic never got a auth_proxy.unix_socket_path (since `self` is now empty).

Fix by generating and inserting the dynamic config later. This way, auth_proxy.unix_socket_path can be configured anywhere (except for the dynamic config).

Reviewed By: quark-zju, sggutier

Differential Revision: D56942632

fbshipit-source-id: c98e616993b03374667702552d3c07be00ffdb95
2024-05-03 13:38:35 -07:00
Youssef Ibrahim
63c7b55c57 derivation_queue: return an error when ready directory is missing and simplify error handling
Summary: All the directories needed by the zelos derivation queue are setup when constructing the queue, so if the ready directory is missing that should be propagated as an error not just a warning.

Differential Revision: D56939624

fbshipit-source-id: 9aa6ba6541ce121ff1b12ae1071cfd762dfaed32
2024-05-03 13:29:08 -07:00
Saul Gutierrez
630551a610 util: use env vars instead of Rust crates for determining host and usernames
Summary: Using `whoami::devicename` causes issues on macOS sometimes, plus it gives us funny looking hostnames on POSIX in general, so let's drop it. Using environment variables to getting this value as well as getting the username is probably fine, so let's do that instead.

Reviewed By: mitrandir77

Differential Revision: D56724499

fbshipit-source-id: b36a08a48121cecfdb34ed33f68422d687b0346d
2024-05-03 12:30:33 -07:00
Evan Krause
904bf3b2c3 Make bookmarks longer before truncating
Summary: Don't truncate bookmarks as aggressively, it makes them hard to read

Reviewed By: jakebolam

Differential Revision: D56943465

fbshipit-source-id: e849ba75c0b1d614cf3c063f5238ee613d41715b
2024-05-03 11:26:14 -07:00
Mark Juggurnauth-Thomas
6a641ff5d8 readme: remove datestamp
Reviewed By: YousefSalama

Differential Revision: D56937652

fbshipit-source-id: d41018d6b8641b0052a76a3edfa15492ff4b924a
2024-05-03 10:18:56 -07:00
Genevieve (Genna) Helsel
011e8dc1c9 avoid calling getStats() in some ObjectCache fb303 callbacks
Summary: The current state of this code causes an infinite loop if trying to use `getStats` for the `eden stats` cli in D56453268. This diff introduces a specific helper function to extract these singular values. Also, we don't need to collect the whole of the `Stats` objects anyways to feed these two dynamic counters anyways.

Reviewed By: kmancini

Differential Revision: D56728227

fbshipit-source-id: 22523f97a6864464beed875e82fef1d99348fe2a
2024-05-03 10:14:40 -07:00
Open Source Bot
1b1009edcd Updating submodules
Summary:
GitHub commits:

07ff0c002e
4c51b34c59
6b8beae2d5
fb093bbba1
b6994f752d
3e3f7b0658
ece2f40efd
a401921af3
34c65f079e
3f47adf7d0

Reviewed By: jurajh-fb

fbshipit-source-id: 31030e8a1d74820e97b90695931a471631be5138
2024-05-03 09:32:18 -07:00
Alex Hornby
463349ff8e fix windows build with --free-up-disk
Summary:
getdeps can generate a windows wrapper script that can be used to run build artifacts from build directory.

In github actions for large projects we set a getdeps option delete the build dir as soon as we've successfully installed artefacts to save disk space. This option was enabled for windows in D56165825.   Turns out that didn't work, this diff adds the missing conditional so that it should.

Reviewed By: vitaut

Differential Revision: D56930778

fbshipit-source-id: 0cb9ac94ef9b39f4e33af8fb91098dc0d833731b
2024-05-03 09:30:36 -07:00
Dimitris Iliopoulos
6f87dad8d5 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
Pierre Chevalier
ab34ffcd59 memory: Remove failing unit test
Summary:
This test was added a few days ago in D56701219 and has been failing ever since.

In [the sandcastle logs](https://www.internalfb.com/sandcastle/workflow/1265511495293864711/actions) for oss-mononoke-linux-getdeps, we can see:
```
failures:

---- test::test_get_stats_no_max_set stdout ----
thread 'test::test_get_stats_no_max_set' panicked at common/memory/src/lib.rs:63:9:
assertion failed: stats.is_err()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    test::test_get_stats_no_max_set

test result: FAILED. 2 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

```

Reviewed By: gustavoavena

Differential Revision: D56830459

fbshipit-source-id: 62145b8d3972d8c1b3263fb31e3559390d1f58ba
2024-05-03 06:21:02 -07:00
Pierre Chevalier
c9d1f9e32d gitimport: Make bookmark generation >10x faster for already imported tags
Summary:
I noticed when re-importing `whatsapp/voip` (which has ~2k tags) that even though most tags were already imported,
it took multiple seconds to iterate over each one with `generate-bookmark`.

Looking at the code, we used to upload the git tag objects every time, even if the tag
already existed.
That's at least two blobstore puts, which explains the  delay.

After this change, the speed is closer to ~5-10 tags per second, as expected.

We could still optimize further by parallelizing the bookmark generation, but this diff
only fixes an obvious pessimization.

Reviewed By: YousefSalama

Differential Revision: D54684266

fbshipit-source-id: 5cddcbc7164a84f81fba184e0d83f6226d41a035
2024-05-03 06:07:42 -07:00
Pierre Chevalier
93c70b5b6f Fix typo in defer_to_backsyncer_for_backsync jk
Reviewed By: lmvasquezg

Differential Revision: D56898620

fbshipit-source-id: dda2e97752cb81d253aa912dc29fcdf547b811fb
2024-05-03 03:49:42 -07:00
Carlos Fernandez
939df858fd Back out "Back out "Eden rm: When killing processes, try all of them don't abort on first faillure. And use new handler.exe output parser.""
Summary:
The diff that was reverted broke one the tests. I believe CI didn't catch it because it was disabled.

Anyway this diff undoes that backout but of course fixes the test.

Reviewed By: kmancini

Differential Revision: D56884252

fbshipit-source-id: 9a54c2305a3d85793b2c673865528541d8cac43e
2024-05-02 18:59:00 -07:00
Carlos Fernandez
3248bf896f Back out "Back out "eden rm: Stop adb server / buck2""
Summary: Undo backout (this diff wasn't the one that introduced the regression)

Reviewed By: kmancini

Differential Revision: D56883957

fbshipit-source-id: 034eead51816bf5ca6ee97fecb15fdd40e8c1fb8
2024-05-02 18:59:00 -07:00