-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Make -o do something reasonable or remove it #11056
Comments
We have |
Sometimes rustc doesn't know whether it's compiling an exe or library until it reads the source code, so simply looking at the command line flags would be insufficient. Sometimes rustc outputs multiple files. My inclination is to always make the naming of the output file up to rustc and remove -o completely. |
Could we replace it with a |
@thestinger Would this override the name part of the |
Yes, in fact I thought that's already what |
or maybe |
Okay, so the task here is to remove |
Accepted for P-backcompat-libs (aka tools) |
FWIW, I'd love to have an option to specify the actual file name for libraries. My particular use-case is for writing Lua modules, which need to be a shared libraries with the module name as basename (i.e. having a "lib" prefix, including the hash, and including a version is undesirable). |
This commit removes the -c, --emit-llvm, -s, --rlib, --dylib, --staticlib, --lib, and --bin flags from rustc, adding the following flags: * --emit=[asm,ir,bc,obj,link] * --crate-type=[dylib,rlib,staticlib,bin,lib] The -o option has also been redefined to be used for *all* flavors of outputs. This means that we no longer ignore it for libraries. The --out-dir remains the same as before. The new logic for files that rustc emits is as follows: 1. Output types are dictated by the --emit flag. The default value is --emit=link, and this option can be passed multiple times and have all options stacked on one another. 2. Crate types are dictated by the --crate-type flag and the #[crate_type] attribute. The flags can be passed many times and stack with the crate attribute. 3. If the -o flag is specified, and only one output type is specified, the output will be emitted at this location. If more than one output type is specified, then the filename of -o is ignored, and all output goes in the directory that -o specifies. The -o option always ignores the --out-dir option. 4. If the --out-dir flag is specified, all output goes in this directory. 5. If -o and --out-dir are both not present, all output goes in the directory of the crate file. 6. When multiple output types are specified, the filestem of all output is the same as the name of the CrateId (derived from a crate attribute or from the filestem of the crate file). Closes #7791 Closes #11056 Closes #11667
…llogiq `let_and_return`: lint 'static lifetimes, don't lint borrows in closures Fixes rust-lang#11056 Now also ignores functions returning `'static` lifetimes, since I noticed the `stdin.lock()` example was still being linted but doesn't need to be since rust-lang#93965 changelog: none
For libraries we ignore the filename completely. This would seem to imply that the flag should just specify the output directory. Locking in this strange behavior for Rust 1.0 would be unfortunate. Nominating.
The text was updated successfully, but these errors were encountered: