From 6f1f87215892c2be12c6973a6f753c9a25c34b7e Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Fri, 17 Jul 2020 11:57:17 +0200 Subject: [PATCH] Rename `.cargo/config` files to `.cargo/config.toml` The latter makes it more clear what kind of file it is. --- .../posts/01-freestanding-rust-binary/index.md | 6 +++--- .../second-edition/posts/02-minimal-rust-kernel/index.md | 6 +++--- blog/content/second-edition/posts/04-testing/index.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/blog/content/second-edition/posts/01-freestanding-rust-binary/index.md b/blog/content/second-edition/posts/01-freestanding-rust-binary/index.md index f09496de..77e5832c 100644 --- a/blog/content/second-edition/posts/01-freestanding-rust-binary/index.md +++ b/blog/content/second-edition/posts/01-freestanding-rust-binary/index.md @@ -423,10 +423,10 @@ Now our program should build successfully on macOS. #### Unifying the Build Commands -Right now we have different build commands depending on the host platform, which is not ideal. To avoid this, we can create a file named `.cargo/config` that contains the platform specific arguments: +Right now we have different build commands depending on the host platform, which is not ideal. To avoid this, we can create a file named `.cargo/config.toml` that contains the platform specific arguments: ```toml -# in .cargo/config +# in .cargo/config.toml [target.'cfg(target_os = "linux")'] rustflags = ["-C", "link-arg=-nostartfiles"] @@ -438,7 +438,7 @@ rustflags = ["-C", "link-args=/ENTRY:_start /SUBSYSTEM:console"] rustflags = ["-C", "link-args=-e __start -static -nostartfiles"] ``` -The `rustflags` key contains arguments that are automatically added to every invocation of `rustc`. For more information on the `.cargo/config` file check out the [official documentation](https://doc.rust-lang.org/cargo/reference/config.html). +The `rustflags` key contains arguments that are automatically added to every invocation of `rustc`. For more information on the `.cargo/config.toml` file check out the [official documentation](https://doc.rust-lang.org/cargo/reference/config.html). Now our program should be buildable on all three platforms with a simple `cargo build`. diff --git a/blog/content/second-edition/posts/02-minimal-rust-kernel/index.md b/blog/content/second-edition/posts/02-minimal-rust-kernel/index.md index b3a0a770..2e8786bd 100644 --- a/blog/content/second-edition/posts/02-minimal-rust-kernel/index.md +++ b/blog/content/second-edition/posts/02-minimal-rust-kernel/index.md @@ -283,12 +283,12 @@ Now we are able to build our kernel for a bare metal target. However, our `_star ### Set a Default Target -To avoid passing the `--target` parameter on every invocation of `cargo xbuild`, we can override the default target. To do this, we create a [cargo configuration] file at `.cargo/config` with the following content: +To avoid passing the `--target` parameter on every invocation of `cargo xbuild`, we can override the default target. To do this, we create a [cargo configuration] file at `.cargo/config.toml` with the following content: [cargo configuration]: https://doc.rust-lang.org/cargo/reference/config.html ```toml -# in .cargo/config +# in .cargo/config.toml [build] target = "x86_64-blog_os.json" @@ -434,7 +434,7 @@ After writing the image to the USB stick, you can run it on real hardware by boo To make it easier to run our kernel in QEMU, we can set the `runner` configuration key for cargo: ```toml -# in .cargo/config +# in .cargo/config.toml [target.'cfg(target_os = "none")'] runner = "bootimage runner" diff --git a/blog/content/second-edition/posts/04-testing/index.md b/blog/content/second-edition/posts/04-testing/index.md index d47af070..08d03c75 100644 --- a/blog/content/second-edition/posts/04-testing/index.md +++ b/blog/content/second-edition/posts/04-testing/index.md @@ -22,7 +22,7 @@ This blog is openly developed on [GitHub]. If you have any problems or questions ## Requirements -This post replaces the (now deprecated) [_Unit Testing_] and [_Integration Tests_] posts. It assumes that you have followed the [_A Minimal Rust Kernel_] post after 2019-04-27. Mainly, it requires that you have a `.cargo/config` file that [sets a default target] and [defines a runner executable]. +This post replaces the (now deprecated) [_Unit Testing_] and [_Integration Tests_] posts. It assumes that you have followed the [_A Minimal Rust Kernel_] post after 2019-04-27. Mainly, it requires that you have a `.cargo/config.toml` file that [sets a default target] and [defines a runner executable]. [_Unit Testing_]: @/second-edition/posts/deprecated/04-unit-testing/index.md [_Integration Tests_]: @/second-edition/posts/deprecated/05-integration-tests/index.md