Commit fcbc80b
remove
Summary:
Currently, the open source build contains this line in a `Cargo.toml` file:
https://github.com/facebook/sapling-staging/blob/c403b32adb27eb0c2d8a6a63261b9bf8942138ca/eden/scm/Cargo.toml#L7
For posterity, the contents of the line are:
```
graphql-parser = { git = "https://github.com/vmagro/graphql-parser", rev = "1d155d96e6052767380ab5e67c57e3d6608a31ac" }
```
The `cargo fetch` calls I am removing in this diff *used to* work. But today when
I ran the workflow that used this `Dockerfile`, they failed with:
```
#13 4.589 error: failed to resolve patches for `https://github.com/rust-lang/crates.io-index`
#13 4.589
#13 4.589 Caused by:
#13 4.589 failed to load source for dependency `graphql-parser`
#13 4.589
#13 4.589 Caused by:
#13 4.589 Unable to update https://github.com/vmagro/graphql-parser?rev=1d155d96e6052767380ab5e67c57e3d6608a31ac
#13 4.589
#13 4.589 Caused by:
#13 4.589 revspec '1d155d96e6052767380ab5e67c57e3d6608a31ac' not found; class=Reference (4); code=NotFound (-3)
#13 ERROR: process "/bin/sh -c cargo fetch --manifest-path eden/scm/exec/hgmain/Cargo.toml" did not complete successfully: exit code: 101
------
> [ 8/17] RUN cargo fetch --manifest-path eden/scm/exec/hgmain/Cargo.toml:
#13 4.589 error: failed to resolve patches for `https://github.com/rust-lang/crates.io-index`
#13 4.589
#13 4.589 Caused by:
#13 4.589 failed to load source for dependency `graphql-parser`
#13 4.589
#13 4.589 Caused by:
#13 4.589 Unable to update https://github.com/vmagro/graphql-parser?rev=1d155d96e6052767380ab5e67c57e3d6608a31ac
#13 4.589
#13 4.589 Caused by:
#13 4.589 revspec '1d155d96e6052767380ab5e67c57e3d6608a31ac' not found; class=Reference (4); code=NotFound (-3)
```
What happened? Here's what it looks like:
- After discovering that our `Cargo.toml` files created by `autocargo` contained massive
`[patch.crates-io]` sections that appeared to be slowing down our open source build,
I went and posted about it in the Source Control Team group:
https://fb.workplace.com/groups/sourcecontrolteam/posts/5310340079087295
- One way to improve the situation is to eliminate these patches from `//third-party/rust`,
so I spot-checked a number of the patches, tracking down the diff that introduced them,
and attempted to follow-up with the author to upstream the patch.
- D37532244 (199330f) appeared to be the diff that pulled in the patch for `graphql-parser`.
In the comments, I pinged the author (vmagro) to see if he could upstream his patch.
- Vinnie agreed and updated his PR: graphql-rust/graphql-parser#66
- *what appears to have happened* is that Vinnie updated the PR by doing a "force push"
where the previous head was `1d155d96e6052767380ab5e67c57e3d6608a31ac` and
the new head is `c778917f57f6b2c26d9291819b9bb341a2f5948a`.
- GitHub...does not like force pushes. Indeed, if you visit
graphql-rust/graphql-parser@1d155d9
you see a yellow warning banner at the top that says
**This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.**
I don't know what call `cargo` makes to resolve these `git` dependencies, but I assume
GitHub is refusing to respond as it normally would for orphaned commits such as these.
D39190591 (f500204) is the for fbsource overall, but based on this experience, I still think it is best
to remove these `cargo fetch` calls. Of note, **even though the `cargo fetch` calls failed,
the GitHub action to build Sapling still succeeds** because Sapling does not depend
on `graphql-parser`, so `cargo build` only builds what it needs whereas `cargo fetch`
fetches everything in the `Cargo.toml` whether it needs it or not.
In sum, given the current state of `autocargo` and the `[patch.crates-io]` section it generates,
`cargo fetch` just seems like a giant liability, so we are better off without it.
Reviewed By: fanzeyi
Differential Revision: D39189595
fbshipit-source-id: cbdf3c51e39b7ed2e49a4373e7f9fc66337766cccargo fetch calls1 parent a47d7c2 commit fcbc80b
1 file changed
+1
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 16 | | |
24 | 17 | | |
25 | 18 | | |
| |||
80 | 73 | | |
81 | 74 | | |
82 | 75 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | 76 | | |
93 | 77 | | |
94 | 78 | | |
| |||
113 | 97 | | |
114 | 98 | | |
115 | 99 | | |
116 | | - | |
| 100 | + | |
117 | 101 | | |
118 | 102 | | |
119 | 103 | | |
| |||
0 commit comments