Skip to content

"rustpkg build foo" does not work properly with sub directories #10101

Closed

Description

@erickt

rustpkg build ... with subdirectories overwrites binaries. Here's an example of the problem:

% mkdir -p src/a/b src/a/c
% echo 'fn main() { println!("b"); }' > src/a/b/main.rs
% echo 'fn main() { println!("c"); }' > src/a/c/main.rs
% rustpkg build a
% find build
build/x86_64-apple-darwin
build/x86_64-apple-darwin/a
build/x86_64-apple-darwin/a/a
% ./build/x86_64-apple-darwin/a/a
c

The workaround is to explicitly specify the sub executable:

% rustpkg build a/b
% rustpkg build a/c
% find build
build/x86_64-apple-darwin
build/x86_64-apple-darwin/a
build/x86_64-apple-darwin/a/b
build/x86_64-apple-darwin/a/b/b
build/x86_64-apple-darwin/a/c
build/x86_64-apple-darwin/a/c/c
% ./build/x86_64-apple-darwin/a/b/b
b
% ./build/x86_64-apple-darwin/a/c/c
c

cc @catamorphism

Activity

  1. emberian commented on Mar 18, 2014

    @emberian
    Contributor

    rustpkg is gone

  2. added a commit that references this issue on Dec 29, 2022
  3. added a commit that references this issue on Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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