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

Mark Emscripten's .wasm files auxiliary #7476

Merged
merged 3 commits into from
Oct 4, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/cargo/core/compiler/build_context/target_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ pub struct TargetInfo {
pub enum FileFlavor {
/// Not a special file type.
Normal,
/// Like `Normal`, but not directly executable
Auxiliary,
/// Something you can link against (e.g., a library).
Linkable { rmeta: bool },
/// Piece of external debug information (e.g., `.dSYM`/`.pdb` file).
Expand Down Expand Up @@ -253,10 +255,15 @@ impl TargetInfo {

// See rust-lang/cargo#4535.
if target_triple.starts_with("wasm32-") && crate_type == "bin" && suffix == ".js" {
let flavor = if target_triple.contains("emscripten") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to skip the emscripten check here, I think wasm32 targets that primarily emit a js file are always emscripten targets

FileFlavor::Auxiliary
} else {
FileFlavor::Normal
};
ret.push(FileType {
suffix: ".wasm".to_string(),
prefix: prefix.clone(),
flavor: FileFlavor::Normal,
flavor,
should_replace_hyphens: true,
})
}
Expand Down
3 changes: 2 additions & 1 deletion src/cargo/core/compiler/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ impl<'a, 'cfg> Context<'a, 'cfg> {

for unit in units.iter() {
for output in self.outputs(unit)?.iter() {
if output.flavor == FileFlavor::DebugInfo {
if output.flavor == FileFlavor::DebugInfo || output.flavor == FileFlavor::Auxiliary
{
continue;
}

Expand Down