Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
fbshipit-source-id: 416479d6ba2df16221e98710457c5843f5463671
  • Loading branch information
facebook-github-bot committed Oct 7, 2022
0 parents commit a46264a
Show file tree
Hide file tree
Showing 3,118 changed files with 387,711 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
19 changes: 19 additions & 0 deletions .buckconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[repositories]
root = .
prelude = prelude
ovr_config = prelude
shim = shim
toolchains = shim
fbcode = shim
fbcode_macros = shim
fbsource = shim
buck = shim

[buildfile]
name = TARGETS

[build]
execution_platforms = ovr_config//platforms:default

[parser]
target_platform_detector_spec = target://...->ovr_config//platforms:default
5 changes: 5 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build]
# `cargo_internal_build` is set for cargo builds inside Meta.
# The flag enables features not available in opensource version,
# in particular, dependencies on libraries not available in open source.
# @oss-disable: rustflags = ["--cfg", "cargo_internal_build"]
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2.1
orbs:
rust: circleci/[email protected]
jobs:
build:
docker:
- image: cimg/rust:1.49.0
resource_class: xlarge
steps:
- run: sudo apt-get update
- run: sudo apt-get install libssl-dev cmake
- checkout
- rust/clippy:
with_cache: false
- rust/build:
with_cache: false
- rust/test:
with_cache: false
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 100
indent_size = 4
tab_width = 4

[.patternlint/config.json]
indent_size = 2
tab_width = 2

[*.proto]
indent_size = 2
tab_width = 2
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: ci
on:
push:
pull_request:
schedule:
- cron: '0 12 * * 1' # 12pm Monday
jobs:
test:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v2
- uses: codota/toolchain@00a8bf2bdcfe93aefd70422d3dec07337959d3a4
with:
components: clippy, rustfmt
# We use rustfmt 2.0 for formatting, which differs from the released
# version installed by Cargo
# - run: cargo fmt -- --check
- run: cargo clippy
- run: cargo build
- run: cargo test
# On Windows we run out of disk space on the test step :(
if: matrix.os != 'windows-latest'
- run: cargo bench
# On Linux we run out of disk space on the benchmark step :(
if: matrix.os != 'windows-latest' && matrix.os != 'ubuntu-latest'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/buck-out/
/target/
Cargo.lock
47 changes: 47 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug buck2",
"cargo": {
"args": [
"build",
"--bin=buck2",
"--package=cli"
],
"env": {
// Doesn't work, but has been requested upstream
// https://github.com/vadimcn/vscode-lldb/issues/388
"CARGO_PROFILE_DEV_DEBUG": "true"
},
"filter": {
"name": "buck2",
"kind": "bin"
}
},
"args": [
"build",
"fbcode//one_world/cli/util/process_wrapper:process_wrapper"
],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "attach",
"name": "Debug buck2d",
"cwd": "${workspaceFolder}",
"pid": "${command:pickMyProcess}",
},
{
"type": "starlark",
"request": "launch",
"name": "Starlark",
"program": "${file}"
}
]
}
49 changes: 49 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build_package",
"type": "shell",
"command": "cargo build",
"options": {
"cwd": "${fileDirname}",
},
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"panel": "new"
}
},
{
"label": "test_package",
"type": "shell",
"command": "cargo test",
"options": {
"cwd": "${fileDirname}",
},
"problemMatcher": [],
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"panel": "new"
}
},
{
"label": "verify_all",
"type": "shell",
"command": "${workspaceFolder}/test.sh",
"problemMatcher": [],
"group": "test",
"presentation": {
"panel": "new"
}
},
]
}
3 changes: 3 additions & 0 deletions .watchmanconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ignore_dirs": ["buck-out", ".git"]
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Buck2

* Initial version.
45 changes: 45 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Open Source Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

Using welcoming and inclusive language
Being respectful of differing viewpoints and experiences
Gracefully accepting constructive criticism
Focusing on what is best for the community
Showing empathy towards other community members
Examples of unacceptable behavior by participants include:

The use of sexualized language or imagery and unwelcome sexual attention or advances
Trolling, insulting/derogatory comments, and personal or political attacks
Public or private harassment
Publishing others’ private information, such as a physical or electronic address, without explicit permission
Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when an individual is representing the project or its community in public spaces. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributing to Buck2

We want to make contributing to this project as easy and transparent as possible.

## Our Development Process

Buck2 is currently developed in Facebook's internal repositories and then exported
out to GitHub by a Facebook team member; however, we invite you to submit pull
requests as described below.

## Pull Requests

We actively welcome your pull requests.

1. Fork the repo and create your branch from `main`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. Make sure your code lints.
6. If you haven't already, complete the Contributor License Agreement ("CLA").

## Contributor License Agreement ("CLA")

In order to accept your pull request, we need you to submit a CLA. You only need
to do this once to work on any of Facebook's open source projects.

Complete your CLA here: <https://code.facebook.com/cla>

## Issues

We use GitHub issues to track public bugs. Please ensure your description is
clear and has sufficient instructions to be able to reproduce the issue.

Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
disclosure of security bugs. In those cases, please go through the process
outlined on that page and do not file a public issue.

## Coding Style

Follow the automatic `rust fmt` configuration.

## License

By contributing to Buck2, you agree that your contributions will be
licensed under both the [LICENSE-MIT](LICENSE-MIT) and [LICENSE-APACHE](LICENSE-APACHE)
files in the root directory of this source tree.
Loading

0 comments on commit a46264a

Please sign in to comment.