Commit Graph

58551 Commits

Author SHA1 Message Date
Stefan Filip
cd49247df6 hgext: remove the churn extension
Summary: Not that useful and does not align with the direction we are headed.

Reviewed By: quark-zju

Differential Revision: D22213796

fbshipit-source-id: ffd86fc1a9207c134448836d0e54e48510a11135
2020-06-24 16:11:39 -07:00
Ailin Zhang
dde49c1c44 add a new column FUSE FETCH to eden top to display fetchCounts
Summary:
updated `eden top` to:
- obtain PID-fetchCounts data from the updated -`getAccessCounts` thrift call in the previous diff
- display that data in a new column `FUSE FETCH`

Reviewed By: kmancini

Differential Revision: D22101430

fbshipit-source-id: 6584e71ce3a4629c73469607ca0a4c6ffd63e46f
2020-06-24 15:56:14 -07:00
Kostia Balytskyi
fbf1564559 config: add commit_sync validation to its Convert impl
Summary:
This diff does three things:
- moves existing `CommitSyncConfig` validation from `config.rs` into
  `convert/commit_sync.rs`, so that any user of `impl Convert for
  RawCommitSyncConfig` gets it for free
- adds another thing to validate `CommitSyncConfig` against (large repo is one
  of the small repos)
- adds `RawCommitSyncConfig` validation for something that can be lost when
  looking at `CommitSyncConfig` (no duplicate small repos).

Reviewed By: markbt

Differential Revision: D22211897

fbshipit-source-id: a9820cc8baf427da66ce7dfc943e25eb67e1fd6e
2020-06-24 15:45:59 -07:00
Ailin Zhang
c33f8ba494 add PID-fetchCount map data to the result of getAccessCounts
Summary:
This diff updates `getAccessCounts` to
- obtain the PID-fetchCount map data added in the previous diff
- put that data into its `result`

Reviewed By: kmancini

Differential Revision: D22101232

fbshipit-source-id: 1d41715339d418b03c17f6c93a7a497b432973ae
2020-06-24 15:36:51 -07:00
Stefan Filip
f77fedfd80 python3: fix test-hghave.t
Summary: Binary vs string difference for compression input.

Reviewed By: quark-zju

Differential Revision: D22212333

fbshipit-source-id: ffbaab337ef4f1b4518a508814808ba7cbda690a
2020-06-24 15:31:37 -07:00
Xavier Deguillard
bd26254f79 eden: fix windows build
Summary:
Both optional and pid_t weren't found and the right includes needed to be
provided. On Windows, the ProcessNameCache isn't compiled (yet), and since it
looks like the process name is optional in the BackingStoreLogger, let's not
provide it for now.

Reviewed By: fanzeyi

Differential Revision: D22215581

fbshipit-source-id: 31a7e7be62cd3d14108dc437d3dfabfb9e62f8d5
2020-06-24 15:12:47 -07:00
svcscm
0a151203c0 Updating submodules
Summary:
GitHub commits:

11256f0b16
df45ceb830
a4cfa8c75e
50d6969816

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 626cbdfe1e5d871cbc5ef81bf83c870dabf8fe6d
2020-06-24 14:39:03 -07:00
Durham Goode
81ec0a4138 py3: fix double invocations of commands when spawning sshpeers
Summary:
The sshaskpass extension forks the current process and attempts to do
some tty magic. If there was an exception though, the exception could go up the
stack and trigger the resumption of the pull logic, resulting in pull executing
twice.

The fix is to move the `_silentexception(terminate=True)` context to wrap the
entire child process, so we're guaranteed to exit in all cases.

I also fixed the str-vs-byte issue that caused the original exception.

Reviewed By: xavierd

Differential Revision: D22211476

fbshipit-source-id: 5f5ca6b33b425e517650f9a83cab605a4c9783de
2020-06-24 14:16:36 -07:00
svcscm
1d8151b758 Updating submodules
Summary:
GitHub commits:

bf9d2d931c
295b1db585
6a80873ddb
aeb4ecf8fb
4353384581
e2e050f00c
92b5ace907
efb32d5979
be29934154
dff4e40c5d
bdcceddb12
d8205f4b6e

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: d3c35813006182bf1ad36980a7d5190156b33538
2020-06-24 13:51:31 -07:00
Meyer Jacobs
08533c2b4f Back out "rage: open subprocesses in text mode"
Summary:
Original commit changeset: d91cee7909f4

This change broke hg rage, see T69004770.

Reviewed By: ikostia, xavierd

Differential Revision: D22210509

fbshipit-source-id: 79c68a41d198e770b1077da7365078d5c1653829
2020-06-24 13:16:56 -07:00
Lukas Piatkowski
14f7dd70e4 Re-sync with internal repository 2020-06-24 21:35:50 +02:00
svcscm
38deb2b0a6 Updating submodules
Summary:
GitHub commits:

132b03b682
80ea0dd98d
c98c0d6515
4485ef0c25
797c70ce2a
58f098e37f
83a4dd1a67
c66438f37b
8584c5cec2
12ae21f1fc
d733ca6bfe
f7c9277f97
a456e2aec9
93e4b6ba82

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 557daa08468f47ceb2f60f99fe6642e9a3d7cad5
2020-06-24 12:29:14 -07:00
Jun Wu
b4d3329bef win32text: remove the extension
Summary: The extension was deprecated by the eol extension.

Reviewed By: DurhamG

Differential Revision: D22129826

fbshipit-source-id: 293a57b4039f424154955454e0a7a74dc7d23069
2020-06-24 11:51:27 -07:00
Xavier Deguillard
5aaebd6e2c eden: decode the manifest body before using it
Summary:
The revision is passed down as a 40-bytes ascii string, and therefore it needs
decoding before being usable.

Reviewed By: DurhamG

Differential Revision: D22210203

fbshipit-source-id: b84bca5f89cbe4f267de1281c1a9ed55409174d2
2020-06-24 11:20:35 -07:00
Xavier Deguillard
136463ca75 eden: fix binary stdin/stdout
Summary:
In python3, sys.std{in,out} are opened in text mode, but when actual fds are
passed in, we fdopen them in bytes mode. Since the code expects these to be
bytes, let's fdopen them in bytes mode too.

Reviewed By: DurhamG

Differential Revision: D22196541

fbshipit-source-id: b913267918af1c3bdf819e243a384312a2a27df0
2020-06-24 11:20:35 -07:00
Viet Hung Nguyen
ebd041b0ec mononoke/tests: modified paths to absolute
Summary: When running integration tests we should make the paths absolute, but kept it relative so far. This results it breaking the tests.

Reviewed By: krallin

Differential Revision: D22209498

fbshipit-source-id: 54ca3def84abf313db32aecfac503c7a42ed6576
2020-06-24 11:17:07 -07:00
Chad Austin
24a1dfc13a define an exit code for abandoned transactions
Summary:
So automation can detect abandoned transactions and run `hg recover`,
define an exit code. None of sysexit.h seemed to fit this case, so
start with 90.

Reviewed By: quark-zju

Differential Revision: D22198980

fbshipit-source-id: 5f267a2671c843f350668daaa14de34752244d4b
2020-06-24 10:55:50 -07:00
Shrikrishna Khare
d4f7e156c7 fbcode_builder: getdeps: Update OpenNSA to 6.5.19
Summary: 6.5.19 is now available, switch OSS to pick that instead of old 6.5.17.

Reviewed By: rsunkad

Differential Revision: D22199286

fbshipit-source-id: 231346df8d2f918d2226cfe17b01bde12c18a5a7
2020-06-24 10:51:38 -07:00
svcscm
d0b64777e7 Updating submodules
Summary:
GitHub commits:

0c5ddd8cde
1ac36af79f
3f48ab21b3
d0c01e8758
0c17da58ca
4560da98db
842c0f4a1a
e958a833a6
ed4fe5c108
a0f4da5ab3
6a619ec621
c41ab8ee68
2b2ab6a018

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 071bf217dab0dad6073a0d88bab15d0576a8831a
2020-06-24 10:12:23 -07:00
Thomas Orozco
76606260c2 mononoke/lfs_server: automatically consume HTTP response bodies when dropped
Summary:
If we don't read the body for a response, then Hyper cannot return the
connection to the pool. So, let's do it automatically upon dropping. This will
typically happen when we send a request to upstream then don't read the
response.

I seem to remember this used to work fine at some point, but looking at the
code I think it's actually broken now and we don't reuse upstream connections
if we skip waiting for upstream in a batch request. So, let's fix it once and
for all with a more robust abstraction.

Reviewed By: HarveyHunt

Differential Revision: D22206742

fbshipit-source-id: 2da1c008556e1d964c1cc337d58f06f8d691a916
2020-06-24 10:02:02 -07:00
Thomas Orozco
b60ff4403f mononoke/lfs_server: clean up a bit of spawning code
Summary:
This was old Tokio 0.1 code that needed channels for spawns, but in 0.2 that
actually is built-in to tokio::spawn, so let's use this.

Reviewed By: HarveyHunt

Differential Revision: D22206738

fbshipit-source-id: 8f89ca4f7afc8dd888fe289e8d597148976cc54c
2020-06-24 10:02:01 -07:00
Thomas Orozco
e6d8747347 mononoke/lfs_server: don't require reading data streams to drop them
Summary:
This fixes a bit of a tech debt item in the LFS Server. We've had this
discard_stream functon for a while, which was necessary because if you just
drop the data stream, you get an error on the sending end.

This makes the code more complex than it needs to be, since you need to always
explicitly discard data streams you don't want instead of just dropping them.

This fixes that by letting us support a sender that tolerates the receiver
being closed, and just ignores those errors.

Reviewed By: HarveyHunt

Differential Revision: D22206739

fbshipit-source-id: d209679b20a3724bcd2e082ebd0d2ce10e9ac481
2020-06-24 10:02:01 -07:00
Thomas Orozco
7f48790fb4 mononoke/lfs_server: refactor upload to make it easier to unit test
Summary:
We have a lot of integration tests for LFS, but a handful of unit tests don't
hurt for some simpler changes. Let's make it easier to write those.

Reviewed By: HarveyHunt

Differential Revision: D22206741

fbshipit-source-id: abcb73b35c01f28dd54cc543cd0a746327d3787b
2020-06-24 10:02:01 -07:00
Thomas Orozco
ce7f53422f mononoke/lfs_server: support the client not having the data it wants to send us
Summary:
This diff is probably going to sound weird ... but xavierd and I both think
this is the best approach for where we are right now. Here is why this is
necessary.

Consider the following scenario

- A client creates a LFS object. They upload it to Mononoke LFS, but not
  upstream.
- The client shares this (e.g. with Sandcastle), and includes a LFS pointer.
- The client tries to push this commit

When this happens, the client might not actually have the object locally.
Indeed, the only pieces of data the client is guaranteed to have is
locally-authored data.

Even if the client does have the blob, that's going to be in the hgcache, and
uploading from the hgcache is a bit sketchy (because, well, it's a cache, so
it's not like it's normally guaranteed to just hold data there for us to push
it to the server).

The problem boils down to a mismatch of assumptions between client and server:

- The client assumes that if the data wasn't locally authored, then the server
  must have it, and will never request this piece of data again.
- The server assumes that if the client offers a blob for upload, it can
  request this blob from the client (and the client will send it).

Those assumptions are obviously not compatible, since we can serve
not-locally-authored data from LFS and yet want the client to upload it, either
because it is missing in upstream or locally.

This leaves us with a few options:

- Upload from the hg cache. As noted above, this isn't desirable, because the
  data might not be there to begin with! Populating the cache on demand (from
  the server) just to push data back to the server would be quite messy.
- Skip the upload entirely, either by having the server not request the upload
  if the data is missing, by having the server report that the upload is
  optional, or by having the client not offer LFS blobs it doens't have to the
  server, or finally by having the client simply disobey the server if it
  doesn't have the data the server is asking for.

So, why can we not just skip the upload? The answer is: for the same reason we
upload to upstream to begin with. Consider the following scenario:

- Misconfigured client produces a commit, and upload it to upstream.
- Misconfigured client shares the commit with Sandcastle, and includes a LFS
  pointer.
- Sandcastle wants to push to master, so it goes to check if the blob is
  present in LFS. It isn't (Mononoke LFS checks both upstream and internal, and
  only finds the blob in upstream, so it requests that the client submit the
  blob), but it's also not not locally authored, so we skip the push.
- The client tries to push to Mononoke

This push will fail, because it'll reference LFS data that is not present in
Mononoke (it's only in upstream).

As for how we fix this: the key guarantee made by our proxying mechanism is
that if you write to either LFS server, your data is readable in both (the way
we do this is that if you write to Mononoke LFS, we write it to upstream too,
and if you write to upstream, we can read it from Mononoke LFS too).

What does not matter there is where the data came from. So, when the client
uploads, we simply let it submit a zero-length blob, and if so, we take that to
mean that the client doesn't think it authored data (and thinks we have it), so
we try to figure out where the blob is on the server side.

Reviewed By: xavierd

Differential Revision: D22192005

fbshipit-source-id: bf67e33e2b7114dfa26d356f373b407f2d00dc70
2020-06-24 10:02:01 -07:00
Xavier Deguillard
ecee8f404a remotefilelog: properly decode the meta-flag
Summary:
In Python3, array indexing into a byte string returns a int, not a string.
Let's instead use the struct module to extract a byte string out of it that we
can then decode afterwards.

Reviewed By: DurhamG

Differential Revision: D22097226

fbshipit-source-id: e6b306b4d3bcf2ba08422296603b56fcadbb636e
2020-06-24 09:41:23 -07:00
Xavier Deguillard
c0e458788a tests: fix the progress tests
Summary:
These were broken mostly due a test issue (using bytes instead of str), and a
small difference when printing "units_per_sec", which was an int in python2,
and was computed as a float in python3.

Reviewed By: DurhamG

Differential Revision: D22095813

fbshipit-source-id: 8af8332dad5366d2c168485b120a984ff1ba558a
2020-06-24 09:41:23 -07:00
Lukas Piatkowski
f9eb013d43 mononoke/configerator structs: change the OSS folder where configerator structs are saved
Summary:
Due to Thrift design of "include" statements in fbcode the thrift structures has to be contained in folders that are identical to the folder layout inside fbcode.

This diff changes the folder layout on Cargp.toml files and in fbcode_builder, there will be a next diff that changes this for ShipIt as well.

Reviewed By: ikostia

Differential Revision: D22208707

fbshipit-source-id: 65f9cafed2f0fcc8398a3887dfa622de9e139f68
2020-06-24 09:38:46 -07:00
Xavier Deguillard
31d831bfaf revisionstore: manually set the Content-Length for empty lfs requests
Summary:
We've had a case where a client sent a bundle that contained an LFS pointer to
Sandcastle. On that original repo, the LFS blob and pointer were in the
hgcache, which signified that the server has it. When that bundle gets applied
on Sandcastle, the pointer then makes its way onto the local lfs pointer store
and the blob will be fetched from the LFS server itself properly.

Where it gets tricky is that Sandcastle then tried to re-bundle the change and
thus tried to re-upload it. The expectation from the client perspective is that
since the blob was fetched from the server in the first place, the server will
just not ask for the blob to be re-uploaded. The asumption proved to be
semi-inacurate in the case where the LFS server mirrors all the writes to a
secondary LFS server. When that secondary LFS server is standalone and not
Mononoke, it may not have the blob in question, and thus the LFS server may
request the blob to be re-uploaded so it can write it to the secondary LFS
server.

Unfortunately, things start breaking down at this point. Since the blob isn't
present in the local store the client can't rely on being able to read it and
fetching it from the server to then upload it is silly and a bit too complex.
Instead, what we can do is teach the server of this specific scenario by
manually setting the Content-Length to 0 in the case of an upload where the
blob wasn't found in the local store. The server recognizes this and will
manually copy the blob to the secondary LFS server.

Reviewed By: krallin

Differential Revision: D22192718

fbshipit-source-id: 67c5ba1a751cc07d5d5d51e07703282d8175b010
2020-06-24 09:05:29 -07:00
svcscm
0df9e2c1ab Updating submodules
Summary:
GitHub commits:

2695000702

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: f3396c5e4923fb86dd510bd728476d0f1a2f2bf1
2020-06-24 09:02:29 -07:00
Stanislau Hlebik
3489bb9f4d mononoke: do not sync filenodes if only mode has changed
Summary:
If a commit changes modes (i.e. executable, symlink or regular) of a lot of files but
doesn't change their content then we don't need to put these filenodes to the
generated bundle. Mercurial stores mode in manifest, so changing the mode
doesn't change the filenode.

Reviewed By: ikostia

Differential Revision: D22206736

fbshipit-source-id: f64ee8a34281cd207c92653b927bf9109ccbe1b4
2020-06-24 05:25:44 -07:00
Mark Thomas
8b7392b266 amend: add [FILE]... to the help summary
Summary:
The `amend` command can take a list of files (or file patterns) to limit the
amend to a subset of files.  Make this clear in the help text.

Reviewed By: ikostia, krallin

Differential Revision: D22206906

fbshipit-source-id: 9f26b95a628bb5bbf5eae92c16f8852f44207d25
2020-06-24 05:12:40 -07:00
Thomas Orozco
266607333c hg/mononoke: fix broken test message expectation
Summary:
I landed D22118926 (e288354caf) yesterday expecting those messages at about the same time
xavierd landed D21987918 (4d13ce1bcc), which removed them. This removes them from the
tests.

Reviewed By: StanislavGlebik

Differential Revision: D22204980

fbshipit-source-id: 6b1d696c93a07e942f86cd8df9a8e43037688728
2020-06-24 03:27:55 -07:00
Durham Goode
dab8077917 py3: fix test-command-template-t.py
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22193416

fbshipit-source-id: 8c1a783eb9fe46de1773ec3b8c23465cb0c766b0
2020-06-24 01:43:35 -07:00
svcscm
ce7d7dd8bd Updating submodules
Summary:
GitHub commits:

3b8891d617

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: d90226e90e1c4278d3a99b37726f4b00d04f0cfc
2020-06-24 00:54:18 -07:00
Jun Wu
d59189b0d9 revlogindex: update outdated nodemap more aggressively
Summary:
If the nodemap file is seriously out of sync, it's harder to recover on Windows,
because nodemap mmap in other processes prevents `atomic_write`.

Use `util::path::remove_file` to remove the old mmap files and improve the
success rate of nodemap rewrites.

Reviewed By: xavierd

Differential Revision: D22168134

fbshipit-source-id: 577df978b3175eac3257794f5e5ff7522cf21871
2020-06-23 22:53:36 -07:00
Jun Wu
bc09039a7d util: make remove_file work with mmap on Windows
Summary:
Make it possible to delete files that are mmap-ed. This avoids the extra
complexity of cleaning leftover files.

Reviewed By: xavierd

Differential Revision: D22168135

fbshipit-source-id: edb33a75638c668945feae49608c3fff25e742a4
2020-06-23 22:53:36 -07:00
svcscm
049c2fb06c Updating submodules
Summary:
GitHub commits:

985fa6fa63
7399a9bb40

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: 5d9ec1dad74e7f3d0c11b8fbea6439149ab61e4d
2020-06-23 21:59:51 -07:00
Durham Goode
ddd4801feb py3: fix test-absorb-t.py
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22168764

fbshipit-source-id: 3be5e92419bc53d39a4e8b6c064794aa73fb4d23
2020-06-23 21:47:47 -07:00
Durham Goode
e7d9a53ddf py3: fix test-log-t.py
Summary: It now passes

Reviewed By: quark-zju

Differential Revision: D22168430

fbshipit-source-id: b8da2fecd8553aaf09c373a000296ed8036dc3c1
2020-06-23 21:47:47 -07:00
Meyer Jacobs
307d9dd672 snapshot: python3 compatibility
Summary:
Update snapshot command for python3 compatibility.

This one was a bit weird, and there are some future changes we could make if we care. First, our CBOR implementation doesn't support CBOR strings (utf8 strings), only CBOR bytestrings (just byte sequences). This would be easy to add, but would be binary-incompatible with previous snapshots, if we made no other changes.

We also don't take full advantage of the supported types we already have, ie we encoded version (an integer in Python) as a string, then wrote that string as a CBOR bytestring, which makes the very awkward encodeutf8(str(version)) you see in this change, instead of just plain version, which would work round-trip perfectly fine as far as I can tell, but would break compatibility with existing snapshots.

As is, I made only the most conservatve change, Python2 snapshots should be binary-identical to Python3 snapshots, and they should both be compatible with snapshots made before this change. We could get rid of the vast majority of the conversions by simply adding CBOR string support, which would be a breaking change without special handling.

Reviewed By: quark-zju

Differential Revision: D22195085

fbshipit-source-id: cead42db0c5f84b99e305e5a7f1d839a35becac6
2020-06-23 21:42:33 -07:00
svcscm
db1ce518f2 Updating submodules
Summary:
GitHub commits:

54b1fed515
0b2bef4860
c53a004804
c1e42c0ef6
c78f38626d

Reviewed By: 2d2d2d2d2d

fbshipit-source-id: a39166665009c47e15301005429e589146f8c205
2020-06-23 20:59:30 -07:00
Durham Goode
f0d9d31c16 py3: fix clindex.pyx
Summary: This was breaking pull when caches needed updating.

Reviewed By: quark-zju

Differential Revision: D22196328

fbshipit-source-id: a9e559e9812d4b05ee46ca5ca4562b139318efea
2020-06-23 20:13:47 -07:00
Jun Wu
07a2095908 split: avoid revnum warning
Summary: Use commit hashes instead to avoid the revnum warning.

Reviewed By: singhsrb

Differential Revision: D22200148

fbshipit-source-id: 3049e456a3fff030b6b52762446f01f9d4dfdf17
2020-06-23 19:37:02 -07:00
Meyer Jacobs
6d7250f3ca undo: use integer division, python3 compatibility
Summary:
Move utility function _getoptbwrapper out of Python2-gated block.

Convert undo.py to use integer division in both python2 and python3.

Reviewed By: xavierd

Differential Revision: D22125861

fbshipit-source-id: 9a283065c98eb122c4488285870e026748257b3c
2020-06-23 18:59:21 -07:00
Xavier Deguillard
4d13ce1bcc remotefilelog: remove non Rust store code
Summary:
With the Rust stores being enabled by default in the code, time to actually
remove the code that wasn't using it. A lot of code still remains as the
treemanifest code still uses it. Migrating the treemanifest code to use the
Rust store would allow for even more code to be removed!

Reviewed By: DurhamG

Differential Revision: D21987918

fbshipit-source-id: 8e0becd4a1fb2ac81e26b8517d13e6d06ab06f65
2020-06-23 18:47:44 -07:00
Xavier Deguillard
c074611dee worker: remove the forkers
Summary:
Now that the workers are in Rust, we no longer need the forker version in
Python. For now, the Python LFS extension still uses the threaded worker so
keep this one for now, when that extension will be removed we can remove the
rest of the worker code.

In theory, not all repository would benefit from the Rust workers, but these
are not supported at FB due to not being remotefilelog based.

Reviewed By: DurhamG

Differential Revision: D21987295

fbshipit-source-id: d17b9730651671608cf13f7abe6a9bb32251e140
2020-06-23 18:47:44 -07:00
Xavier Deguillard
dc8c24ab30 remotefilelog: enable the rust stores by default
Summary:
The Rust store code has been enabled everywhere for a few weeks now, let's
enable it by default in the code. Future changes will remove the config as well
as all the code associated with the non Rust store code.

The various tests changes are due to small difference between the Rust code and
the Python one, the biggest one being it's handling of corrupted packfiles. The
old code silently ignored them, while the new one errors out for local
packfiles. The test-lfs-bundle.t difference is just due to an ordering
difference between Python and Rust.

Reviewed By: kulshrax

Differential Revision: D21985744

fbshipit-source-id: 10410560193476bc303a72e7583f84924a6de820
2020-06-23 18:47:44 -07:00
Xavier Deguillard
a4ac0a8449 pyworker: support redacted content
Summary:
Whenever data is redacted on the server, a specific tombstone is returned when
fetching it. Make sure that whenever we update the file on disk, we write a
nice message to the user instead of the tombstone itself.

While this code could have been moved into the Rust store code itself, I prefer
to leave it to its users to decide what to do with redacted data. EdenFS for
instance may want to prevent access to it instead of showing the redacted
message.

Reviewed By: kulshrax

Differential Revision: D21999345

fbshipit-source-id: 39a83cdf5ea4567628a13fbd59520b9677aba749
2020-06-23 18:47:44 -07:00
Zeyi (Rice) Fan
4e7af724fb avoid using Path.resolve on Windows
Summary:
On Windows, `pathlib.Path.resolve` has an use of uninitialized memory bug in Python 3.6.2. Lego Windows has this version of Python 3 installed.

When `eden prefetch` runs, it will first attempt to read the config file at the root of the repository (`$REPOROOT/.eden/config`). Because of this bug, when we normalize the path in edenfsctl, it will get some random bytes as a result. This subsequently causes `toml.read` to fail as it is unable to read a path containing NUL byte.

As you can see, this is the same exception as we see on Windows:

```
In [1]: open("test\x00")
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-1-57764b20d660> in <module>
----> 1 open("test\x00")

ValueError: embedded null byte
```

Reviewed By: xavierd

Differential Revision: D22177997

fbshipit-source-id: ab2565c8946d809bc15bc1597b749fb5e9440ca0
2020-06-23 16:55:13 -07:00
Durham Goode
60dfefda40 configs: remove assert for duplicate dynamic config entries
Summary:
The dynamicconfig logic had an assert checking that a config was not
added by the dynamicconfig twice. This isn't actually a valid assert since the
caller could load the config as many times as it wanted.

This happened in hg doctor, where it loaded the ui once manually (without a repo
object) then it loaded it again during the creation of the repo object. I went
ahead and cleaned up hg doctor to not do this, but let's get rid of the assert
anyway.

Reviewed By: quark-zju

Differential Revision: D22194273

fbshipit-source-id: 9491d35fe14523ad3d9cb69b4ca0d615149dd0f0
2020-06-23 16:05:16 -07:00