Skip to content

Commit da29e7b

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

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
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

Lines changed: 8 additions & 2 deletions
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 !fs::exists(&subdir)? {
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)