Skip to content
Snippets Groups Projects
Commit 685d676c authored by Yaroslav Dynnikov's avatar Yaroslav Dynnikov Committed by Alexey Protsenko
Browse files

build: fix packpack

The build process was refactored recently in b9aeab59 and it broke the
packaging in a tricky way.

Packpack wraps the whole build process in a Makefile which exports its
own `MAKEFLAGS` environment variable:

```
MAKEFLAGS="w -j -- BUILDDIR=/build"
```

The `cmake` crate used to override it with `CARGO_MAKEFLAGS` provided by
cargo. But after we've replaced it with `std::process::Command`, the
`BUILDDIR` setting has made its way to the `icu` build, which suddenly
clashed one of internal `make` variables and wrote there resource files.
As a result, the `icu` build started to fail with the error:

```
icupkg: unable to open input file
"/build/usr/src/debug/picodata-22.11.0.158/
   /target/debug/build/tarantool-sys/icu-prefix/src/icu-build/
   /data/out/build/icudt62l/af.res"
```

while all resources were copied directly to `/build/af.res`.

This patch repeats the behavior of the `cmake` crate.

It also makes logging more verbose and aligns the output. Replacing
`eprintln` with `println` is necessary since `make` and `cmake` both
write the logs to the `stdout`.
parent 7c73a0b3
No related branches found
No related tags found
1 merge request!461Ci check
......@@ -28,6 +28,16 @@ fn main() {
let build_root = Path::new(&out_dir).parent().unwrap().parent().unwrap();
dbg!(&build_root); // "<target-dir>/<build-type>/build"
// See also:
// https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts
if let Some(ref makeflags) = std::env::var_os("CARGO_MAKEFLAGS") {
std::env::set_var("MAKEFLAGS", makeflags);
}
for (var, value) in std::env::vars() {
println!("[{}:{}] {var}={value}", file!(), line!());
}
build_tarantool(build_root);
build_http(build_root);
......@@ -232,7 +242,7 @@ impl CommandExt for Command {
#[track_caller]
fn run(&mut self) {
let loc = Location::caller();
eprintln!("[{}:{}] running [{:?}]", loc.file(), loc.line(), self);
println!("[{}:{}] running [{:?}]", loc.file(), loc.line(), self);
let prog = self.get_program().to_owned().into_string().unwrap();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment