Skip to content

Commit

Permalink
chore: introduce third-party
Browse files Browse the repository at this point in the history
  • Loading branch information
bodymindarts committed Oct 30, 2023
1 parent 691f067 commit 711d610
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 1 deletion.
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
cargo-nextest
cargo-audit
cargo-watch
reindeer
]
++ buck2NativeBuildInputs
++ lib.optionals pkgs.stdenv.isLinux [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
29 changes: 29 additions & 0 deletions third-party/rust/reindeer.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Configuration for Reindeer to generate Buck targets from Cargo.toml
#
# Overview of available options:
# https://github.com/facebookincubator/reindeer/blob/main/example/third-party/reindeer.toml

# Parse Rust code to work out the precise set of source files for each crate.
precise_srcs = true

# Include a public top-level target which depends on all other targets.
include_top_level = true

[cargo]
# Support Cargo's unstable "artifact dependencies" functionality, RFC 3028.
bindeps = true

[buck]
# Name of the generated file.
file_name = "BUCK"

# Rules used for various kinds of targets.
rust_library = "cargo.rust_library"
rust_binary = "cargo.rust_binary"
prebuilt_cxx_library = "third_party_rust_prebuilt_cxx_library"

buckfile_imports = """
load("@prelude//rust:cargo_buildscript.bzl", "buildscript_run")
load("@prelude//rust:cargo_package.bzl", "cargo")
load("//third-party/macros:rust_third_party.bzl", "third_party_rust_prebuilt_cxx_library")
"""
2 changes: 1 addition & 1 deletion toolchains/workspace-pnpm/macros.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ build_node_modules = rule(
attrs = {
"turbo_bin": attrs.dep(
providers = [RunInfo],
default = "//shim/custom-third-party/node/turbo:turbo_bin",
default = "//third-party/node/turbo:turbo_bin",
doc = """Turbo dependency.""",
),
"workspace": attrs.source(
Expand Down
8 changes: 8 additions & 0 deletions vendir.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,12 @@ directories:
- "2023-10-15"
path: .
path: prelude
- contents:
- git:
commitTitle: 'prelude/rust: Process CARGO_MANIFEST_DIR during rustdoc test...'
sha: 98a6e7b70dc82a62784f80897d72fefdfb54d70f
tags:
- "2023-10-15"
path: .
path: third-party/rust/reindeer.toml
kind: LockConfig
10 changes: 10 additions & 0 deletions vendir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,14 @@ directories:
includePaths:
- prelude/**/*
newRootPath: prelude
- path: third-party/rust/reindeer.toml
contents:
- path: .
git:
url: https://github.com/facebook/buck2.git
# Need to update to $BUCK2_VERSION when new buck2 gets updated via `nix flake update`
ref: '2023-10-15'
includePaths:
- shim/third-party/rust/reindeer.toml
newRootPath: shim/third-party/rust/reindeer.toml

0 comments on commit 711d610

Please sign in to comment.