Skip to content

Incremental compilation and codegen that produces no object files #123234

Closed
@pacak

Description

@pacak

It is possible to ask rustc to produce intermediate files (assembly, llvm-ir) without asking to produce object files. This works fine as long as incremental compilation is disabled. Once it is enabled - it fails in all sorts of ways - multiple asserts and with those removed - it fails to restore intermediate product from the cache since they are not cached (#123221 deals with that).

rm -rf *
touch lib.rs
rustc --emit asm --crate-type lib lib.rs -C incremental=foo
rustc --emit asm --crate-type lib lib.rs -C incremental=foo 

Fails with this (and more)

thread 'cpy tzqeezh2sedvpj0' panicked at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/compiler/rustc_codegen_ssa/src/back/write.rs:890:5:
assertion failed: module_config.emit_obj != EmitObj::None

Options are:

  1. remove the asserts or allow them to pass if user never asked for object code in the first place
  2. change the logic such that requesting for byproducts implies request for object files

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationA-incr-compArea: Incremental compilationC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions