Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--emit metadata=some/path/libfoo-abc-123.rmeta doesn't work #85356

Closed
jsgf opened this issue May 16, 2021 · 1 comment · Fixed by #85362
Closed

--emit metadata=some/path/libfoo-abc-123.rmeta doesn't work #85356

jsgf opened this issue May 16, 2021 · 1 comment · Fixed by #85362
Labels
C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jsgf
Copy link
Contributor

jsgf commented May 16, 2021

I tried this code:

foo.rs:

pub fn foo() { println!("foo") }
$ mkdir out
$ rustc --crate-name foo --crate-type rlib --emit metadata=out/libfoo-abc-123.rmeta foo.rs

I expected to see this happen:
I expected this to output out/libfoo-abc-123.rmeta, as documented ("Each emission type may also specify the output filename with the form KIND=PATH, which takes precedence over the -o flag.").

Instead, this happened:
It created libfoo.rmeta in the current directory.

Meta

rustc --version --verbose:

rustc 1.54.0-nightly (8cf990c9b 2021-05-15)
binary: rustc
commit-hash: 8cf990c9b5c59f25c806fad9f4466f9d6509bbea
commit-date: 2021-05-15
host: x86_64-unknown-linux-gnu
release: 1.54.0-nightly
LLVM version: 12.0.1
@jsgf jsgf added the C-bug Category: This is a bug. label May 16, 2021
@jsgf
Copy link
Contributor Author

jsgf commented May 16, 2021

This only seems to affect metadata - all the others work as expected.

@jonas-schievink jonas-schievink added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 16, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue May 30, 2021
Use command line metadata path if provided

If the command-line has `--emit metadata=some/path/libfoo.rmeta` then
use that.

Closes rust-lang#85356

I couldn't find any existing tests for the `--emit TYPE=PATH` command line syntax, so I wasn't sure how to test this aside from ad-hoc manual testing. Is there a ui test type for "generated output file with expected name"?
bors added a commit to rust-lang-ci/rust that referenced this issue May 30, 2021
Use command line metadata path if provided

If the command-line has `--emit metadata=some/path/libfoo.rmeta` then
use that.

Closes rust-lang#85356

I couldn't find any existing tests for the `--emit TYPE=PATH` command line syntax, so I wasn't sure how to test this aside from ad-hoc manual testing. Is there a ui test type for "generated output file with expected name"?
@bors bors closed this as completed in 2835351 May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants