@@ -211,8 +211,8 @@ def _rust_toolchain(ctx):
211
211
rustc_path = ctx .file ._rustc .path ,
212
212
rustc_lib_path = ctx .files ._rustc_lib [0 ].dirname ,
213
213
rustc_lib_short_path = _get_dirname (ctx .files ._rustc_lib [0 ].short_path ),
214
- rustlib_path = ctx .files ._rustlib [0 ].dirname ,
215
- rustlib_short_path = _get_dirname (ctx .files ._rustlib [0 ].short_path ),
214
+ rust_lib_path = ctx .files ._rust_lib [0 ].dirname ,
215
+ rust_lib_short_path = _get_dirname (ctx .files ._rust_lib [0 ].short_path ),
216
216
rustdoc_path = ctx .file ._rustdoc .path ,
217
217
rustdoc_short_path = ctx .file ._rustdoc .short_path )
218
218
@@ -266,7 +266,7 @@ def _build_rustc_command(ctx, crate_name, crate_type, src, output_dir,
266
266
"--codegen ar=%s" % ar ,
267
267
"--codegen linker=%s" % cc ,
268
268
"--codegen link-args='%s'" % ' ' .join (cpp_fragment .link_options ),
269
- "-L all=%s" % toolchain .rustlib_path ,
269
+ "-L all=%s" % toolchain .rust_lib_path ,
270
270
"--out-dir %s" % output_dir ,
271
271
"--emit=dep-info,link" ,
272
272
] +
@@ -336,7 +336,7 @@ def _rust_library_impl(ctx):
336
336
depinfo .transitive_libs +
337
337
[ctx .file ._rustc ] +
338
338
ctx .files ._rustc_lib +
339
- ctx .files ._rustlib +
339
+ ctx .files ._rust_lib +
340
340
ctx .files ._crosstool )
341
341
342
342
ctx .action (
@@ -389,7 +389,7 @@ def _rust_binary_impl(ctx):
389
389
depinfo .transitive_libs +
390
390
[ctx .file ._rustc ] +
391
391
ctx .files ._rustc_lib +
392
- ctx .files ._rustlib +
392
+ ctx .files ._rust_lib +
393
393
ctx .files ._crosstool )
394
394
395
395
ctx .action (
@@ -451,7 +451,7 @@ def _rust_test_common(ctx, test_binary):
451
451
depinfo .transitive_libs +
452
452
[ctx .file ._rustc ] +
453
453
ctx .files ._rustc_lib +
454
- ctx .files ._rustlib +
454
+ ctx .files ._rust_lib +
455
455
ctx .files ._crosstool )
456
456
457
457
ctx .action (
@@ -538,7 +538,7 @@ def _rust_doc_impl(ctx):
538
538
toolchain .rustdoc_path ,
539
539
lib_rs .path ,
540
540
"--crate-name %s" % target .name ,
541
- "-L all=%s" % toolchain .rustlib_path ,
541
+ "-L all=%s" % toolchain .rust_lib_path ,
542
542
"-o %s" % docs_dir ,
543
543
] +
544
544
doc_flags +
@@ -560,7 +560,7 @@ def _rust_doc_impl(ctx):
560
560
depinfo .libs +
561
561
[ctx .file ._rustdoc ] +
562
562
ctx .files ._rustc_lib +
563
- ctx .files ._rustlib )
563
+ ctx .files ._rust_lib )
564
564
565
565
ctx .action (
566
566
inputs = rustdoc_inputs ,
@@ -604,7 +604,7 @@ def _rust_doc_test_impl(ctx):
604
604
"LD_LIBRARY_PATH=%s" % toolchain .rustc_lib_short_path ,
605
605
"DYLD_LIBRARY_PATH=%s" % toolchain .rustc_lib_short_path ,
606
606
toolchain .rustdoc_short_path ,
607
- "-L all=%s" % toolchain .rustlib_short_path ,
607
+ "-L all=%s" % toolchain .rust_lib_short_path ,
608
608
lib_rs .path ,
609
609
] +
610
610
depinfo .search_flags +
@@ -619,7 +619,7 @@ def _rust_doc_test_impl(ctx):
619
619
depinfo .transitive_libs +
620
620
[ctx .file ._rustdoc ] +
621
621
ctx .files ._rustc_lib +
622
- ctx .files ._rustlib )
622
+ ctx .files ._rust_lib )
623
623
624
624
runfiles = ctx .runfiles (files = doc_test_inputs , collect_data = True )
625
625
return struct (runfiles = runfiles )
@@ -649,8 +649,8 @@ _rust_toolchain_attrs = {
649
649
"_rustc_lib" : attr .label (
650
650
default = Label ("//rust:rustc_lib" ),
651
651
),
652
- "_rustlib " : attr .label (
653
- default = Label ("//rust:rustlib " ),
652
+ "_rust_lib " : attr .label (
653
+ default = Label ("//rust:rust_lib " ),
654
654
),
655
655
"_rustdoc" : attr .label (
656
656
default = Label ("//rust:rustdoc" ),
@@ -1303,83 +1303,3 @@ Example:
1303
1303
Running `bazel test //hello_lib:hello_lib_doc_test` will run all documentation
1304
1304
tests for the `hello_lib` library crate.
1305
1305
"""
1306
-
1307
- RUST_BUILD_FILE = """
1308
- config_setting(
1309
- name = "darwin",
1310
- values = {"host_cpu": "darwin"},
1311
- )
1312
-
1313
- config_setting(
1314
- name = "k8",
1315
- values = {"host_cpu": "k8"},
1316
- )
1317
-
1318
- filegroup(
1319
- name = "rustc",
1320
- srcs = select({
1321
- ":darwin": ["rustc/bin/rustc"],
1322
- ":k8": ["rustc/bin/rustc"],
1323
- }),
1324
- visibility = ["//visibility:public"],
1325
- )
1326
-
1327
- filegroup(
1328
- name = "rustc_lib",
1329
- srcs = select({
1330
- ":darwin": glob(["rustc/lib/*.dylib"]),
1331
- ":k8": glob(["rustc/lib/*.so"]),
1332
- }),
1333
- visibility = ["//visibility:public"],
1334
- )
1335
-
1336
- filegroup(
1337
- name = "rustdoc",
1338
- srcs = select({
1339
- ":darwin": ["rustc/bin/rustdoc"],
1340
- ":k8": ["rustc/bin/rustdoc"],
1341
- }),
1342
- visibility = ["//visibility:public"],
1343
- )
1344
-
1345
- filegroup(
1346
- name = "rustlib",
1347
- srcs = select({
1348
- ":darwin": glob([
1349
- "rust-std-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/*.rlib",
1350
- "rust-std-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/*.dylib",
1351
- "rust-std-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/*.a",
1352
- "rustc/lib/rustlib/x86_64-apple-darwin/lib/*.rlib",
1353
- "rustc/lib/rustlib/x86_64-apple-darwin/lib/*.dylib",
1354
- "rustc/lib/rustlib/x86_64-apple-darwin/lib/*.a",
1355
- ]),
1356
- ":k8": glob([
1357
- "rust-std-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/*.rlib",
1358
- "rust-std-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/*.so",
1359
- "rust-std-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/*.a",
1360
- "rustc/lib/rustlib/x86_64-unknown-linux-gnu/lib/*.rlib",
1361
- "rustc/lib/rustlib/x86_64-unknown-linux-gnu/lib/*.so",
1362
- "rustc/lib/rustlib/x86_64-unknown-linux-gnu/lib/*.a",
1363
- ]),
1364
- }),
1365
- visibility = ["//visibility:public"],
1366
- )
1367
- """
1368
-
1369
- def rust_repositories ():
1370
- """Adds the external dependencies needed for the Rust rules."""
1371
- native .new_http_archive (
1372
- name = "rust_linux_x86_64" ,
1373
- url = "http://bazel-mirror.storage.googleapis.com/static.rust-lang.org/dist/rust-1.15.1-x86_64-unknown-linux-gnu.tar.gz" ,
1374
- strip_prefix = "rust-1.15.1-x86_64-unknown-linux-gnu" ,
1375
- sha256 = "b1e7c818a3cc8b010932f0efc1cf0ede7471958310f808d543b6e32d2ec748e7" ,
1376
- build_file_content = RUST_BUILD_FILE ,
1377
- )
1378
-
1379
- native .new_http_archive (
1380
- name = "rust_darwin_x86_64" ,
1381
- url = "http://bazel-mirror.storage.googleapis.com/static.rust-lang.org/dist/rust-1.15.1-x86_64-apple-darwin.tar.gz" ,
1382
- strip_prefix = "rust-1.15.1-x86_64-apple-darwin" ,
1383
- sha256 = "38606e464b31a778ffa7d25d490a9ac53b472102bad8445b52e125f63726ac64" ,
1384
- build_file_content = RUST_BUILD_FILE ,
1385
- )
0 commit comments