Skip to content

--emit dep-info is a little difficult to use #28716

Closed
@alexcrichton

Description

@alexcrichton

The compiler's dep-info output doesn't work quite as one might expect when
coming from the land of gcc/clang, for example:

  1. If only a dep-info file is generated, the output filename is pretty
    unlikely to what's going to be compiled later on:

    $ rustc foo.rs --emit dep-info
    $ ls
    foo.d  foo.rs
    
  2. If a dep-info and link file are generated, you can't customize the output
    filename of the dep-info file:

    $ rustc foo.rs --emit dep-info,link -o foo.pp
    warning: ignoring specified output filename because multiple outputs were requested
    $ ls
    foo.d       foo.rs      libfoo.rlib
    

The compiler probably wants the ability to specify a dedicated location for the dep-info file during the same compilation of a staticlib or executable. For example, something like:

    --dep-file FILE     Configure output location of the dep-info output

This would allow customizing the output location as well as enabling dep-info to know what the actual output artifact is (e.g. of the link output type).

Some more info can be found on this bug.

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