Skip to content

Commit db7da31

Browse files
committed
Work around cargo vendor losing syntax_mapping builtins directory
1 parent 33aabc6 commit db7da31

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
## Other
99

10+
- Work around build failures when building `bat` from vendored sources #3179 (@dtolnay)
11+
1012
## Syntaxes
1113

1214
## Themes

build/syntax_mapping.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,14 @@ fn get_def_paths() -> anyhow::Result<Vec<PathBuf>> {
236236
];
237237

238238
let mut toml_paths = vec![];
239-
for subdir in source_subdirs {
240-
let wd = WalkDir::new(Path::new("src/syntax_mapping/builtins").join(subdir));
239+
for subdir_name in source_subdirs {
240+
let subdir = Path::new("src/syntax_mapping/builtins").join(subdir_name);
241+
if !subdir.try_exists()? {
242+
// Directory might not exist due to this `cargo vendor` bug:
243+
// https://github.com/rust-lang/cargo/issues/15080
244+
continue;
245+
}
246+
let wd = WalkDir::new(subdir);
241247
let paths = wd
242248
.into_iter()
243249
.filter_map_ok(|entry| {

0 commit comments

Comments
 (0)