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

[crater] Initial support for richer targets #1065

Merged
merged 1 commit into from
Oct 24, 2024
Merged

[crater] Initial support for richer targets #1065

merged 1 commit into from
Oct 24, 2024

Conversation

cmyr
Copy link
Member

@cmyr cmyr commented Oct 23, 2024

this is blocked until I do a release of google-fonts-sources

This will facilitate gftools mode.

Ultimately I decided to just rip out a bunch of the old functionality, because keeping it working was becoming a chore and it really wasn't being used much.

@@ -10,7 +10,7 @@ readme = "README.md"
[dependencies]
fontc = { version = "0.0.1", path = "../fontc" }

google-fonts-sources = "0.3.1"
google-fonts-sources = { path = "../../google-fonts-sources" }
Copy link
Contributor

Choose a reason for hiding this comment

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

Reminder to move back to a released version pre-submit

pub(super) limit: Option<usize>,
}
#[arg(short, long = "cache")]
cache_dir: Option<PathBuf>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did we remove the default value from here? - now it won't show up in --help

Copy link
Contributor

Choose a reason for hiding this comment

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

If we have to keep the env var lets document it and the interaction with this flag here

Copy link
Member Author

Choose a reason for hiding this comment

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

added a note about the default to the help docs.

As I think you inferred this was removed so that we could check for None and then use the env var if it's set.


use clap::{Parser, Subcommand};

// this env var can be set by the runner in order to reuse git checkouts
// between runs.
static GIT_CACHE_DIR_VAR: &str = "CRATER_GIT_CACHE";
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not obvious why we need to probe an environment variable and support a cli option. Tbh, I'd prefer only cli arg but if we think we really need this lets document why.

Copy link
Member Author

Choose a reason for hiding this comment

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

The reason this uses an env var is because in the CI environment we don't call this executable directly; we call the run.sh script in the fontc_crater repo, which in turn calls the ci.sh script in this repo, which executes this binary. The environment variable is set in the config for the scheduler that launches the CI task on the host machine.

for source in &config.sources {
let src_path = config_path
.parent()
.expect("config path always in sources dir")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: here and below we don't actually verify what dir, should it just be config path is a file in a directory?

Copy link
Member Author

Choose a reason for hiding this comment

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

I use expect as basically an alternative to an assert, or an unwrap + comment.

These are both trying to communicate the invariant that the paths returns from iter_configs always start with the cache_dir argument, and necessarily include the source (or Source) directory component.

This will facilitate gftools mode.

Ultimately I decided to just rip out a bunch of the old functionality,
because keeping it working was becoming a chore and it really wasn't
being used much.
@cmyr cmyr added this pull request to the merge queue Oct 24, 2024
Merged via the queue into main with commit 96d887d Oct 24, 2024
10 checks passed
@cmyr cmyr deleted the crater-ci-targets branch October 24, 2024 21:34
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