jasondyoungberg/limine-rust-template

The template will (very subtly) break if you change the Cargo crate's name.

Closed this issue · 1 comments

To Replicate:

First, you need to compile some kernel code.

Now, try changing your code slightly. If we're using the example in this repo, then try changing the colour after you have changed the package name. Note that, for some reason, it does not change?

Cause:

In the GNUmakefile inside the /kernel/ subdirectory, there is a hardcoded directory that will copy from target/x86_64-unknown-none/$(RUST_PROFILE_SUBDIR)/rust-limine-template, no matter what. It does not use the current package name. This means that if you compile some code under the rust-limine-template name, and then later change it, you will continue to use the old code and will subsequently pull your hair out because you think you're an idiot.

Solution?:

There might be a way to dynamically acquire the package name from the Cargo.toml file, but honestly, I am not aware of one and it doesn't seem like cargo offers such a feature (though I might be wrong).

Thank you! :)