Skip to content

Weird namespace collision thing #1528

@ValorZard

Description

@ValorZard

🐛 Bug description

PS C:\rust-workspace\tutorial8-depth> cargo run
warning: output filename collision.
The bin target `test-game` in package `test-game v0.1.0 (C:\rust-workspace\tutorial8-depth)` has the same output filename as the lib target `test_game` in package `test-game v0.1.0 (C:\rust-workspace\tutorial8-depth)`.
Colliding filename is: C:\rust-workspace\tutorial8-depth\target\debug\deps\test_game.pdb
The output filenames should be unique.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
If this looks unexpected, it may be a bug in Cargo. Please file a bug report at
https://github.com/rust-lang/cargo/issues/ with as much information as you
can provide.
cargo 1.90.0 (840b83a10 2025-07-30) running on `x86_64-pc-windows-msvc` target `x86_64-pc-windows-msvc`
First unit: Unit { pkg: Package { id: PackageId { name: "test-game", version: "0.1.0", source: "C:\\rust-workspace\\tutorial8-depth" }, ..: ".." }, target: TargetInner { name: "test-game", doc: true, ..: with_path("C:\\rust-workspace\\tutorial8-depth\\src\\main.rs", Edition2024) }, profile: Profile { ..: default_dev() }, kind: Host, mode: Build, features: [], rustflags: [], rustdocflags: [], links_overrides: {}, artifact: false, artifact_target_for_features: None, is_std: false, dep_hash: 8907886903843558320 }
Second unit: Unit { pkg: Package { id: PackageId { name: "test-game", version: "0.1.0", source: "C:\\rust-workspace\\tutorial8-depth" }, ..: ".." }, target: TargetInner { name_inferred: true, ..: lib_target("test_game", ["cdylib", "rlib"], "C:\\rust-workspace\\tutorial8-depth\\src\\lib.rs", Edition2024) }, profile: Profile { ..: default_dev() }, kind: Host, mode: Build, features: [], rustflags: [], rustdocflags: [], links_overrides: {}, artifact: false, artifact_target_for_features: None, is_std: false, dep_hash: 4599662427352608556 }
warning: output filename collision.
The bin target `test-game` in package `test-game v0.1.0 (C:\rust-workspace\tutorial8-depth)` has the same output filename as the lib target `test_game` in package `test-game v0.1.0 (C:\rust-workspace\tutorial8-depth)`.
Colliding filename is: C:\rust-workspace\tutorial8-depth\target\debug\test_game.pdb
The output filenames should be unique.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
If this looks unexpected, it may be a bug in Cargo. Please file a bug report at
https://github.com/rust-lang/cargo/issues/ with as much information as you
can provide.
cargo 1.90.0 (840b83a10 2025-07-30) running on `x86_64-pc-windows-msvc` target `x86_64-pc-windows-msvc`
First unit: Unit { pkg: Package { id: PackageId { name: "test-game", version: "0.1.0", source: "C:\\rust-workspace\\tutorial8-depth" }, ..: ".." }, target: TargetInner { name: "test-game", doc: true, ..: with_path("C:\\rust-workspace\\tutorial8-depth\\src\\main.rs", Edition2024) }, profile: Profile { ..: default_dev() }, kind: Host, mode: Build, features: [], rustflags: [], rustdocflags: [], links_overrides: {}, artifact: false, artifact_target_for_features: None, is_std: false, dep_hash: 8907886903843558320 }
Second unit: Unit { pkg: Package { id: PackageId { name: "test-game", version: "0.1.0", source: "C:\\rust-workspace\\tutorial8-depth" }, ..: ".." }, target: TargetInner { name_inferred: true, ..: lib_target("test_game", ["cdylib", "rlib"], "C:\\rust-workspace\\tutorial8-depth\\src\\lib.rs", Edition2024) }, profile: Profile { ..: default_dev() }, kind: Host, mode: Build, features: [], rustflags: [], rustdocflags: [], links_overrides: {}, artifact: false, artifact_target_for_features: None, is_std: false, dep_hash: 4599662427352608556 }
   Compiling test-game v0.1.0 (C:\rust-workspace\tutorial8-depth)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.65s
     Running `target\debug\test-game.exe`
PS C:\rust-workspace\tutorial8-depth> 

🤔 Expected Behavior

What should have happened?

👟 Steps to reproduce

  1. First do a normal cargo run
  2. Then do wasm-pack build --target web
  3. then do another normal cargo run

🌍 Your environment

Include the relevant details of your environment.
wasm-pack version: Latest
rustc version: 1.90

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