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

gftools mode for crater #1069

Merged
merged 6 commits into from
Oct 29, 2024
Merged

gftools mode for crater #1069

merged 6 commits into from
Oct 29, 2024

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Oct 27, 2024

This wires everything up to get gftools working in crater.

  • currently blocked on Parse more config items google-fonts-sources#24 and Support for fontc and crater gftools#1047
  • but maybe we don't actually need to merge the gftools patch? If we can pip install from a git rev or branch, we could just maintain our own branch of gftools and not need to dirty up the main tree.
  • we skip noto fonts and other fonts that have a custom recipe provider
  • there are a number of failures because it turns out that in lots of cases one source does produce multiple fonts; a bunch of these I could address by turning off config options (so to not build small caps or italics) but a handful of fonts are building a regular and a bold, and I didn't see a config option for this.

Also removes the ability to run both modes at once.
This happens sometimes in gftools, specifically if an error occurs in
the ninja subprocess.
This will only run gftools mode for fonts using the default
recipeProvider.
}

fn should_build_in_gftools_mode(src_path: &Path, config: &Config) -> bool {
// skip noto, which have an implicitly different recipe provider
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fontc_crater/src/ci.rs Outdated Show resolved Hide resolved
return false;
}

// if there is a recipe provider other than googlefonts, we skip
Copy link
Contributor

Choose a reason for hiding this comment

The 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

cmd.append(str(source))

build(cmd, build_dir)


def run_gftools(
source: Path, config: Path, build_dir: Path, fontc_bin: Union[Path, None] = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Union[Path, None] => Optional[Path]

@@ -259,6 +285,9 @@ def copy(old, new):
return new


# def find_and_copy_one_file(from_dir: Path, to_file: Path):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leftover?

@cmyr cmyr added this pull request to the merge queue Oct 29, 2024
Merged via the queue into main with commit 6aa45e6 Oct 29, 2024
10 checks passed
@cmyr cmyr deleted the crater-gftools branch October 29, 2024 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants