-
Notifications
You must be signed in to change notification settings - Fork 14
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
gftools mode for crater #1069
Merged
Merged
gftools mode for crater #1069
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b02e2e1
[ttx_diff] Precompile fontc binary
cmyr fc25242
[ttx_diff] Gftools running gftools mode
cmyr aa454a5
[crater] Ability to run gftools mode
cmyr d4970ef
[ttx_diff] On error use stdout if stderr is empty
cmyr 393b92c
[crater] Actually run gftools mode
cmyr b73e530
[crater] Code review and cleanup
cmyr 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
This file contains 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 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 |
---|---|---|
|
@@ -18,7 +18,7 @@ use crate::{ | |
args::CiArgs, | ||
error::Error, | ||
ttx_diff_runner::{DiffError, DiffOutput}, | ||
Results, Target, | ||
BuildType, Results, Target, | ||
}; | ||
|
||
mod html; | ||
|
@@ -176,12 +176,46 @@ fn make_targets(cache_dir: &Path, repos: &[RepoInfo]) -> (Vec<Target>, BTreeMap< | |
.expect("source is always in cache dir") | ||
.to_path_buf(); | ||
repo_list.insert(src_path.clone(), repo.repo_url.clone()); | ||
targets.push(Target { | ||
_config: config_path.to_owned(), | ||
source: src_path, | ||
}) | ||
targets.extend(targets_for_source(&src_path, &config_path, &config)) | ||
} | ||
} | ||
} | ||
(targets, repo_list) | ||
} | ||
|
||
fn targets_for_source( | ||
src_path: &Path, | ||
config_path: &Path, | ||
config: &Config, | ||
) -> impl Iterator<Item = Target> { | ||
let default = Some(Target { | ||
config: config_path.to_owned(), | ||
source: src_path.to_owned(), | ||
build: BuildType::Default, | ||
}); | ||
|
||
let gftools = should_build_in_gftools_mode(src_path, config).then(|| Target { | ||
config: config_path.to_owned(), | ||
source: src_path.to_owned(), | ||
build: BuildType::GfTools, | ||
}); | ||
[default, gftools].into_iter().flatten() | ||
} | ||
|
||
fn should_build_in_gftools_mode(src_path: &Path, config: &Config) -> bool { | ||
// skip noto, which have an implicitly different recipe provider | ||
if src_path | ||
.file_stem() | ||
.and_then(|stem| stem.to_str().map(|s| s.to_lowercase().contains("noto"))) | ||
cmyr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
.unwrap_or(false) | ||
{ | ||
return false; | ||
} | ||
|
||
// if there is a recipe provider other than googlefonts, we skip | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should tersely say why, e.g. because we have no idea what it will do, it's arbitrary code |
||
config | ||
.recipe_provider | ||
.as_ref() | ||
.filter(|provider| *provider != "googlefonts") | ||
.is_none() | ||
} |
This file contains 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 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 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.
Oops, something went wrong.
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.
can we link to where python does this implicit recipe provider selection?
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.
it doesn't, gftools cannot build these fonts, even with python.
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.
Maybe we should refer the reader to https://github.com/googlefonts/oxidize/blob/main/text/2024-06-26-fixes-and-nonstandard-builds.md#noto ?