about summary refs log tree commit diff
path: root/compiler/rustc_metadata/src/fs.rs
AgeCommit message (Collapse)AuthorLines
2025-06-03Move metadata object generation for dylibs to the linker codebjorn3-29/+17
This deduplicates some code between codegen backends and may in the future allow adding extra metadata that is only known at link time.
2025-04-25Retry if creating temp fails with access deniedChris Denton-2/+2
On Windows, if creating a temporary directory fails with permission denied then use a retry/backoff loop. This hopefully fixes a recuring error in our CI.
2025-03-31Store only a metadata stub into `rlibs` and `dylibs` with `-Zembed-metadata=no`Jakub Beránek-6/+20
2024-09-24Dogfood `feature(file_buffered)`Josh Stone-2/+1
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-7/+7
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-8/+8
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-18Rename `Session::span_diagnostic` as `Session::dcx`.Nicholas Nethercote-1/+1
2023-12-02Use `Session::diagnostic` in more places.Nicholas Nethercote-4/+1
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-1/+1
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-09-17Auto merge of #114750 - Enselic:metadata-dep-info, r=compiler-errorsbors-3/+1
Make `.rmeta` file in `dep-info` have correct name (`lib` prefix) Since `filename_for_metadata()` and `OutputFilenames::path(OutputType::Metadata)` had different logic for the name of the metadata file, the `.d` file contained a file name different from the actual name used. Share the logic to fix the out-of-sync name. Without this fix, the `.d` file contained dash-separated_something-extra.rmeta: dash-separated.rs instead of libdash_separated_something-extra.rmeta: dash-separated.rs which is the name of the file that is actually written by the compiler. Worth noting: It took me several iterations to get all tests to pass, so I am relatively confident that this PR does not break anything. Closes #68839
2023-09-03Make `.rmeta` file in `dep-info` have correct name (`lib` prefix)Martin Nordholts-3/+1
Since `filename_for_metadata()` and `OutputFilenames::path(OutputType::Metadata)` had different logic for the name of the metadata file, the `.d` file contained a file name different from the actual name used. Share the logic to fix the out-of-sync name. Closes 68839.
2023-08-09rustc: Move `crate_types` from `Session` to `GlobalCtxt`Vadim Petrochenkov-1/+1
Removes a piece of mutable state. Follow up to #114578.
2023-07-23remove redundant clonesMatthias Krüger-2/+2
2023-06-06fixJing Peng-8/+1
- remove useless commands from test Makefile - do not unnecessarily remove metadata temporary files because they'll be managed by MaybeTempDir - remove unused FailedRemove error introduced by this PR
2023-06-06Write to stdout if `-` is given as output fileJing Peng-10/+40
If `-o -` or `--emit KIND=-` is provided, output will be written to stdout instead. Binary output (`obj`, `llvm-bc`, `link` and `metadata`) being written this way will result in an error unless stdout is not a tty. Multiple output types going to stdout will trigger an error too, as they will all be mixded together.
2023-03-08Only compute the crate hash when necessary.Nicholas Nethercote-23/+3
The crate hash is needed: - if debug assertions are enabled, or - if incr. comp. is enabled, or - if metadata is being generated, or - if `-C instrumentation-coverage` is enabled. This commit avoids computing the crate hash when these conditions are all false, such as when doing a release build of a binary crate. It uses `Option` to store the hashes when needed, rather than computing them on demand, because some of them are needed in multiple places and computing them on demand would make compilation slower. The commit also removes `Owner::hash_without_bodies`. There is no benefit to pre-computing that one, it can just be done in the normal fashion.
2023-01-17Remove double spaces after dots in commentsMaybe Waffle-1/+1
2022-12-07Use `Symbol` for the crate name instead of `String`/`str`Oli Scherer-2/+1
2022-12-03Remove all but one call site of `prepare_outputs` and fetch the value from ↵Oli Scherer-6/+4
the TyCtxt instead
2022-11-14Wrap bundlen static libraries into object filesDaniil Belov-3/+8
2022-08-31respond to review feedback: mainly eliminate as many conversions as possible...Nathan Stocks-18/+9
- ... when creating diagnostics in rustc_metadata - use the error_code! macro - pass macro output to diag.code() - use fluent from within manual implementation of SessionDiagnostic - emit the untested errors in case they occur in the wild - stop panicking in the probably-not-dead code, add fixme to write test
2022-08-31port fs.rs to SessionDiagnosticsNathan Stocks-9/+17
2022-07-02fall back on the blank path if out_filename is blankYoshiki Matsuda-1/+1
2022-07-02add some comments for encode_and_write_metadataYoshiki Matsuda-0/+6
2022-07-02fix an incorrect filename for an error messageYoshiki Matsuda-1/+1
2022-07-02refactor encode_and_write_metadataYoshiki Matsuda-39/+31
2022-07-02create an empty file even in case of MetadataKind::NoneYoshiki Matsuda-6/+16
2022-07-02create tmp directory if there is no parent directoryYoshiki Matsuda-1/+1
2022-07-02call EncodedMetadata::empty in case of MetadataKind::NoneYoshiki Matsuda-25/+31
2022-07-02write to a temporary file in Decodable for EncodedMetadataYoshiki Matsuda-7/+7
2022-07-02hold Mmap in EncodedMetadataYoshiki Matsuda-2/+4
2022-07-02construct EncodedMetadata in encode_and_write_metadataYoshiki Matsuda-6/+9
2022-07-02call emit_metadata only when metadata_kind is NoneYoshiki Matsuda-3/+6
2022-07-02use rustc_serialize::opaque::FileEncoderYoshiki Matsuda-13/+16
2022-07-02move encode_and_write_metadata to rustc_metadata::fsYoshiki Matsuda-1/+89
2022-07-02move emit_metadata to rustc_metadata::fsYoshiki Matsuda-0/+24