Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions blog/content/edition-2/posts/02-minimal-rust-kernel/index.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,37 @@ Ahora podemos construir el kernel para nuestro nuevo objetivo pasando el nombre
```
> cargo build --target x86_64-blog_os.json

error: `.json` target specs require -Zjson-target-spec
```

¡Falla! El error nos indica que las especificaciones de objetivo JSON personalizadas son una característica inestable que requiere habilitación explícita. Esto se debe a que el formato de los archivos JSON de objetivo aún no se considera estable, por lo que podrían ocurrir cambios en futuras versiones de Rust. Consulta el [issue de seguimiento para especificaciones de objetivo JSON personalizadas][json-target-spec-issue] para más información.

[json-target-spec-issue]: https://github.com/rust-lang/rust/issues/151528

#### La Opción `json-target-spec`

Para habilitar el soporte para especificaciones de objetivo JSON personalizadas, necesitamos crear un archivo de configuración local de [cargo] en `.cargo/config.toml` (la carpeta `.cargo` debería estar junto a tu carpeta `src`) con el siguiente contenido:

[cargo]: https://doc.rust-lang.org/cargo/reference/config.html

```toml
# en .cargo/config.toml

[unstable]
json-target-spec = true
```

Esto habilita la característica inestable `json-target-spec`, permitiéndonos usar archivos JSON de objetivo personalizados.

Con esta configuración en su lugar, intentemos construir nuevamente:

```
> cargo build --target x86_64-blog_os.json

error[E0463]: can't find crate for `core`
```

¡Falla! El error nos indica que el compilador de Rust ya no encuentra la [biblioteca `core`]. Esta biblioteca contiene tipos básicos de Rust como `Result`, `Option` e iteradores, y se vincula implícitamente a todos los crates con `no_std`.
¡Ahora vemos un error diferente! El error nos indica que el compilador de Rust ya no encuentra la [biblioteca `core`]. Esta biblioteca contiene tipos básicos de Rust como `Result`, `Option` e iteradores, y se vincula implícitamente a todos los crates con `no_std`.

[biblioteca `core`]: https://doc.rust-lang.org/nightly/core/index.html

Expand All @@ -264,14 +291,13 @@ Aquí es donde entra en juego la característica [`build-std`] de cargo. Esta pe
[`build-std`]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std
[compiladores de Rust nightly]: #instalacion-de-rust-nightly

Para usar esta característica, necesitamos crear un archivo de configuración local de [cargo] en `.cargo/config.toml` (la carpeta `.cargo` debería estar junto a tu carpeta `src`) con el siguiente contenido:

[cargo]: https://doc.rust-lang.org/cargo/reference/config.html
Para usar esta característica, necesitamos añadir lo siguiente a nuestro archivo de configuración de [cargo] en `.cargo/config.toml`:

```toml
# en .cargo/config.toml

[unstable]
json-target-spec = true
build-std = ["core", "compiler_builtins"]
```

Expand Down Expand Up @@ -312,6 +338,7 @@ Afortunadamente, el crate `compiler_builtins` ya contiene implementaciones para
# en .cargo/config.toml

[unstable]
json-target-spec = true
build-std-features = ["compiler-builtins-mem"]
build-std = ["core", "compiler_builtins"]
```
Expand Down
34 changes: 32 additions & 2 deletions blog/content/edition-2/posts/02-minimal-rust-kernel/index.fa.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,37 @@ pub extern "C" fn _start() -> ! {
```
> cargo build --target x86_64-blog_os.json

error: `.json` target specs require -Zjson-target-spec
```

شکست میخورد! این خطا به ما می‌گوید که مشخصات هدف JSON سفارشی یک ویژگی ناپایدار است که نیاز به فعال‌سازی صریح دارد. این به این دلیل است که فرمت فایل‌های هدف JSON هنوز پایدار در نظر گرفته نمی‌شود، بنابراین ممکن است در نسخه‌های آینده Rust تغییر کند. برای اطلاعات بیشتر به [مسئله پیگیری مشخصات هدف JSON سفارشی][json-target-spec-issue] مراجعه کنید.

[json-target-spec-issue]: https://github.com/rust-lang/rust/issues/151528

#### آپشن `json-target-spec`

برای فعال کردن پشتیبانی از مشخصات هدف JSON سفارشی، ما نیاز داریم تا یک فایل [پیکربندی کارگو] در `cargo/config.toml.` (پوشه `cargo.` باید کنار پوشه `src` شما باشد) با محتوای زیر بسازیم:

[پیکربندی کارگو]: https://doc.rust-lang.org/cargo/reference/config.html

```toml
# in .cargo/config.toml

[unstable]
json-target-spec = true
```

این ویژگی ناپایدار `json-target-spec` را فعال می‌کند و به ما امکان استفاده از فایل‌های هدف JSON سفارشی را می‌دهد.

حالا با این پیکربندی، بیایید دوباره بسازیم:

```
> cargo build --target x86_64-blog_os.json

error[E0463]: can't find crate for `core`
```

شکست میخورد! این خطا به ما می‌گوید که کامپایلر Rust دیگر [کتابخانه `core`] را پیدا نمی‌کند. این کتابخانه شامل انواع اساسی Rust مانند `Result` ، `Option` و iterators است، و به طور ضمنی به همه کریت‌های `no_std` لینک است.
حالا یک خطای متفاوت می‌بینیم! این خطا به ما می‌گوید که کامپایلر Rust دیگر [کتابخانه `core`] را پیدا نمی‌کند. این کتابخانه شامل انواع اساسی Rust مانند `Result` ، `Option` و iterators است، و به طور ضمنی به همه کریت‌های `no_std` لینک است.

[کتابخانه `core`]: https://doc.rust-lang.org/nightly/core/index.html

Expand All @@ -276,12 +303,13 @@ error[E0463]: can't find crate for `core`
[ویژگی `build-std`]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std
[نسخه شبانه کامپایلر Rust]: #installing-rust-nightly

برای استفاده از این ویژگی، ما نیاز داریم تا یک فایل [پیکربندی کارگو] در `cargo/config.toml.` با محتوای زیر بسازیم:
برای استفاده از این ویژگی، باید موارد زیر را به فایل [پیکربندی کارگو] در `cargo/config.toml.` اضافه کنیم:

```toml
# in .cargo/config.toml

[unstable]
json-target-spec = true
build-std = ["core", "compiler_builtins"]
```

Expand Down Expand Up @@ -322,7 +350,9 @@ build-std = ["core", "compiler_builtins"]
# in .cargo/config.toml

[unstable]
json-target-spec = true
build-std-features = ["compiler-builtins-mem"]
build-std = ["core", "compiler_builtins"]
```
پشتیبانی برای ویژگی `compiler-builtins-mem` [به تازگی اضافه شده](https://github.com/rust-lang/rust/pull/77284)، پس حداقل به نسخه‌ شبانه‌ `2020-09-30` نیاز دارید.

Expand Down
33 changes: 31 additions & 2 deletions blog/content/edition-2/posts/02-minimal-rust-kernel/index.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,37 @@ Nous pouvons maintenant construire le noyau pour notre nouvelle cible en fournis
```
> cargo build --target x86_64-blog_os.json

error: `.json` target specs require -Zjson-target-spec
```

Cela échoue! L'erreur nous dit que les spécifications de cibles JSON personnalisées sont une fonctionnalité instable qui nécessite une activation explicite. Cela s'explique par le fait que le format des fichiers JSON de cible n'est pas encore considéré comme stable, donc des modifications pourraient avoir lieu dans les futures versions de Rust. Consultez l'[issue de suivi pour les spécifications de cibles JSON personnalisées][json-target-spec-issue] pour plus d'informations.

[json-target-spec-issue]: https://github.com/rust-lang/rust/issues/151528

#### L'option `json-target-spec`

Pour activer le support des spécifications de cibles JSON personnalisées, nous devons créer un fichier de [configuration cargo][cargo configuration] dans `.cargo/config.toml` (le dossier `.cargo` doit être à côté de votre dossier `src`) avec le contenu suivant:

[cargo configuration]: https://doc.rust-lang.org/cargo/reference/config.html

```toml
# dans .cargo/config.toml

[unstable]
json-target-spec = true
```

Ceci active la fonctionnalité instable `json-target-spec`, nous permettant d'utiliser des fichiers JSON de cible personnalisés.

Avec cette configuration en place, essayons de construire à nouveau:

```
> cargo build --target x86_64-blog_os.json

error[E0463]: can't find crate for `core`
```

Cela échoue! L'erreur nous dit que le compilateur ne trouve plus la [bibliothèque `core`][`core` library]. Cette bibliothèque contient les types de base Rust comme `Result`, `Option`, les itérateurs, et est implicitement liée à toutes les crates `no_std`.
Maintenant nous voyons une erreur différente! L'erreur nous dit que le compilateur ne trouve plus la [bibliothèque `core`][`core` library]. Cette bibliothèque contient les types de base Rust comme `Result`, `Option`, les itérateurs, et est implicitement liée à toutes les crates `no_std`.

[`core` library]: https://doc.rust-lang.org/nightly/core/index.html

Expand All @@ -272,12 +299,13 @@ C'est ici que la [fonctionnalité `build-std`][`build-std` feature] de cargo ent
[`build-std` feature]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std
[nightly Rust compilers]: #installer-une-version-nocturne-de-rust

Pour utiliser cette fonctionnalité, nous devons créer un fichier de [configuration cargo][cargo configuration] dans `.cargo/config.toml` avec le contenu suivant:
Pour utiliser cette fonctionnalité, nous devons ajouter ce qui suit à notre fichier de [configuration cargo][cargo configuration] dans `.cargo/config.toml`:

```toml
# dans .cargo/config.toml

[unstable]
json-target-spec = true
build-std = ["core", "compiler_builtins"]
```

Expand Down Expand Up @@ -318,6 +346,7 @@ Heureusement, la crate `compiler_builtins` contient déjà des implémentations
# dans .cargo/config.toml

[unstable]
json-target-spec = true
build-std-features = ["compiler-builtins-mem"]
build-std = ["core", "compiler_builtins"]
```
Expand Down
36 changes: 33 additions & 3 deletions blog/content/edition-2/posts/02-minimal-rust-kernel/index.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,37 @@ pub extern "C" fn _start() -> ! {
```
> cargo build --target x86_64-blog_os.json

error: `.json` target specs require -Zjson-target-spec
```

失敗しましたね!エラーは、カスタムJSONターゲット仕様は明示的な有効化が必要な不安定機能であると言っています。これは、JSONターゲットファイルのフォーマットがまだ安定と見なされていないため、将来のRustのバージョンで変更される可能性があるからです。詳細は[カスタムJSONターゲット仕様のトラッキングissue][json-target-spec-issue]をご覧ください。

[json-target-spec-issue]: https://github.com/rust-lang/rust/issues/151528

#### `json-target-spec`オプション

カスタムJSONターゲット仕様のサポートを有効にするためには、[cargoの設定][cargo configuration]ファイルを`.cargo/config.toml`に作り(`.cargo`フォルダは`src`フォルダの横に置きます)、次の内容を書きましょう:

[cargo configuration]: https://doc.rust-lang.org/cargo/reference/config.html

```toml
# in .cargo/config.toml

[unstable]
json-target-spec = true
```

これにより不安定な`json-target-spec`機能が有効になり、カスタムJSONターゲットファイルを使用できるようになります。

この設定を行ったら、もう一度ビルドしてみましょう:

```
> cargo build --target x86_64-blog_os.json

error[E0463]: can't find crate for `core`
```

失敗しましたね!エラーはRustコンパイラが[`core`ライブラリ][`core` library]を見つけられなくなったと言っています。このライブラリは、`Result` や `Option`、イテレータのような基本的なRustの型を持っており、暗黙のうちにすべての`no_std`なクレートにリンクされています。
今度は別のエラーが出ました!エラーはRustコンパイラが[`core`ライブラリ][`core` library]を見つけられなくなったと言っています。このライブラリは、`Result` や `Option`、イテレータのような基本的なRustの型を持っており、暗黙のうちにすべての`no_std`なクレートにリンクされています。

[`core` library]: https://doc.rust-lang.org/nightly/core/index.html

Expand All @@ -270,12 +297,13 @@ error[E0463]: can't find crate for `core`
[`build-std` feature]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std
[nightly Rust compilers]: #installing-rust-nightly

この機能を使うためには、[cargoの設定][cargo configuration]ファイルを`.cargo/config.toml`に作り、次の内容を書きましょう。
この機能を使うためには、[cargoの設定][cargo configuration]ファイル`.cargo/config.toml`に以下を追加しましょう:

```toml
# in .cargo/config.toml

[unstable]
json-target-spec = true
build-std = ["core", "compiler_builtins"]
```

Expand Down Expand Up @@ -316,10 +344,12 @@ Rustコンパイラは、すべてのシステムにおいて、特定の組み
# in .cargo/config.toml

[unstable]
json-target-spec = true
build-std-features = ["compiler-builtins-mem"]
build-std = ["core", "compiler_builtins"]
```

(`compiler-builtins-mem`機能のサポートが追加されたのは[つい最近](https://github.com/rust-lang/rust/pull/77284)なので、`2019-09-30`以降のRust nightlyが必要です。)
(`compiler-builtins-mem`機能のサポートが追加されたのは[つい最近](https://github.com/rust-lang/rust/pull/77284)なので、`2020-09-30`以降のRust nightlyが必要です。)

このとき、裏で`compiler_builtins`クレートの[`mem`機能][`mem` feature]が有効化されています。これにより、このクレートの[`memcpy`などの実装][`memcpy` etc. implementations]に`#[unsafe(no_mangle)]`アトリビュートが適用され、リンカがこれらを利用できるようになっています。

Expand Down
33 changes: 31 additions & 2 deletions blog/content/edition-2/posts/02-minimal-rust-kernel/index.ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,37 @@ pub extern "C" fn _start() -> ! {
```
> cargo build --target x86_64-blog_os.json

error: `.json` target specs require -Zjson-target-spec
```

실패하였군요! 이 오류는 커스텀 JSON 타겟 스펙이 명시적인 활성화가 필요한 불안정한 기능이라는 것을 알려줍니다. JSON 타겟 파일의 형식이 아직 안정적으로 간주되지 않기 때문에 미래 Rust 버전에서 변경될 수 있습니다. 자세한 정보는 [커스텀 JSON 타겟 스펙 트래킹 이슈][json-target-spec-issue]를 참조하세요.

[json-target-spec-issue]: https://github.com/rust-lang/rust/issues/151528

#### `json-target-spec` 기능

커스텀 JSON 타겟 스펙 지원을 활성화하려면, [cargo 설정][cargo configuration] 파일 `.cargo/config.toml`을 생성해야 합니다 (`.cargo` 폴더는 `src` 폴더 옆에 위치해야 합니다):

[cargo configuration]: https://doc.rust-lang.org/cargo/reference/config.html

```toml
# .cargo/config.toml 에 들어갈 내용

[unstable]
json-target-spec = true
```

이를 통해 불안정한 `json-target-spec` 기능이 활성화되어 커스텀 JSON 타겟 파일을 사용할 수 있게 됩니다.

이 설정을 완료한 후, 다시 빌드해 봅시다:

```
> cargo build --target x86_64-blog_os.json

error[E0463]: can't find crate for `core`
```

실패하였군요! 이 오류는 Rust 컴파일러가 더 이상 [`core` 라이브러리][`core` library]를 찾지 못한다는 것을 알려줍니다. 이 라이브러리는 `Result`와 `Option` 그리고 반복자 등 Rust의 기본적인 타입들을 포함하며, 모든 `no_std` 크레이트에 암시적으로 링크됩니다.
이제 다른 오류가 발생합니다! 이 오류는 Rust 컴파일러가 더 이상 [`core` 라이브러리][`core` library]를 찾지 못한다는 것을 알려줍니다. 이 라이브러리는 `Result`와 `Option` 그리고 반복자 등 Rust의 기본적인 타입들을 포함하며, 모든 `no_std` 크레이트에 암시적으로 링크됩니다.

[`core` library]: https://doc.rust-lang.org/nightly/core/index.html

Expand All @@ -280,12 +307,13 @@ error[E0463]: can't find crate for `core`
[`build-std` feature]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std
[nightly Rust compilers]: #installing-rust-nightly

해당 기능을 사용하려면, [cargo 설정][cargo configuration] 파일 `.cargo/config.toml` 아래와 같이 만들어야 합니다:
해당 기능을 사용하려면, [cargo 설정][cargo configuration] 파일 `.cargo/config.toml` 아래와 같이 추가해야 합니다:

```toml
# .cargo/config.toml 에 들어갈 내용

[unstable]
json-target-spec = true
build-std = ["core", "compiler_builtins"]
```

Expand Down Expand Up @@ -326,6 +354,7 @@ Rust 컴파일러는 특정 군의 내장 함수들이 (built-in function) 모
# .cargo/config.toml 에 들어갈 내용

[unstable]
json-target-spec = true
build-std-features = ["compiler-builtins-mem"]
build-std = ["core", "compiler_builtins"]
```
Expand Down
33 changes: 31 additions & 2 deletions blog/content/edition-2/posts/02-minimal-rust-kernel/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,37 @@ We can now build the kernel for our new target by passing the name of the JSON f
```
> cargo build --target x86_64-blog_os.json

error: `.json` target specs require -Zjson-target-spec
```

It fails! The error tells us that custom JSON target specifications are an unstable feature that requires explicit opt-in. This is because the format of the JSON target files is not considered stable yet, so changes to it might occur in future versions of Rust. See the [tracking issue for custom JSON target specs][json-target-spec-issue] for more information.

[json-target-spec-issue]: https://github.com/rust-lang/rust/issues/151528

#### The `json-target-spec` Option

To enable support for custom JSON target specifications, we need to create a local [cargo configuration] file at `.cargo/config.toml` (the `.cargo` folder should be next to your `src` folder) with the following content:

[cargo configuration]: https://doc.rust-lang.org/cargo/reference/config.html

```toml
# in .cargo/config.toml

[unstable]
json-target-spec = true
```

This enables the unstable `json-target-spec` feature, allowing us to use custom JSON target files.

With this configuration in place, let's try building again:

```
> cargo build --target x86_64-blog_os.json

error[E0463]: can't find crate for `core`
```

It fails! The error tells us that the Rust compiler no longer finds the [`core` library]. This library contains basic Rust types such as `Result`, `Option`, and iterators, and is implicitly linked to all `no_std` crates.
It still fails, but with a new error. The error tells us that the Rust compiler does not find the [`core` library]. This library contains basic Rust types such as `Result`, `Option`, and iterators, and is implicitly linked to all `no_std` crates.

[`core` library]: https://doc.rust-lang.org/nightly/core/index.html

Expand All @@ -267,12 +294,13 @@ That's where the [`build-std` feature] of cargo comes in. It allows to recompile
[`build-std` feature]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#build-std
[nightly Rust compilers]: #installing-rust-nightly

To use the feature, we need to create a local [cargo configuration] file at `.cargo/config.toml` (the `.cargo` folder should be next to your `src` folder) with the following content:
To use the feature, we need to add the following to our [cargo configuration] file at `.cargo/config.toml`:

```toml
# in .cargo/config.toml

[unstable]
json-target-spec = true
build-std = ["core", "compiler_builtins"]
```

Expand Down Expand Up @@ -313,6 +341,7 @@ Fortunately, the `compiler_builtins` crate already contains implementations for
# in .cargo/config.toml

[unstable]
json-target-spec = true
build-std-features = ["compiler-builtins-mem"]
build-std = ["core", "compiler_builtins"]
```
Expand Down
Loading
Loading