1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-05 19:55:47 +03:00

53 Commits

Author SHA1 Message Date
Jacob Bower
8c1e7cfbc2 Add manifest for Meta Python 3.12
Summary:
This will be used to support the OSS build of CinderX with getdeps.py in upcoming diffs.

To make this work I had to teach getdeps.py how to pass `--external-branch` to `codesync`.

Reviewed By: alexmalyshev

Differential Revision: D79286425

fbshipit-source-id: f4b1066f8736fdb407f5bd75d3e2cc47b9e7d592
2025-08-01 01:53:45 -07:00
Alex Hornby
064520b155 getdeps: log more on windows runs
Reviewed By: WallyYang

Differential Revision: D77890305

fbshipit-source-id: 86ecbe6e044ec3846ed895a6711c960259bfc362
2025-07-07 15:40:05 -07:00
Paul Cruz
6bb525691b Add retries to ArchiveFetcher
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/1227

Add retries to ArchiveFetcher when downloading fails. There will be 4 retries, with backoff and jitter. The max delay is capped at 10 seconds.

Reviewed By: srikrishnagopu

Differential Revision: D71167342

fbshipit-source-id: d927a639cf99185c5a04d063400bdab874dfddfe
2025-03-14 12:10:44 -07:00
Alex Hornby
ebb3bbc12d skip unnecessary github actions steps
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/1100

Update generated github actions to only run the fetch and and build steps when there are sources expected for a manifest

For local github actions testing using `act` this speeds up the test runs, and in real github CI it makes it clearer which steps are actually doing something on the given runner (we don't know exactly what it has installed beforehand)

Also set the windows git config the same as on internal CI

Reviewed By: bigfootjon

Differential Revision: D67839708

fbshipit-source-id: 0a60c6fc89e8c6abb2464f879459aa23d5aec969
2025-01-06 11:16:30 -08:00
Alex Hornby
994b741e06 reduce shipit fetcher update logs (#1081)
Summary: Pull Request resolved: https://github.com/facebookincubator/zstrong/pull/1081

Reviewed By: bigfootjon

Differential Revision: D66702321

fbshipit-source-id: 6b16249fb48357a452d82067fb6a468b5d10bc13
2024-12-03 18:01:58 -08:00
Alex Hornby
f17a743337 fetch dependencies in parallel on sandcastle
Reviewed By: bigfootjon

Differential Revision: D66661978

fbshipit-source-id: 8ba5906b4e1e9273b3df834e3c50d984a987ba1c
2024-12-03 00:25:33 -08:00
Alex Hornby
ee3c033775 getdeps: stop error with build --clean and --src-dir=.
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/1026

fix the error shown with build --clean and --src-dir=.

Reviewed By: jdelliot

Differential Revision: D64985193

fbshipit-source-id: f933adb45a7385b13965b89e421b4f9284cf0ecb
2024-10-27 04:42:48 -07:00
Simon Marlow
75ca7ab807 Subprojects support
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/857

Where one project should be checked out in a subdirectory of another
project. Like git submodules.

This is how the Glean build currently works: hsthrift is a separate
git repo, but Glean builds with hsthrift checked out in a
subdirectory.

Reviewed By: chadaustin

Differential Revision: D58055066

fbshipit-source-id: 1a22abaa8c5261c40b752d685a03d01625215b12
2024-06-03 16:10:36 -07:00
Simon Marlow
a9cca47023 Use codesync from fbcode if /var/www is not available (#855)
Summary: Pull Request resolved: https://github.com/facebookincubator/zstrong/pull/855

Reviewed By: chadaustin

Differential Revision: D58055452

fbshipit-source-id: a58817e6e81db73462947f8dc286eaacb7e18c54
2024-06-03 16:10:36 -07:00
Simon Marlow
f57c1ad880 Fix --use-shipit
Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/852

It was using the old PHP shipit script

Reviewed By: chadaustin

Differential Revision: D58013009

fbshipit-source-id: 97f0c31b897c04217ca5dd62fbe6cc2a55d280c8
2024-06-01 19:18:00 -07:00
Cody Ohlsen
220ffee5db getdeps: support GETDEPS_WGET_ARGS in wget version, support skipping lfs/upload steps
Summary:
X-link: https://github.com/facebookincubator/katran/pull/229

X-link: https://github.com/facebookexperimental/edencommon/pull/18

X-link: https://github.com/facebook/sapling/pull/878

X-link: https://github.com/facebook/openr/pull/154

X-link: https://github.com/facebook/folly/pull/2177

X-link: https://github.com/facebookincubator/zstrong/pull/748

I found it useful to be able to set `GETDEPS_WGET_ARGS` to change some of the flags to `wget` while it's in that fetch mode :)
I also need to skip the lfs upload part in my environment

Reviewed By: mackorone

Differential Revision: D56263907

fbshipit-source-id: ae45c31ebb10123e0358544d294fe2f2979dd59a
2024-04-17 17:24:31 -07:00
Conner Nilsen
cf2e8bc5d4 Pyre Configurationless migration for] [batch:88/244] (#723)
Summary: Pull Request resolved: https://github.com/facebookincubator/zstrong/pull/723

Reviewed By: grievejia

Differential Revision: D54471437

fbshipit-source-id: bc644553e31464ceb632034e4ce3f05ba30fbbcd
2024-03-04 18:15:44 -08:00
Siva Muthusamy
dcb2f57204 Use wget in getdeps to download source code
Summary:
Neither the default "urlretrieve" nor "pycurl" works fine for all of FBOSS'
dependencies. One or other fails (opennsa, libmnl, exprtk, etc...) with these
two options. So, adding support for "wget".

Tried to use python's wget.download() but this also internally uses
"urlretrieve" and hence it fails for some of the FBOSS' dependencies.
So, using wget command directly instead.

Reviewed By: shri-khare

Differential Revision: D40841867

fbshipit-source-id: 229b3064f3faad4b32cf8a3c43fef53f2bb001fd
2022-10-31 10:15:27 -07:00
Ivan Morett
7aadb3e7c0 Adding "Accept" header to urllib type request (#180)
Summary:
X-link: https://github.com/facebookincubator/katran/pull/180

The urlretrieve method originally doesn't add this header, and in katran we noticed that the libmnl wasn't fetched anymore. After investigation, the request is blocked with error 403 because this header is missing. Adding it to the request.

Reviewed By: avasylev

Differential Revision: D40386108

fbshipit-source-id: a9b4b937ca12a04bc701d3f945681914151c0110
2022-10-24 06:51:28 -07:00
David Greenberg
3d5f4f15ee use libcurl in getdeps (#76)
Summary:
X-link: https://github.com/facebookincubator/fizz/pull/76

Pull Request resolved: https://github.com/facebook/proxygen/pull/402

X-link: https://github.com/facebook/folly/pull/1735

X-link: https://github.com/facebook/bistro/pull/60

X-link: https://github.com/facebook/watchman/pull/1012

X-link: https://github.com/facebook/fbthrift/pull/487

X-link: https://github.com/facebook/fboss/pull/114

X-link: https://github.com/facebook/fb303/pull/27

When using getdeps inside of a container, Python's urllib isn't able to download from dewey lfs (see this post for details https://fb.workplace.com/groups/systemd.and.friends/permalink/2747692278870647/).

This allows for getdeps to use `libcurl` to fetch dependencies, which allows for a getdeps build to work inside the container environment.

Reviewed By: mackorone

Differential Revision: D34696330

fbshipit-source-id: 06cae87eef40dfa3cecacacee49234b6737d546f
2022-03-14 09:19:39 -07:00
David Greenberg
d579cdd7f6 getdeps optionally can get hg info from env var (#911)
Summary:
X-link: https://github.com/rsocket/rsocket-cpp/pull/911

X-link: https://github.com/facebookexperimental/rust-shed/pull/32

X-link: https://github.com/facebookincubator/reindeer/pull/3

X-link: https://github.com/fairinternal/AIRStore/pull/36

X-link: https://github.com/facebookincubator/velox/pull/1197

X-link: https://github.com/facebookincubator/mvfst/pull/242

X-link: https://github.com/facebookexperimental/eden/pull/116

X-link: https://github.com/facebookincubator/fizz/pull/75

X-link: https://github.com/facebookincubator/katran/pull/157

X-link: https://github.com/facebook/watchman/pull/1011

X-link: https://github.com/facebook/wangle/pull/205

Pull Request resolved: https://github.com/facebook/proxygen/pull/401

X-link: https://github.com/facebook/openr/pull/129

X-link: https://github.com/facebook/fbzmq/pull/35

X-link: https://github.com/facebook/fb303/pull/26

X-link: https://github.com/facebook/bistro/pull/59

X-link: https://github.com/facebook/folly/pull/1734

X-link: https://github.com/facebook/fboss/pull/113

Adds an environment variable to getdeps to provide `hg` info to avoid calling `hg` directly.

When using `getdeps` inside a containerized environment (which we need to build Research Super Cluster tooling with the correct linker attributes), `getdeps` fails because of unregistered mercurial extensions in the `hgrc`.

This allows `getdeps` to be useable in an environment where the mercurial extensions used in a project aren't installed/available.

Reviewed By: vivekspai

Differential Revision: D34732506

fbshipit-source-id: 6475088fbf3323347095ca5af8a902382cf8f9d0
2022-03-11 17:05:39 -08:00
Pyre Bot Jr
1f77084c8e Add annotations to opensource/fbcode_builder
Reviewed By: shannonzhu

Differential Revision: D34332682

fbshipit-source-id: 498c63851f98dd76502a20a9d1589df5b0c4e7b9
2022-02-17 22:55:51 -08:00
Pyre Bot Jr
e77a9fe43a Add annotations to opensource/fbcode_builder
Reviewed By: shannonzhu

Differential Revision: D34224272

fbshipit-source-id: 52e19886ab3d4fb015a557244660dd4357a35c17
2022-02-14 16:22:09 -08:00
Alex Hornby
076407407a add github actions for EdenFS on linux and fix Eden SCM Mac build (#106)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/eden/pull/106

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

Summary

* Add EdenFS builds on external CI now EdenSCM is good

* Mac builds on github actions by using brew for system dependencies

To make this work had to fix some path ordering issues with install directories for Linux and Mac, and generalise the homebrew path fixups we were doing for bison to all the used homebrew packages.

Previously Installed packages were being added after system paths, so our own installed thing might be ignored. On github these meant system python 3.9 was being used for hg tests rather than our specified 3.8 (this showed we have some test fails on python 3.9 with "SystemError: deallocated bytearray object has exported buffers", that are beyond the scope of this diff to fix)

Also needed to include the getdeps generated python into the generated edenscmdeps3.zip archive setup.py produces otherwise EdenFS tests failed to import thrift.Thrift

Eden tests are hanging when run externally about half way through, so disable them on github actions for now as this PR is already fairly large. They work when run locally on an internal devserver, so probably some bit of environment necessary is not defined in the test runner

Reviewed By: chadaustin

Differential Revision: D34116505

fbshipit-source-id: d0d628db5daabc28d0bd8997cd5c1bc885ed1e73
2022-02-14 11:56:43 -08:00
Harvey Hunt
a75c04f38c getdeps: Add support for brew packages and define package dependencies
Summary:
In order to speed up build times on a mac, add homebrew support to
getdeps.

Homebrew packages can be declared in a manifest using the `homebrew` header.

Futher, ahornby has added manifest entries for homebrew packages which are
included in this diff and also included a change to use the correct version of
openssl. Without this openssl change, homebrew cmake configure finds an old
openssl 1.0.2 install.

This diff provides a 2x speed up for building folly:

Timings for clean getdeps folly build on mid-2018 2.9Ghz i9 6 core intel macbook pro with 32GB RAM:

With new homebrew system deps:
```
rm -rf /Users/ahornby/.scratch/UsersZahornbyZfbsource/fbcode_builder_getdeps/
time ./opensource/fbcode_builder/getdeps.py build --allow-system-packages folly
real	17m39.329s
user	76m10.317s
sys	5m50.163s
```

Without:
```
rm -rf /Users/ahornby/.scratch/UsersZahornbyZfbsource/fbcode_builder_getdeps/
time ./opensource/fbcode_builder/getdeps.py build folly
real	32m10.344s
user	105m53.448s
sys	15m57.858s
```

Reviewed By: ahornby

Differential Revision: D33842632

fbshipit-source-id: ac785d4a8dcfa31b77292bddd9e747022ac36e3b
2022-02-04 04:28:37 -08:00
Alex Hornby
b5dfb025b6 allow expressions for shipit manifest entries
Summary: Add expressions for shipit entries so that we can map different directories if needed

Differential Revision: D33947996

fbshipit-source-id: e765769ae5a6ab90055b63284e538b965d6071b3
2022-02-04 01:19:48 -08:00
Chad Austin
d49dc0460c don't follow mount points when applying shipit transformation
Summary:
If a getdeps project creates a bind mount in a subdirectory, we don't
want the shipit transformer to copy all of the bind mount's contents
to the ship-transformed output.

This manifested when I was using Vagrant inside of Watchman and
`getdeps.py fetch watchman` would copy all of the Vagrant VMs too.

Reviewed By: ahornby

Differential Revision: D33855553

fbshipit-source-id: e2bc50ecfe0d067490c95be05d074d6a844f30d5
2022-02-03 12:06:55 -08:00
Chad Austin
423919dd7e opt into pyre
Summary:
Now that we have some type annotations, we might as well support
running the type checker.

Reviewed By: xavierd

Differential Revision: D33715757

fbshipit-source-id: baf693e4b2415e0e1aa50b569b744ca0cfb91337
2022-01-24 20:23:34 -08:00
Chad Austin
4fb4756ec9 remove legacy __future__ imports
Summary: The future is now.

Reviewed By: xavierd

Differential Revision: D33714537

fbshipit-source-id: 8d282bbe7391c4b72b70dab54a5c252060fba457
2022-01-24 20:23:34 -08:00
Andres Suarez
b5f1afe216 Update copyright headers from Facebook to Meta
Reviewed By: bhamodi

Differential Revision: D33330724

fbshipit-source-id: 8a798435742dedc96e2b6912179736b6a1c72491
2021-12-27 14:41:24 -08:00
Alex Hornby
27066ff71f fix getdeps fetch on python 3.6
Summary: The getdeps fetch step runs early on system python, so it has to work with it.  Subprocess capture_output was from 3.7 only, so let's switch to the alternate form that also works on ubuntu 18.04's python 3.6 install

Reviewed By: Croohand

Differential Revision: D32836861

fbshipit-source-id: bd492c0ee90edadbc9124d5820ddfe515fa46f43
2021-12-06 09:30:42 -08:00
Alex Hornby
46e693f4e5 include system package state in cache key
Summary: Using system packages changes the binaries, so include the used packages in the cache key when present

Reviewed By: krallin

Differential Revision: D32693534

fbshipit-source-id: c0494667b57040dde680cea3e8e00d77ef48403b
2021-12-03 01:53:51 -08:00
Alex Hornby
0311271bd0 default to main branch
Summary:
Most referenced repos have moved from master to main as default branch, so flip the default in getdeps.

As well as tidying things up, this means more manifests will be able to use the pinned git commit hash for a dependency that shipit generates (e.g. build/deps/github_hashes/facebook/folly-rev.txt). This is because a "rev = " setting in the manifest is treated as a dynamic override in GitFetcher.__init__ and this diff reduces the number of such overrides.

Reviewed By: StanislavGlebik

Differential Revision: D32567564

fbshipit-source-id: 3f1b734eb1bb0f5dbafb01ceb935a3d51b8dcc9a
2021-11-22 14:06:10 -08:00
John Reese
7221495483 apply upgraded black 21.4b2 formatting to fbsource
Summary:
This applies the formatting changes from black v21.4b2 to all covered
projects in fbsource. Most changes are to single line docstrings, as black
will now remove leading and trailing whitespace to match PEP8. Any other
formatting changes are likely due to files that landed without formatting,
or files that previously triggered errors in black.

Any changes to code should be AST identical. Any test failures are likely
due to bad tests, or testing against the output of pyfmt.

Reviewed By: thatch

Differential Revision: D28204910

fbshipit-source-id: 804725bcd14f763e90c5ddff1d0418117c15809a
2021-05-04 22:16:08 -07:00
John Reese
e5d1dee791 apply pyfmt with usort to opted-in sources
Reviewed By: zertosh

Differential Revision: D24880203

fbshipit-source-id: 2034cdfc2712209e86d3d05c119c58f979b05c52
2020-11-10 21:26:04 -08:00
Wez Furlong
061ce2fe6e getdeps: don't depend on git fetch depth any longer
Summary:
This commit takes advantage of git 2.5.0 being able to fetch a
requested revision rather than relying on the desired revision being within the
depth limited fetch.

This relies on having git 2.5.0 on the server which is true for all
of the projects we have manifests for; this shows zero matches:

```
$ rg repo_url opensource/fbcode_builder/manifests | grep -v github
```

We've had a couple of situations recently where folks have run into issues with
the commit rate in folly being higher than then fetch depth, so this should
address that.

Refs: https://github.com/facebook/watchman/issues/866

Reviewed By: fanzeyi

Differential Revision: D24747992

fbshipit-source-id: e9b67c61dddc9f55e05d8984e8d210e7d2faabcb
2020-11-04 23:49:33 -08:00
John Reese
b0335039ca apply black 20.8b1 formatting update
Summary:
allow-large-files

black_any_style

Reviewed By: zertosh

Differential Revision: D24325133

fbshipit-source-id: b4afe80d1e8b2bc993f4b8e3822c02964df47462
2020-10-14 20:21:40 -07:00
Jon Janzen
d6fc7f0176 Remove --skip-project-specific flag
Summary: This doesn't do anything anymore and is going to be removed in D23993306, let's remove it here first.

Reviewed By: yns88

Differential Revision: D23993954

fbshipit-source-id: 4d7dd5f992e34be7a0da16ce7cf59810407649c4
2020-10-01 11:51:38 -07:00
Wez Furlong
3a7480576f getdeps: improve build invalidation for dependencies
Summary:
We didn't do a great job of recognizing that we'd need to
build a project when one of its dependencies had changed: we relied
chiefly on the dependency hash for this and could fail to handle
changes in individual source files.

This commit helps to improve this situation by checking to see if
any installed files in the dependencies of a manifest are newer than
the most recent built time of a given manifest.  If so, we'll trigger
a build.  We try to be reasonably smart about deciding when to trigger
a cmake reconfigure if it looks like cmake files in the deps have
been changed.

Reviewed By: xavierd

Differential Revision: D21364132

fbshipit-source-id: 7534496e10d1f532aa9cf865900ace84a8785327
2020-05-04 17:45:27 -07:00
Wez Furlong
5a8455c0ce getdeps: refine makefiles matcher for cmake reconfigure
Summary:
Only run cmake reconfigure for .cmake, .cmake.in and CMakeLists.txt
files changes.

Previously we would reconfigure for any change to a file with a path that
matched `cmake` which could result in false positives in cases where
you may be iterating on .py or .c files in shared cmake directories.

This also reclassifies non-cmake files under fbcode_builder/CMake as source
files so that we run cmake for those; previously they would cause a
reconfigure and build, now they just cause a build.

Reviewed By: xavierd

Differential Revision: D21364133

fbshipit-source-id: a1231f657d6c6056b269656c677d3449d8715cf6
2020-05-04 17:45:27 -07:00
Wez Furlong
d334c275f6 getdeps: code formatting
Summary:
Our linter really wants to include formatting changes unrelated
to my diff stack.

This is a formatting only change to avoid clouding my diffs; no functional
effect.

Reviewed By: xavierd

Differential Revision: D21364519

fbshipit-source-id: 7670dd4154e788f593f256aabdfdeef6d17aeec4
2020-05-04 17:45:27 -07:00
Wez Furlong
5f2a16b70b getdeps: allow satisfying deps from system packages
Summary:
From the outset, we wanted to be sure that getdeps was able
to source and build the dependencies so that we knew that we'd have
a repeatable build.  This came at the cost of build times: having
to build boost on each CI run is a bit of a chore.

This commit adds three new elements to the manifest files:

* `rpms` - a list of RPM names that are all required to be present
  in order to consider the dependency satisfied
* `debs` - like `rpms` above, but scoped to debian package names
* `preinstalled.env` - a list of environment variables that if they
  are all set and non-empty will satisfy the dependency.

A new `--allow-system-packages` option to getdeps enables the new
logic that looks for system packages; it is off by default, but
enabled in the generated GitHub Actions workflows.

A new `install-system-deps` subcommand is provided that will attempt
to install the system packages needed to satisfy the build.  This
typically needs to be run via sudo and is thus broken out separately
from the main getdeps build flow.

I made a pass over the manifest files and added package names that
satisfy the build on ubuntu-18 and fedora-31.

shri-khare: I renamed the `Python3.7.6` manifest to just `python` as
part of this change; the version of python that it pulls in through
the normal build is the same and I believe that an equal or newer
version of python3 is available in the GH actions builder.

The `preinstalled.env` is used only by the boost manifest: it references
the name of an environment variable that is set by the github
windows hosts and that points to a pre-built and pre-installed
copy of boost.  Since there is no package manager that we can
easily query for this sort of thing, probing from the environment
seems like a reasonable and fast way to check for this.  We
may need to evolve this over time to become more feature rich,
but this seems like a good starting point.

This commit has the potential to save 20 minutes of build time
from each public CI build just due to the boost dependency alone!

Refs: https://github.com/facebook/watchman/pull/797

Reviewed By: yfeldblum

Differential Revision: D20740410

fbshipit-source-id: 6c38019449c54465127656c3d18a6ff1f30adaea
2020-04-29 11:18:43 -07:00
Wez Furlong
1aaa4f7c22 getdeps: export fbsource commit date into environment
Summary:
This diff extracts the fbsource commit hash and the date of that
commit and maintains that in place of just the commit hash that
we were previously extracting.

This data is exported into the environment that we pass on to
builders so that it is available if they choose to use it.

In a follow on diff I'll use this to default a version number
in the watchman project.

Reviewed By: fanzeyi

Differential Revision: D20949666

fbshipit-source-id: dc12bffe5f0efc4297b15ba0140c4c67a23ab0fd
2020-04-09 15:14:38 -07:00
Wez Furlong
5cb5dbeb4e getdeps: don't use fbsource hash in the simple shipit fetcher
Summary:
This avoids invalidating the entire build in response
to just running `hg amend`, which is frustrating and slow.

Reviewed By: chadaustin

Differential Revision: D18005409

fbshipit-source-id: ef93313859919298be78204046eb08bcadc5398e
2019-10-21 04:09:15 -07:00
Wez Furlong
185282d1c6 getdeps: regard IOError as transient when fetching URLs
Summary:
this should help avoid this particular error:

```
IOError: [Errno socket error] [Errno 11001] getaddrinfo failed
```

Reviewed By: chadaustin

Differential Revision: D17886598

fbshipit-source-id: bd9f5b84ebd7ca5c339be3afec3a975fa907d052
2019-10-17 02:20:12 -07:00
Andres Suarez
18fe084a4e Relicense getdeps from BSD to MIT
Summary: See https://fb.workplace.com/groups/osssupport/permalink/2846876118694318/

Reviewed By: wez

Differential Revision: D17750243

fbshipit-source-id: 9e149df1f8e09203820f50d0fcac4a5cecf52e33
2019-10-10 13:23:48 -07:00
Adam Simpkins
a412d9a8a0 getdeps: allow overriding project source, build, and install directories
Summary:
Add arguments to getdeps.py to allow overriding the source, build, and install
directories a per-project basis.  The arguments take the form `[PROJECT:]PATH`
If the `PROJECT` portion is omitted, it defaults to the current project being
built.

In particular this makes it possible to specify `--src-dir .` to tell
getdeps.py to find the project sources from the current directory rather than
downloading them.

Reviewed By: wez

Differential Revision: D16778011

fbshipit-source-id: f33b87213ace04abb66334f588babdf59df91964
2019-08-15 17:56:00 -07:00
Adam Simpkins
fb5f217226 getdeps: fix a crash if the project_hashes directory does not exist
Summary:
This makes getdeps.py no longer crash if used in the folly repository.
Folly does not depend on any other Facebook projects, so it does not
include a `build/deps` directory.

Reviewed By: wez

Differential Revision: D16778009

fbshipit-source-id: 41be53d862f41b62154b081eb90ddba8742658fe
2019-08-15 17:56:00 -07:00
Shrikrishna Khare
199e1eb3a0 fbcode_builder: getdeps: fboss: add iproute2 fetcher
Summary:
This is towards getting open source FBOSS to build using fbcode_builder.
iproute2 is one of the dependencies for FBOSS. This patch adds a manifest file
to build the specific version of iproute2 needed for FBOSS.

Additionally, the default git clone depth of 100 is insufficient for the
version of iproute2 FBOSS depends on. Thus, this patch extends the git SCHEMA
to add optional argument depth. The default remains 100.

The usual /configure --prefix does not work for iproute2. Thus, we need to add
a custom builder that:
  - copies sources to build directory, builds, and
  - installs to installed directory using DEST_DIR.
  - it must also explicitly copy include from build dir to install dir

Reviewed By: wez

Differential Revision: D15588809

fbshipit-source-id: ac5eab24134e078d88b85b4be433c78b05ef8ce5
2019-06-05 15:40:24 -07:00
Zeyi (Rice) Fan
629a9d8f6e fix encoding issue when building on Windows
Summary:
On Windows, the writing operation would fail with:

```
Traceback (most recent call last):
  File ".\opensource\fbcode_builder\getdeps.py", line 400, in <module>
    sys.exit(main())
  File ".\opensource\fbcode_builder\getdeps.py", line 393, in main
    return args.func(args)
  File ".\opensource\fbcode_builder\getdeps.py", line 236, in run
    change_status = fetcher.update()
  File "C:\open\fbsource\fbcode\opensource\fbcode_builder\getdeps\fetcher.py", line 451, in update
    return mapping.mirror(self.build_options.fbsource_dir, self.repo_dir)
  File "C:\open\fbsource\fbcode\opensource\fbcode_builder\getdeps\fetcher.py", line 400, in mirror
    f.write(name + "\n")
  File "C:\Python36\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 104-105: character maps to <undefined>
```

and this is caused by a file in libgit2: https://github.com/libgit2/libgit2/blob/master/tests/resources/status/%E8%BF%99, which is intended to test handling non-ASCII path.

Python on Windows will write file in cp1252 encoding by default, which does not contain that Chines character. (Caveat: that file on my system doesn't have the correct file name as well, it is being encoded in IBM861 for some reason. However the characters in IBM861 does not exist in CP1252 either)

Reviewed By: wez

Differential Revision: D15281521

fbshipit-source-id: 8a75e32bc1042167c945d67e26b549fda83b6b41
2019-05-10 13:37:45 -07:00
Wez Furlong
b96314bea8 getdeps: introduce TransientFailure exception type
Summary:
The goal is to return an error code > 127 in the case of a
transient, retryable, infrastructure error.  This diff generates
those in the case of failure in downloading a URL or from interacting
with LFS.

Reviewed By: strager

Differential Revision: D15266838

fbshipit-source-id: 4f52a791320123968869032c37912dded464a86e
2019-05-10 12:54:49 -07:00
Wez Furlong
7919050c9a fbcode_builder: getdeps: add LFS caching for ArchiveFetcher
Summary:
When running in FB infra, prefer to download from our local LFS
server rather than going out to the internet.

Fall back to a normal internet download if the LFS get fails for some reason.

Upload to LFS after successfully verifying the hash for the downloaded archive.

Add a subcommand that performs a fetch for all possible platforms so that it
is easier to ensure that the lfs-pointers file is up to date.

Reviewed By: simpkins

Differential Revision: D14978660

fbshipit-source-id: 240fc32fc7003d1e06c88b80d85054dae36e2f31
2019-05-03 16:00:45 -07:00
Wez Furlong
4f5544674a fbcode_builder: getdeps: beef up hash computation
Summary:
previously, a relatively lame hash was computed to use
for the build directory based on some hash of the source directory.
That was good enough to get things off the ground, but in the
interest of being able to cache the build outputs and safely
invalidate them we need a slightly more rigorous implementation.

This diff computes a hash based on the manifest contents and
relevant environmental factors.

The hash is used to name the build directory which will ultimately
be cached eg: using the travis/appveyor cache directory configuration
and some other means for the FB internal CI.

The hash needs to be sufficient that we change the hash when
the manifests change.  We can tolerate a false positive change
in hash (it just means that a build will take longer), but
cannot tolerate a false negative (which would result in an
incorrect build).

Reviewed By: simpkins

Differential Revision: D14710332

fbshipit-source-id: ebc2e74eafc6f3305d4412a82195bc9fb9dfa615
2019-05-03 16:00:44 -07:00
Wez Furlong
10b8a8191c fbcode_builder: getdeps: add SimpleShipitTransformer fetcher
Summary:
This fetcher knows how to transform a 1st party project
from fbsource into approximately the same shape as ShipIt produces
for the github repo mirrors.  It does this by reading shipit
mapping information from the manifest file for the project.

Since this fetcher uses data in the manifest and is implemented
directly in the getdeps codebase, it is suitable for iterating
on the opensource builds directly out of fbsource on both devservers
and laptops inside FB.

Reviewed By: simpkins

Differential Revision: D14691012

fbshipit-source-id: 05f68a7be64a2e465937b24b8825d25d3348ed13
2019-05-03 16:00:39 -07:00
Wez Furlong
842f30d3a1 fbcode_builder: getdeps: add ShipitTransformer fetcher
Summary:
This fetcher knows how to take a 1st party FB project
from fbsource and transform it to the same shape as our github
repos using ShipIt.  The transformation creates a transformed
mirror of the code in scratch space (rather than mutating fbsource
directly).

This can only be used in environments where shipit is available.
A later diff implements an alternative that works in more environments.

Reviewed By: simpkins

Differential Revision: D14691013

fbshipit-source-id: 539e307755c9fc0a098a235868ab622652061494
2019-05-03 16:00:39 -07:00