@@ -16216,385 +16216,6 @@ msgstr ""
16216
16216
"cxx.h\"` را وارد کنید."
16217
16217
16218
16218
#: src/exercises/chromium/interoperability-with-cpp.md:29
16219
- msgid "Pass a C++ string from C++ into Rust."
16220
- msgstr ""
16221
-
16222
- #: src/exercises/chromium/interoperability-with-cpp.md:30
16223
- msgid "Pass a reference to a C++ object into Rust."
16224
- msgstr ""
16225
-
16226
- #: src/exercises/chromium/interoperability-with-cpp.md:31
16227
- msgid ""
16228
- "Intentionally get the Rust function signatures mismatched from the `#[cxx::"
16229
- "bridge]`, and get used to the errors you see."
16230
- msgstr ""
16231
-
16232
- #: src/exercises/chromium/interoperability-with-cpp.md:33
16233
- msgid ""
16234
- "Intentionally get the C++ function signatures mismatched from the `#[cxx::"
16235
- "bridge]`, and get used to the errors you see."
16236
- msgstr ""
16237
-
16238
- #: src/exercises/chromium/interoperability-with-cpp.md:35
16239
- msgid ""
16240
- "Pass a `std::unique_ptr` of some type from C++ into Rust, so that Rust can "
16241
- "own some C++ object."
16242
- msgstr ""
16243
-
16244
- #: src/exercises/chromium/interoperability-with-cpp.md:37
16245
- msgid ""
16246
- "Create a Rust object and pass it into C++, so that C++ owns it. (Hint: you "
16247
- "need a `Box`)."
16248
- msgstr ""
16249
-
16250
- #: src/exercises/chromium/interoperability-with-cpp.md:39
16251
- msgid "Declare some methods on a C++ type. Call them from Rust."
16252
- msgstr ""
16253
-
16254
- #: src/exercises/chromium/interoperability-with-cpp.md:40
16255
- msgid "Declare some methods on a Rust type. Call them from C++."
16256
- msgstr ""
16257
-
16258
- #: src/exercises/chromium/interoperability-with-cpp.md:42
16259
- msgid "Part three"
16260
- msgstr ""
16261
-
16262
- #: src/exercises/chromium/interoperability-with-cpp.md:44
16263
- msgid ""
16264
- "Now you understand the strengths and limitations of CXX interop, think of a "
16265
- "couple of use-cases for Rust in Chromium where the interface would be "
16266
- "sufficiently simple. Sketch how you might define that interface."
16267
- msgstr ""
16268
-
16269
- #: src/exercises/chromium/interoperability-with-cpp.md:50
16270
- msgid "The [`cxx` binding reference](https://cxx.rs/bindings.html)"
16271
- msgstr ""
16272
-
16273
- #: src/exercises/chromium/interoperability-with-cpp.md:51
16274
- msgid ""
16275
- "The [`rust_static_library` gn template](https://source.chromium.org/chromium/"
16276
- "chromium/src/+/main:build/rust/rust_static_library.gni;l=16)"
16277
- msgstr ""
16278
-
16279
- #: src/exercises/chromium/interoperability-with-cpp.md:57
16280
- msgid "Some of the questions you may encounter:"
16281
- msgstr ""
16282
-
16283
- #: src/exercises/chromium/interoperability-with-cpp.md:59
16284
- msgid ""
16285
- "I'm seeing a problem initializing a variable of type X with type Y, where X "
16286
- "and Y are both function types. This is because your C++ function doesn't "
16287
- "quite match the declaration in your `cxx::bridge`."
16288
- msgstr ""
16289
-
16290
- #: src/exercises/chromium/interoperability-with-cpp.md:62
16291
- msgid ""
16292
- "I seem to be able to freely convert C++ references into Rust references. "
16293
- "Doesn't that risk UB? For CXX's _opaque_ types, no, because they are zero-"
16294
- "sized. For CXX trivial types yes, it's _possible_ to cause UB, although "
16295
- "CXX's design makes it quite difficult to craft such an example."
16296
- msgstr ""
16297
-
16298
- #: src/chromium/adding-third-party-crates.md
16299
- msgid ""
16300
- "Rust libraries are called \"crates\" and are found at [crates.io](https://"
16301
- "crates.io). It's _very easy_ for Rust crates to depend upon one another. So "
16302
- "they do!"
16303
- msgstr ""
16304
-
16305
- #: src/chromium/adding-third-party-crates.md
16306
- msgid "Property"
16307
- msgstr "ویژگی"
16308
-
16309
- #: src/chromium/adding-third-party-crates.md
16310
- #, fuzzy
16311
- msgid "C++ library"
16312
- msgstr "کتابخانه"
16313
-
16314
- #: src/chromium/adding-third-party-crates.md
16315
- #, fuzzy
16316
- msgid "Rust crate"
16317
- msgstr "اکوسیستم Rust"
16318
-
16319
- #: src/chromium/adding-third-party-crates.md
16320
- #, fuzzy
16321
- msgid "Build system"
16322
- msgstr "اکوسیستم Rust"
16323
-
16324
- #: src/chromium/adding-third-party-crates.md
16325
- msgid "Lots"
16326
- msgstr ""
16327
-
16328
- #: src/chromium/adding-third-party-crates.md
16329
- msgid "Consistent: `Cargo.toml`"
16330
- msgstr ""
16331
-
16332
- #: src/chromium/adding-third-party-crates.md
16333
- msgid "Typical library size"
16334
- msgstr ""
16335
-
16336
- #: src/chromium/adding-third-party-crates.md
16337
- msgid "Large-ish"
16338
- msgstr ""
16339
-
16340
- #: src/chromium/adding-third-party-crates.md
16341
- msgid "Small"
16342
- msgstr ""
16343
-
16344
- #: src/chromium/adding-third-party-crates.md
16345
- msgid "Transitive dependencies"
16346
- msgstr ""
16347
-
16348
- #: src/chromium/adding-third-party-crates.md
16349
- msgid "Few"
16350
- msgstr ""
16351
-
16352
- #: src/chromium/adding-third-party-crates.md
16353
- msgid "For a Chromium engineer, this has pros and cons:"
16354
- msgstr ""
16355
-
16356
- #: src/chromium/adding-third-party-crates.md
16357
- msgid ""
16358
- "All crates use a common build system so we can automate their inclusion into "
16359
- "Chromium..."
16360
- msgstr ""
16361
-
16362
- #: src/chromium/adding-third-party-crates.md
16363
- msgid ""
16364
- "... but, crates typically have transitive dependencies, so you will likely "
16365
- "have to bring in multiple libraries."
16366
- msgstr ""
16367
-
16368
- #: src/chromium/adding-third-party-crates.md
16369
- msgid "We'll discuss:"
16370
- msgstr ""
16371
-
16372
- #: src/chromium/adding-third-party-crates.md
16373
- msgid "How to put a crate in the Chromium source code tree"
16374
- msgstr ""
16375
-
16376
- #: src/chromium/adding-third-party-crates.md
16377
- msgid "How to make `gn` build rules for it"
16378
- msgstr ""
16379
-
16380
- #: src/chromium/adding-third-party-crates.md
16381
- msgid "How to audit its source code for sufficient safety."
16382
- msgstr ""
16383
-
16384
- #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:1
16385
- msgid "Configuring the `Cargo.toml` file to add crates"
16386
- msgstr ""
16387
-
16388
- #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:3
16389
- msgid ""
16390
- "Chromium has a single set of centrally-managed direct crate dependencies. "
16391
- "These are managed through a single [`Cargo.toml`](https://source.chromium."
16392
- "org/chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/Cargo."
16393
- "toml):"
16394
- msgstr ""
16395
-
16396
- #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:6
16397
- msgid ""
16398
- "```toml\n"
16399
- "[dependencies]\n"
16400
- "bitflags = \"1\"\n"
16401
- "cfg-if = \"1\"\n"
16402
- "cxx = \"1\"\n"
16403
- "# lots more...\n"
16404
- "```"
16405
- msgstr ""
16406
-
16407
- #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:14
16408
- msgid ""
16409
- "As with any other `Cargo.toml`, you can specify [more details about the "
16410
- "dependencies](https://doc.rust-lang.org/cargo/reference/specifying-"
16411
- "dependencies.html) --- most commonly, you'll want to specify the `features` "
16412
- "that you wish to enable in the crate."
16413
- msgstr ""
16414
-
16415
- #: src/chromium/adding-third-party-crates/configuring-cargo-toml.md:18
16416
- msgid ""
16417
- "When adding a crate to Chromium, you'll often need to provide some extra "
16418
- "information in an additional file, `gnrt_config.toml`, which we'll meet next."
16419
- msgstr ""
16420
-
16421
- #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:3
16422
- msgid ""
16423
- "Alongside `Cargo.toml` is [`gnrt_config.toml`](https://source.chromium.org/"
16424
- "chromium/chromium/src/+/main:third_party/rust/chromium_crates_io/gnrt_config."
16425
- "toml). This contains Chromium-specific extensions to crate handling."
16426
- msgstr ""
16427
-
16428
- #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:6
16429
- msgid ""
16430
- "If you add a new crate, you should specify at least the `group`. This is one "
16431
- "of:"
16432
- msgstr ""
16433
-
16434
- #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:15
16435
- #: src/chromium/adding-third-party-crates/depending-on-a-crate.md:15
16436
- msgid "For instance,"
16437
- msgstr ""
16438
-
16439
- #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:22
16440
- msgid ""
16441
- "Depending on the crate source code layout, you may also need to use this "
16442
- "file to specify where its `LICENSE` file(s) can be found."
16443
- msgstr ""
16444
-
16445
- #: src/chromium/adding-third-party-crates/configuring-gnrt-config-toml.md:25
16446
- msgid ""
16447
- "Later, we'll see some other things you will need to configure in this file "
16448
- "to resolve problems."
16449
- msgstr ""
16450
-
16451
- #: src/chromium/adding-third-party-crates/downloading-crates.md:3
16452
- msgid ""
16453
- "A tool called `gnrt` knows how to download crates and how to generate `BUILD."
16454
- "gn` rules."
16455
- msgstr ""
16456
-
16457
- #: src/chromium/adding-third-party-crates/downloading-crates.md:6
16458
- msgid "To start, download the crate you want like this:"
16459
- msgstr ""
16460
-
16461
- #: src/chromium/adding-third-party-crates/downloading-crates.md:13
16462
- msgid ""
16463
- "Although the `gnrt` tool is part of the Chromium source code, by running "
16464
- "this command you will be downloading and running its dependencies from "
16465
- "`crates.io`. See [the earlier section](../cargo.md) discussing this security "
16466
- "decision."
16467
- msgstr ""
16468
-
16469
- #: src/chromium/adding-third-party-crates/downloading-crates.md:17
16470
- msgid "This `vendor` command may download:"
16471
- msgstr ""
16472
-
16473
- #: src/chromium/adding-third-party-crates/downloading-crates.md:19
16474
- #, fuzzy
16475
- msgid "Your crate"
16476
- msgstr "جعبههای (crates) کاربردی"
16477
-
16478
- #: src/chromium/adding-third-party-crates/downloading-crates.md:20
16479
- msgid "Direct and transitive dependencies"
16480
- msgstr ""
16481
-
16482
- #: src/chromium/adding-third-party-crates/downloading-crates.md:21
16483
- msgid ""
16484
- "New versions of other crates, as required by `cargo` to resolve the complete "
16485
- "set of crates required by Chromium."
16486
- msgstr ""
16487
-
16488
- #: src/chromium/adding-third-party-crates/downloading-crates.md:24
16489
- msgid ""
16490
- "Chromium maintains patches for some crates, kept in `//third_party/rust/"
16491
- "chromium_crates_io/patches`. These will be reapplied automatically, but if "
16492
- "patching fails you may need to take manual action."
16493
- msgstr ""
16494
-
16495
- #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:3
16496
- msgid ""
16497
- "Once you've downloaded the crate, generate the `BUILD.gn` files like this:"
16498
- msgstr ""
16499
-
16500
- #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:9
16501
- msgid "Now run `git status`. You should find:"
16502
- msgstr ""
16503
-
16504
- #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:11
16505
- msgid ""
16506
- "At least one new crate source code in `third_party/rust/chromium_crates_io/"
16507
- "vendor`"
16508
- msgstr ""
16509
-
16510
- #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:13
16511
- msgid ""
16512
- "At least one new `BUILD.gn` in `third_party/rust/<crate name>/v<major semver "
16513
- "version>`"
16514
- msgstr ""
16515
-
16516
- #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:15
16517
- msgid "An appropriate `README.chromium`"
16518
- msgstr ""
16519
-
16520
- #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:17
16521
- #, fuzzy
16522
- msgid ""
16523
- "The \"major semver version\" is a [Rust \"semver\" version number](https://"
16524
- "doc.rust-lang.org/cargo/reference/semver.html)."
16525
- msgstr ""
16526
- "لطفا به [مرجع Rust ](https://doc.rust-lang.org/reference/type-layout.html) "
16527
- "مراجعه کنید."
16528
-
16529
- #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:19
16530
- msgid ""
16531
- "Take a close look, especially at the things generated in `third_party/rust`."
16532
- msgstr ""
16533
-
16534
- #: src/chromium/adding-third-party-crates/generating-gn-build-rules.md:23
16535
- msgid ""
16536
- "Talk a little about semver --- and specifically the way that in Chromium "
16537
- "it's to allow multiple incompatible versions of a crate, which is "
16538
- "discouraged but sometimes necessary in the Cargo ecosystem."
16539
- msgstr ""
16540
-
16541
- #: src/chromium/adding-third-party-crates/resolving-problems.md:3
16542
- msgid ""
16543
- "If your build fails, it may be because of a `build.rs`: programs which do "
16544
- "arbitrary things at build time. This is fundamentally at odds with the "
16545
- "design of `gn` and `ninja` which aim for static, deterministic, build rules "
16546
- "to maximize parallelism and repeatability of builds."
16547
- msgstr ""
16548
-
16549
- #: src/chromium/adding-third-party-crates/resolving-problems.md:8
16550
- msgid ""
16551
- "Some `build.rs` actions are automatically supported; others require action:"
16552
- msgstr ""
16553
-
16554
- #: src/chromium/adding-third-party-crates/resolving-problems.md:10
16555
- msgid "build script effect"
16556
- msgstr ""
16557
-
16558
- #: src/chromium/adding-third-party-crates/resolving-problems.md:10
16559
- msgid "Supported by our gn templates"
16560
- msgstr ""
16561
-
16562
- #: src/chromium/adding-third-party-crates/resolving-problems.md:10
16563
- msgid "Work required by you"
16564
- msgstr ""
16565
-
16566
- #: src/chromium/adding-third-party-crates/resolving-problems.md:12
16567
- msgid "Checking rustc version to configure features on and off"
16568
- msgstr ""
16569
-
16570
- #: src/chromium/adding-third-party-crates/resolving-problems.md:12
16571
- #: src/chromium/adding-third-party-crates/resolving-problems.md:13
16572
- #: src/chromium/adding-third-party-crates/resolving-problems.md:14
16573
- msgid "Yes"
16574
- msgstr "بلی"
16575
-
16576
- #: src/chromium/adding-third-party-crates/resolving-problems.md:12
16577
- #: src/chromium/adding-third-party-crates/resolving-problems.md:13
16578
- msgid "None"
16579
- msgstr ""
16580
-
16581
- #: src/chromium/adding-third-party-crates/resolving-problems.md:13
16582
- msgid "Checking platform or CPU to configure features on and off"
16583
- msgstr ""
16584
-
16585
- #: src/chromium/adding-third-party-crates/resolving-problems.md:14
16586
- #, fuzzy
16587
- msgid "Generating code"
16588
- msgstr "جنریکها"
16589
-
16590
- #: src/chromium/adding-third-party-crates/resolving-problems.md:14
16591
- msgid "Yes - specify in `gnrt_config.toml`"
16592
- msgstr ""
16593
-
16594
- #: src/chromium/adding-third-party-crates/resolving-problems.md:15
16595
- msgid "Building C/C++"
16596
- msgstr ""
16597
-
16598
16219
#: src/chromium/adding-third-party-crates/resolving-problems.md:15
16599
16220
#: src/chromium/adding-third-party-crates/resolving-problems.md:16
16600
16221
msgid "No"
0 commit comments