-
Notifications
You must be signed in to change notification settings - Fork 14
Updating target json support #75
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
Merged
+384
−326
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
44e94bc
main new clippy fixes
Firestar99 84024c8
remove internal `InstallArgs::dylib_path`
Firestar99 7972bc9
remove mod args, flatten InstallArgs -> Install and BuildArgs -> Build
Firestar99 d8d96b6
add InstalledBackend struct
Firestar99 bb2a6a3
rename `checkout` to `install_dir`
Firestar99 9a364d8
allow searching multiple packages from one `cargo metadata` query
Firestar99 2d2f8cf
remove non_exhaustive attribs
Firestar99 0d774ef
add `SpirvSource.is_path()` shortcut
Firestar99 af15805
create target-specs folder per installation, pulled from `rustc_codeg…
Firestar99 fd5da3c
appease clippy
Firestar99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//! Legacy target specs are spec jsons for versions before `rustc_codegen_spirv-target-specs` | ||
//! came bundled with them. Instead, cargo gpu needs to bundle these legacy spec files. Luckily, | ||
//! they are the same for all versions, as bundling target specs with the codegen backend was | ||
//! introduced before the first target spec update. | ||
use anyhow::Context as _; | ||
use log::info; | ||
use std::path::Path; | ||
|
||
/// Extract legacy target specs from our executable into some directory | ||
pub fn write_legacy_target_specs(target_spec_dir: &Path, rebuild: bool) -> anyhow::Result<()> { | ||
info!( | ||
"Writing legacy target specs to {}", | ||
target_spec_dir.display() | ||
); | ||
std::fs::create_dir_all(target_spec_dir)?; | ||
for (filename, contents) in legacy_target_specs::TARGET_SPECS { | ||
let path = target_spec_dir.join(filename); | ||
if !path.is_file() || rebuild { | ||
std::fs::write(&path, contents.as_bytes()).with_context(|| { | ||
format!("writing legacy target spec file at [{}]", path.display()) | ||
})?; | ||
} | ||
} | ||
Ok(()) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Niiiice, so much simpler 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are some of the commits I cherry-picked from my library refactor :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oooh :D