terminusdb-labs / swipl-rs

26 stars 7 forks source link

prolog_pack:build_environment/1 broken in SWI-Prolog 8.5 #16

Closed spl closed 2 years ago

spl commented 2 years ago

In this TerminusDB run, the swipl-fli build script fails:

ERROR: error: failed to run custom build command for `swipl-fli v0.3.2`
ERROR: 
ERROR: Caused by:
ERROR:   process didn't exit successfully: `/home/runner/.local/share/swi-prolog/pack/terminus_store_prolog/rust/target/release/build/swipl-fli-92cec9626bbf6c11/build-script-build` (exit status: 101)
ERROR:   --- stderr
ERROR:   thread 'main' panicked at 'Error retrieving build environment using swipl: Output { status: ExitStatus(unix_wait_status(512)), stdout: "", stderr: "ERROR: -g use_module(library(prolog_pack)), prolog_pack:build_environment(Env), memberchk('SWIHOME'=Swihome, Env), memberchk('PACKSODIR'=Packsodir, Env), memberchk('CFLAGS'=Cflags, Env), memberchk('LDSOFLAGS'=Ldflags, Env), format('~s~n~s~n~s~n~s~n', [Swihome, Packsodir, Cflags, Ldflags]): '<meta-call>'/1: Unknown procedure: prolog_pack:build_environment/1\n" }', /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/swipl-info-0.3.1/src/lib.rs:53:9
ERROR:   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
ERROR: warning: build failed, waiting for other jobs to finish...
ERROR: error: build failed

It might be a result of this commit, which appears to remove build_environment/1 from a module export list.

I'm not sure whether it would be more appropriate to fix it here or in SWI-Prolog 8.5.

matko commented 2 years ago

Interesting - I thought I had properly fixed this in #14, as I noticed we weren't building against the latest devel anymore. I did test the build against each version in 8.5 that has been released so far, as well as the latest git head, and didn't run into this.

I'll look into it. the fix is definitely on our side though. build_environment has moved to a different module, and now has arity 2. The build script checks the version number of SWI-Prolog and selects what to call based on that. Apparently this is going wrong though.

matko commented 2 years ago

Oh I see, the build you link to is for terminusdb. Since I've not yet released a new swipl-rs, this isn't fixed there yet. However, this should be fixed upon the next release of swipl-rs and a corresponding release in terminus_store_prolog.

matko commented 2 years ago

A version has been released where the build works again, so I'm closing this.