Skip to content

Commit eb2c84c

Browse files
committed
progress
1 parent bcbb074 commit eb2c84c

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

.gitmodules

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
[submodule "crates/pgt_query/vendor/libpg_query"]
66
path = crates/pgt_query/vendor/libpg_query
77
url = https://github.com/pganalyze/libpg_query.git
8+
fetchRecurseSubmodules = true
9+
shallow = false

crates/pgt_query/build.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
3030

3131
if !libpg_query_submodule.join(".git").exists() && !libpg_query_submodule.join("src").exists() {
3232
return Err(
33-
"libpg_query submodule not found. Please run: git submodule update --init --recursive"
33+
"libpg_query submodule not found. Please run: git submodule update --init --recursive && cd crates/pgt_query/vendor/libpg_query && git fetch --tags"
3434
.into(),
3535
);
3636
}
@@ -53,16 +53,17 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
5353
current.trim() != target.trim()
5454
}
5555
Err(_) => {
56-
// tag not found locally, try fetching
57-
let status = Command::new("git")
58-
.args(["fetch", "--tags"])
59-
.current_dir(&libpg_query_submodule)
60-
.status()?;
61-
62-
if !status.success() {
63-
return Err("Failed to fetch tags from libpg_query".into());
64-
}
65-
true
56+
// tag not found locally
57+
return Err(format!(
58+
"Tag {} not found in libpg_query submodule. Please run:\n\
59+
cd {} && git fetch --tags && git checkout {} && git checkout {} && git checkout {}",
60+
libpg_query_tag,
61+
libpg_query_submodule.display(),
62+
"15-4.2.4",
63+
"16-5.2.0",
64+
"17-6.1.0"
65+
)
66+
.into());
6667
}
6768
};
6869

0 commit comments

Comments
 (0)