Skip to content

Commit

Permalink
gh shims: Set up shim for rust_linkable_symbol
Browse files Browse the repository at this point in the history
Summary: So that we can use it in first party OSS projects

Reviewed By: dtolnay

Differential Revision:
D62731699

Privacy Context Container: L1123788

fbshipit-source-id: 892c43d69a34dd02cf2295ef665b41e45846982b
  • Loading branch information
JakobDegen authored and facebook-github-bot committed Sep 18, 2024
1 parent 02ebbf5 commit ccf87eb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions shim/build_defs/rust_linkable_symbol.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under both the MIT license found in the
# LICENSE-MIT file in the root directory of this source tree and the Apache
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@prelude//rust:linkable_symbol.bzl", prelude_rust_linkable_symbol = "rust_linkable_symbol")
load("@shim//:shims.bzl", _rust_library = "rust_library")

def rust_linkable_symbol(
visibility = ["PUBLIC"],
**kwargs):
prelude_rust_linkable_symbol(
visibility = visibility,
rust_library_macro = _rust_library,
**kwargs
)
2 changes: 2 additions & 0 deletions shim/shims.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,8 @@ def _fix_dep(x: str) -> [
return "root//" + x.removeprefix("//")
elif x.startswith("shim//"):
return x
elif x.startswith("prelude//"):
return x
else:
fail("Dependency is unaccounted for `{}`.\n".format(x) +
"Did you forget 'oss-disable'?")
Expand Down

0 comments on commit ccf87eb

Please sign in to comment.