Skip to content

--dep-info doesn't reflect real output filename when using -c or --emit-llvm #11667

Closed
@yuriks

Description

@yuriks

Usually, --dep-info would be used to generate dependency information to be included in a Makefile. However, when using the -c or --emit-llvm flags, along with --out-dir, the generated info doesn't have the correct names for the output files. When -c is used to compile foo.rs, it's output as foo.o, and when --emit-llvm is used, as foo.bc. On both cases the dependency info lists the full library name as it would've been output if none of the option were given. For example:

rustc --emit-llvm --staticlib --out-dir obj/ -L obj/ --dep-info obj/main.d src/main.rs

Outputs obj/main.bc, but obj/main.d has the following contents:

obj/libmain-66af34bf-0.0.a: src/main.rs src/efi.rs

The dependency info should be change to reflect the name of the files actually being output by the compiler for the given command.

EDIT: Realized it also doesn't track any external modules used by the crate as dependencies. (In this case libcore-2e829c2f-0.0.rlib and libextensions-d5bbcef2-0.0.so.) This might be on purpose, but doesn't seem ideal to me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions