Skip to content

Commit

Permalink
revert modification
Browse files Browse the repository at this point in the history
  • Loading branch information
ynqa committed Nov 13, 2024
1 parent 920bab4 commit 739f3a8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions j9-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ readme = "README.md"
anyhow = "1.0.80"
autotools = "0.2.6"
bindgen = "0.69.4"
filetime = "0.2.25"
walkdir = "2.5.0"
15 changes: 15 additions & 0 deletions j9-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ use std::{
env,
path::{Path, PathBuf},
process::Command,
time::SystemTime,
};

use filetime::FileTime;

fn check_installed(name: &str) -> anyhow::Result<()> {
let check = Command::new(name).arg("--version").output();

Expand Down Expand Up @@ -38,6 +41,18 @@ fn main() -> anyhow::Result<()> {
let out_dir = env::var("OUT_DIR").map(PathBuf::from)?;
let src_dir = Path::new(env!("CARGO_MANIFEST_DIR")).join("jq");

// Modify the timestamp of parser.c file
// to circumvent an error on building in Linux that goes something like:
//
// clang: error: no such file or directory: 'src/parser.c'
// clang: error: no input files
// make[2]: *** [Makefile:1051: src/parser.lo] Error 1
// make[1]: *** [Makefile:1188: install-recursive] Error 1
// make: *** [Makefile:1709: install] Error 2
let now = FileTime::from(SystemTime::now());
let parser_src = src_dir.join("src/parser.c");
filetime::set_file_mtime(&parser_src, now)?;

// See https://github.com/jqlang/jq/tree/jq-1.7.1?#instructions
autotools::Config::new(&src_dir)
.reconf("-i")
Expand Down

0 comments on commit 739f3a8

Please sign in to comment.