Commit Graph

38 Commits

Author SHA1 Message Date
Thomas Orozco
4ca78aae6b mkscratch: allow optionally providing a shorter path using a hash
Summary:
Like it says in the title. Sometimes it's helpful to reuse mkscratch's
configuration to place scratch files in the right place, but the paths it
provides might be too long for some applications.

Reviewed By: quark-zju

Differential Revision: D43390592

fbshipit-source-id: b10246be1552c92c0a184f1d9f7ab3e64654163a
2023-02-18 10:33:30 -08:00
Arun Thulasi
6f3e24f89a Update libc-0.2.137 to libc-0.2.139
Reviewed By: zertosh

Differential Revision: D43203556

fbshipit-source-id: 460f339f603fec97f367967a20a4c6e7a81ad027
2023-02-12 16:30:00 -08:00
Zoltán Nagy
45a06e91eb Upgrade Clap 3 to 3.2.23
Reviewed By: zertosh

Differential Revision: D43186409

fbshipit-source-id: 09583c5f6ff82c5cecf6263355c23c48ba6208f5
2023-02-10 09:18:20 -08:00
David Tolnay
d4b0cd87de Update libc to 0.2.137
Summary: Update from 0.2.135 to 0.2.137, the latest version on crates.io, in preparation for backporting a PR in the diff after this one.

Reviewed By: zertosh

Differential Revision: D40874274

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

Reviewed By: justintrudell

Differential Revision: D40286796

fbshipit-source-id: acfa115479cd289f478d8d73937be34ced5c4bbb
2022-10-13 18:51:18 -07:00
Jason White
562af679e1 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
Muir Manders
eb5c42f887 support detection of ".sl" repos
Summary: Use identity crate to sniff .hg or .sl repo root.

Reviewed By: quark-zju

Differential Revision: D39900482

fbshipit-source-id: a51d62bfc0dbdf95e19a837db3930e8f3eb236cf
2022-10-05 12:20:12 -07:00
Andres Suarez
25bec96f4c update to rust 1.64.0
Summary: https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html

Reviewed By: diliop, dtolnay

Differential Revision: D39825734

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

Differential Revision: D39578353

fbshipit-source-id: 800721931e82485678e8ecf997afcc6711f6d4cf
2022-09-16 20:06:28 -07:00
Brandon LeBlanc
6b440a577c mkscratch: fix output binary name
Summary:
D39190185 (4e09897232) and folloup D39533300 (7bb0415a0a) changed the output name of this binary by accident.

```
error: [Errno 2] No such file or directory: '/home/runner/work/eden/eden/eden/scm/build/cargo-target/release/mkscratch'
```

This corrects that.

Reviewed By: MichaelCuevas

Differential Revision: D39548059

fbshipit-source-id: 3ff140ceccf22eb9ac37bdaad333e28522cf56a3
2022-09-15 11:53:36 -07:00
Michael Cuevas
7bb0415a0a fix make scratch open source build
Reviewed By: demosdemon

Differential Revision: D39533300

fbshipit-source-id: a5e3fe35f5423d5f3c1f9fc83fc173ef128568b0
2022-09-14 23:47:08 -07:00
Michael Cuevas
4e09897232 turn mkscratch into a library
Reviewed By: fanzeyi

Differential Revision: D39190185

fbshipit-source-id: 4f24f7ee1f9b617a68d8de45a1cb1993e2aa670f
2022-09-14 20:50:39 -07:00
Michael Bolin
9b6ccfaccb pin libc crate to 0.2.125
Reviewed By: ImanolBarba

Differential Revision: D39433159

fbshipit-source-id: 4442651a0874ebc6724796206db02c20e455a1c0
2022-09-12 09:55:50 -07:00
Xavier Deguillard
e1b0f766aa mkscratch: migrate to clap 3
Summary:
Clap 3 is the latest version, it had a few breaking changes since Clap 2, let's
migrate to it and fix the handful of places that broke.

Reviewed By: chadaustin

Differential Revision: D39064733

fbshipit-source-id: 107dd995fb7b00a4e922f9475766d1c2a79948e9
2022-08-29 14:00:31 -07:00
Stiopa Koltsov
500536c011 Apply rustfmt
Reviewed By: zertosh

Differential Revision: D38485039

fbshipit-source-id: d94657aa2a49e5606a91a8b28fbe3fa1711e1ac0
2022-08-06 09:10:10 -07:00
Stiopa Koltsov
87f2ed6a5c Apply rustfmt
Reviewed By: zertosh

Differential Revision: D37579616

fbshipit-source-id: 4c28b64adf99a945299d465ab12b536dc9c54dd3
2022-07-01 14:00:19 -07:00
Huapeng Zhou
2d8e387606 rust: update serde_json to 1.0.79 and serde to 1.0.136
Summary:
Needed to import [cloud-hypervisor](https://github.com/cloud-hypervisor/cloud-hypervisor).

(Note: this ignores all push blocking failures!)

Reviewed By: dtolnay

Differential Revision: D34433589

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

(Note: this ignores all push blocking failures!)

Reviewed By: jsgf

Differential Revision: D34432496

fbshipit-source-id: deaa320c74a22e325a116bcc0d5b0120c4f3744b
2022-04-07 04:31:34 -07:00
Huapeng Zhou
f0068c4f42 rust: update libc from 0.2.117 to 0.2.121
Summary: Needed to import cloud-hypervisor https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/Cargo.toml#L25.

Reviewed By: dtolnay

Differential Revision: D35052728

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

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

No need for the checked in generated code anymore

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

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

Reviewed By: chadaustin, mitrandir77

Differential Revision: D33840545

fbshipit-source-id: eafc2a0e2191d438fd828adeebc2e318d319025f
2022-02-09 12:21:32 -08:00
Facebook Community Bot
20a78c4882 Re-sync with internal repository 2022-02-09 18:47:06 +00:00
Jun Wu
2a99866d7b codemod: update license headers
Summary:
The "Portions" license cannot be updated automatically. So this is a manual
update using:

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

Differential Revision: D33420114

fbshipit-source-id: 49ae00a7b62e3b8cc6c5dd839b3c104a75e72a56
2022-01-05 14:43:32 -08:00
David Tolnay
e6c5e4fcc6 Even more 2021 edition Cargo.tomls
Summary: Generated by `rg -g Cargo.toml 'edition = "2018"' -l | xargs sed 's/edition = "2018"/edition = "2021"/' -i`. I guess these are all the handwritten Cargo.tomls. I confirmed that `cargo autocargo` does not revert any of the changed files in this diff.

Reviewed By: aaronabramov

Differential Revision: D31832704

fbshipit-source-id: ac4ea947ae80d25911fa9eedf2951eeead9d5636
2021-10-21 19:39:32 -07:00
Andre Kouznetsov
a4ed5fe9c0 place a README file under scratch directory to describe what it is for
Summary: Many users have asked what scratch directory is when they look to free some disk space. Placing a README.txt under the scratch root could be helpful to explain what is in there.

Reviewed By: fanzeyi

Differential Revision: D27710277

fbshipit-source-id: e3ccd92fa1920ac4c791026b8d98aa05a1c8b268
2021-04-12 15:17:33 -07:00
Mark Mendoza
31282ad8e7 Have scratch set_file_owner on all created parents of created directory
Summary:
When running `sudo mkscratch path /home/markamendoza`, the folder `/data/users/markamendoza/scratch/homeZmarkamendoza` will be created, including all parents that did not already exist.  All these new directories will be created with owner = root.

Anticipating this kind of call, `mkscratch` already goes in and manually modifies the owner of the leaf directory (e.g. `/data/users/markamendoza/scratch/homeZmarkamendoza`), **but will not do so for any of the parent folders it created**.

This is normally not a problem, as long as `/data/users/markamendoza/scratch/` already exists.  If it doesn't then these directories are created with the wrong ownership, which causes problems if we (for example) call `mkscratch` again, without sudo.

This diff remedies this by calling the same `set_file_owner` function (that's already called on the leaf directory) on all parents that were created by `mkscratch`

Reviewed By: chadaustin

Differential Revision: D27378153

fbshipit-source-id: 26c40f4ca478cacf9117093c7b70cbedd679cea6
2021-03-31 11:50:03 -07:00
Zeyi (Rice) Fan
f1bec6dc68 mkscratch: remove old code
Summary: throw-in-trash-delete

Reviewed By: chadaustin

Differential Revision: D26534019

fbshipit-source-id: 59b0050a3851cb80da7cbeccf3940fd13094165f
2021-02-20 15:42:37 -08:00
Zeyi (Rice) Fan
58a9d11260 scratch: validate subdir path in mirror mode
Summary:
This diff ensures no one can exploit mkscratch's scratch directory. In reality probably no one would do this but just to add it as a precaution.

And also the renaming, I didn't land the rename changes in my previous diff and this diff fix that so we don't roll the "nested" mode name out.

Reviewed By: xavierd

Differential Revision: D26526702

fbshipit-source-id: 04ec883e4d1c0c3e9b54b6274e5113c8b4845b3f
2021-02-20 15:42:37 -08:00
Zeyi (Rice) Fan
77cc18b459 scratch: support nested scratch style
Summary:
Address yarn's `node_modules` problem on Winodws.

The design is debatable and probably not the best. Another approach could be simply special casing subdir path ends with `node_modules`. This won't require any user configuration but it would be a special case.

Reviewed By: chadaustin

Differential Revision: D26149393

fbshipit-source-id: b3e66cb2d4b70078bb25e7329988cd5ff8fdeadd
2021-02-01 21:17:14 -08:00
Saurabh Singh
a703572183 fb-scratch: stop building the package
Summary:
`scratch` provided by `fb-scratch` was replaced by `mkscratch` provided by
the Mercurial package. See linked task for details.

Reviewed By: quark-zju

Differential Revision: D23773840

fbshipit-source-id: de0582069ce1a09c3cd9fc6b02d2d149f70d0d78
2020-09-17 18:32:19 -07:00
Zeyi (Rice) Fan
619904bc69 re-implement normalize_windows_path
Summary: This diff fixes the issue that mkscratch does not build on Rust < 1.45.0

Reviewed By: xavierd

Differential Revision: D23325087

fbshipit-source-id: 7e737eb5bc0d75255a84c8ac353bf3a17c269300
2020-08-25 12:38:07 -07:00
Zeyi (Rice) Fan
7f0f310af3 handle extended-length on Windows
Summary:
On Windows, Rust's `std::fs::canonicalize` [1] will generate extended-length path that will include a `\\?\` prefix [2]. This has subsequently cause `encode` to generate a path that contains a question mark, which is an invalid path on Windows.

This diff teaches `encode` to handle extended-length path on Windows. It essentially converts the path back so it no longer contains the prefix.

[1] http://doc.rust-lang.org/1.45.2/std/fs/fn.canonicalize.html
[2] https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#maximum-path-length-limitation

Reviewed By: wez

Differential Revision: D22956659

fbshipit-source-id: 54691e204d7cb481bdb40f62c6520c0f70c3f648
2020-08-24 21:38:12 -07:00
Zeyi (Rice) Fan
8934b0719d fix test on Windows
Summary: The original function is changing behavior on non-UNIX platforms. Let's honor it in tests too.

Reviewed By: wez

Differential Revision: D22901850

fbshipit-source-id: 7c4e7dbfa0526d482f86794758e7ad39feacce10
2020-08-04 10:37:25 -07:00
Xavier Deguillard
ef70d9eb08 scratch: silence warnings
Summary: The compiler was complaining about these on Windows.

Reviewed By: quark-zju

Differential Revision: D20250719

fbshipit-source-id: 89405e155875a4a549b243e93ce63cf3f53b1fab
2020-03-05 09:35:58 -08:00
Jun Wu
245f179697 scratch: drop dependency on telemetry
Summary:
The buck generated binary is 1.2GB in size. Drop dependency to reduce the size.
Dependent functions are re-invented.

New size is 31MB under `mode/opt` build, and 28MB under `mode/dev` build.

Reviewed By: wez

Differential Revision: D18900827

fbshipit-source-id: 536fa969d69f6261d812c2320795780d839b6ced
2019-12-20 16:14:19 -08:00
David Tolnay
d1d8fb939a Switch from failure::Fail trait to std::error::Error for errors
Summary:
This diff replaces eden's dependencies on failure::Error with anyhow::Error.

Failure's error type requires all errors to have an implementation of failure's own failure::Fail trait in order for cause chains and backtraces to work. The necessary methods for this functionality have made their way into the standard library error trait, so modern error libraries build directly on std::error::Error rather than something like failure::Fail. Once we are no longer tied to failure 0.1's Fail trait, different parts of the codebase will be free to use any std::error::Error-based libraries they like while still working nicely together.

Reviewed By: xavierd

Differential Revision: D18576093

fbshipit-source-id: e2d862b659450f2969520d9b74877913fabb2e5d
2019-11-22 08:53:31 -08:00
David Tolnay
b1793a4416 rust: Rename Fallible<T> to Result<T>
Summary:
This diff is preparation for migrating off of failure::Fail / failure::Error for errors in favor of errors that implement std::error::Error. The Fallible terminology is unique to failure and in non-failure code we should be using Result<T>. To minimize the size of the eventual diff that removes failure, this codemod replaces all use of Fallible with Result by:

- In modules that do not use Result<T, E>, we import `failure::Fallible as Result`;
- In modules that use a mix of Result<T, E> and Fallible<T> (only 5) we define `type Result<T, E = failure::Error> = std::result::Result<T, E>` to allow both Result<T> and Result<T, E> to work simultaneously.

Reviewed By: Imxset21

Differential Revision: D18499758

fbshipit-source-id: 9f5a54c47f81fdeedbc6003cef42a1194eee55bf
2019-11-14 14:11:01 -08:00
Adam Simpkins
46890ae1ec Merge fb-mercurial sources into the eden repository
Summary:
Merge the fb-mercurial code into the Eden repository, under the
`eden/scm` subdirectory.

Reviewed By: quark-zju

Differential Revision: D18445774

fbshipit-source-id: fc3307f9937e0c7e1c8f7d03c5102c4fe5dedb10
2019-11-13 20:20:32 -08:00
Adam Simpkins
ab3a7cb21f Move fb-mercurial sources into an eden/scm subdirectory.
Summary:
In preparation for merging fb-mercurial sources to the Eden repository,
move everything from the top-level directory into an `eden/scm`
subdirectory.
2019-11-13 16:04:48 -08:00