Cargo: warning: unused manifest key: build

Created on 11 Aug 2017  路  5Comments  路  Source: rust-lang/cargo

Hi,

I'm a beginner in rust trying to get WASM development set up using this article.

I am getting error: could not exec the linker emcc : No such file or directory when I do cargo build.

I referred this article where it shows how to define build and linker configs using .cargo/config.

So I added following blocks to my Cargo.toml and .cargo/config.toml:

[build]
target = "wasm32-unknown-emscripten"

[target.wasm32-unknown-emscripten]
linker = "/Users/yugoja/emsdk-portable/clang/fastcomp/build_incoming_64/bin"

Now when I run cargo build, I get following warnings:

warning: unused manifest key: build
warning: unused manifest key: target.wasm32-unknown-emscripten.linker

It seems cargo is not using my configs. How can I fix this?

Most helpful comment

Thanks for you help @behnam!

I'll close this issue and head over to users forum.

All 5 comments

@yugoja, you only need to add these fields to your Cargo config file, not the manifest file. Although they look similar, they have different functionalities.

Here's more: http://doc.crates.io/config.html

And, as a side note: you can take these kinds of help wanted questions to the Rust Users Forum: https://users.rust-lang.org/. Filing issues here in repo is best when you find something wrong with Cargo code or documentations. If none of those is a matter here, we can close this issue. :)

Just to make it clear: you've added them to the config, which is fine and what you need. But, you should not add those to your manifest file, and this is why you get the warnings.

Hi @behnam
Thank you for your reply.
From now on I'll use Rust Users forum for my help questions.

But for this current issue, I removed the build and target keys from manifest file. After doing this, when I ran cargo build, it didn't give any warnings but my configs were still unused.

When I ran cargo build --target=wasm32-unknown-emscripten, I'm still getting linker error.

Am I doing something wrong?

Unfortunately, I don't have any experience with wasm/emscripten, so won't be able to help. But there are many posts on the users forum which may give you a hint. It would also help you finding an answer if you share the exact error messages you are receiving. Hope you can get it fixed soon.

Thanks for you help @behnam!

I'll close this issue and head over to users forum.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ckaran picture ckaran  路  3Comments

japaric picture japaric  路  3Comments

fprijate picture fprijate  路  3Comments

mathstuf picture mathstuf  路  3Comments

rodoufu picture rodoufu  路  3Comments