pganalyze / pg_query.rs

Rust library to parse, deparse and normalize SQL queries using the PostgreSQL query parser
MIT License
126 stars 12 forks source link

build error: program not found #34

Closed ppputtyo closed 8 months ago

ppputtyo commented 9 months ago

Hello. I tried to run the following source code on Windows 10 and the build failed. I am seeking assistance in resolving this issue.

Code

use pg_query;

fn main() {
    let result = pg_query::parse("SELECT * FROM contacts");
    assert!(result.is_ok());
}

Error message

The project is located at E:\pg-query-test.

error: failed to run custom build command for `pg_query v0.8.2`

Caused by:
  process didn't exit successfully: `E:\pg-query-test\target\debug\build\pg_query-4000e504282b2f84\build-script-build` (exit code: 1)
  --- stdout
  cargo:rerun-if-changed=.\libpg_query\Makefile
  cargo:rustc-link-search=native=E:\pg-query-test\target\debug\build\pg_query-b2e470b4f0427967\out
  cargo:rustc-link-lib=static=pg_query

  --- stderr
  Error: Error { kind: NotFound, message: "program not found" }

Environment

OS: Windows 10 pg_query: 0.8.2 cargo: 1.75.0-nightly cmake: 3.28.1

lfittl commented 9 months ago

This is probably a known issue: libpg_query currently does not support Windows: https://github.com/pganalyze/libpg_query/issues/44

lfittl commented 8 months ago

Windows support has been added in #39 and released as 5.1.0.