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

Add a way to tell rustpkg not to install all the crate files in a package #8892

Closed
catamorphism opened this issue Aug 30, 2013 · 5 comments
Closed
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@catamorphism
Copy link
Contributor

@metajack pointed out that a library might have a main crate, and then a src/examples directory containing lots of subdirectories with main.rs files. If you rustpkg install, you probably don't want to install the example programs. Maybe we could add another "magic" filename for files we want to build but not install. Or maybe there's another solution.

@ghost ghost assigned catamorphism Aug 30, 2013
@steveklabnik
Copy link
Member

I also picked up on this pattern myself, so examples could be a good name.

@catamorphism
Copy link
Contributor Author

I think this will fall out of my work on #7879 but I'm not totally sure. In particular: there's a question of, does building a package mean building every crate file in any subdirectory of the package directory? Or, does it mean building the crates in the top-level directory, plus all their dependencies (searching subdirectories of the package dir as well as the RUST_PATH)? If the latter, then this bug will become a non-issue, but if the former, it's still an issue.

@catamorphism
Copy link
Contributor Author

Closely related to #7240

@jhasse
Copy link
Contributor

jhasse commented Jan 12, 2014

What do you think about having the main crate files simply be put in the src directory? For example for glfw:

glfw-rs/src/lib.rs // #[crate_id = "github.com/bjz/glfw-rs#glfw:0.1"];
glfw-rs/src/examples/window/main.rs // extern mod glfw;

Executing rustpkg build or rustpkg install would then only install this "main" crate (rustpkg build glfw would also still work).

Also this removes the repeated name. Let's say I have a project foobar and am using rustpkg for building it. /home/jhasse/projects/foobar/src/foobar/main.rs repeats the name. This was pointed out by someone on IRC a couple of weeks ago as being a "bug" of rustpkg.

The package id would then also be an optional argument for install and build. This way editors can execute rustpkg in any project without extracting the crate name.

@emberian emberian closed this as completed Apr 5, 2014
@emberian
Copy link
Member

emberian commented Apr 5, 2014

rustpkg is gone.

@catamorphism catamorphism removed their assignment Jun 16, 2014
flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 4, 2022
…, r=Manishearth

Fix `empty_line_after_outer_attribute` false positive

This PR fixes a false positive in `empty_line_after_outer_attribute`.

Here is a minimal example that trigger the FP:
```rust
#[derive(clap::Parser)]
#[clap(after_help = "This ia a help message.

You're welcome.
")]
pub struct Args;
```

changelog: PF: [`empty_line_after_outer_attribute`]: No longer lints empty lines in inner string values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

4 participants