question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

๐Ÿ› Error compiling simple rust project: multiple input filenames provided

See original GitHub issue

๐Ÿ› bug report

๐ŸŽ› Configuration (.babelrc, package.json, cli command)

package.json

{
  "name": "rust-wasm",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "MIT",
  "dependencies": {
    "parcel-bundler": "^1.5.1"
  }
}

Run parcel index.js

๐Ÿค” Expected Behavior

Should compile

๐Ÿ˜ฏ Current Behavior

Console output:

Server running at http://localhost:1234
๐Ÿšจ  /Users/rob/Development/testing/web/rust-wasm/ops.rs: Command failed: rustc +nightly --target wasm32-unknown-unknown -O --crate-type=cdylib /Users/rob/Development/testing/web/rust-wasm/ops.rs -o /Users/rob/Development/testing/web/rust-wasm/.cache/933d122f8546a30c5660c45821247fad.wasm
error: multiple input filenames provided

error: multiple input filenames provided


    at ChildProcess.exithandler (child_process.js:275:12)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:554:12)

๐Ÿ”ฆ Context

Just a simple test of Rust support

๐Ÿ’ป Code Sample

index.js

import { add } from './ops.rs'

console.log(add(4, 6))

ops.rs

#[no_mangle]
pub fn add(a: i32, b: i32) -> i32 {
  return a + b
}

๐ŸŒ Your Environment

Software Version(s)
Parcel 1.5.1
Node v8.9.3
npm/Yarn npm 5.5.1
Operating System macOS 10.13.4 beta (17E139j)
Rust nightly-x86_64-apple-darwin unchanged - rustc 1.25.0-nightly (90eb44a58 2018-01-29)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
robjtedecommented, Feb 1, 2018

Okay, so it turns out that rustc installed via homebrew doesnโ€™t respect the +nightly modifier. That coupled with rustup being used to install toolchains and such results in the case where the toolchains are installed to the ~/.cargo installation but parcel tries to use (rightly) the first occurence of rustc in the PATH; which in this case was the homebrew version.

TL;DR: uninstalled homebrew version. it works now.

0reactions
albizurescommented, Feb 1, 2018

ooh right, so but you could try, setting nightly as default and without the flag

Read more comments on GitHub >

github_iconTop Results From Across the Web

Clippy: "error: multiple input filenames provided" - help
I'm trying to use Clippy for the first time in order to improve my code. I am using the latest nightly build nightly-x86_64-unknown-linux-gnu...
Read more >
Rust: Structuring and handling errors in 2020 - Nick Groenen
In this example the file name is an input argument for the program itself. This makes it easy to correlate the error to...
Read more >
mail-client/thunderbird-68.2.1 - src_configure(): rustup which ...
Unable to compile thunderbird due to absent 'rustup'. There is no ebuild available to install rustup in main portage tree and looks likeย ......
Read more >
Clang linking error MacOS Big Sur | Apple Developer Forums
Below a verbose screenshot of my build error message. ... -discard-value-names -main-file-name helloworld.cpp -mrelocation-model pic -pic-level 2 ...
Read more >
Writing R Extensions - The Comprehensive R Archive Network
8.1.1 Compiling against the R library; 8.1.2 Setting R callbacks ... If the intention is to give an error if the suggested package...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found