Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error at cargo run --manifest-path ../tools/post-install/Cargo.toml -- pg_config #789

Open
MtnBiker opened this issue Dec 30, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@MtnBiker
Copy link

Relevant system information:

  • OS: macOS 14.2.1 (23C71)
  • PostgreSQL version (output of SELECT version();): [e.g. 12.0, 13.2, etc]
  • TimescaleDB Toolkit version: "PostgreSQL 16.1 on aarch64-apple-darwin21.6.0, compiled by Apple clang version 14.0.0 (clang-1400.0.29.102), 64-bit"
  • Installation method: source— following "Building and Installing the extension"

Describe the bug
Followed source install
.

To Reproduce
Did the following:
git clone https://github.com/timescale/timescaledb-toolkit.git
cd timescaledb-toolkit
OK and folder is there.
Added export PGRX_HOME="${HOME}/.cargo/“ to .zshrc after next step failed
cargo pgrx install --release # reran successfully

Then the following

timescaledb-toolkit/extension on  main is 📦 vtimescaledb_toolkit@1.18.0-dev via 𝗥 v1.74.0
➜ cargo run --manifest-path ../tools/post-install/Cargo.toml -- pg_config
    Finished dev [unoptimized + debuginfo] target(s) in 0.13s
     Running `/Users/gscar/Documents/Delicias/Utilities, Energy and Solar/Solar Panels 2023-ABC/Solar production, etc/enphase2/timescaledb-toolkit/target/debug/post-install pg_config`
Generating Version 1.18.0-dev
Upgradable From ["1.6.0", "1.7.0", "1.8.0", "1.10.0-dev", "1.10.1", "1.11.0", "1.12.0", "1.12.1", "1.13.0", "1.13.1", "1.14.0", "1.15.0", "1.16.0", "1.17.0"]
thread 'main' panicked at tools/post-install/src/main.rs:330:9:
cannot rename `/Applications/Postgres.app/Contents/Versions/16/lib/postgresql/timescaledb_toolkit.so` to `/Applications/Postgres.app/Contents/Versions/16/lib/postgresql/timescaledb_toolkit-1.18.0-dev.so` due to `No such file or directory (os error 2)`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

The other files in /Applications/Postgres.app/Contents/Versions/16/lib/postgresql/ are .dylib and no .so files.

This is the first pg extention I've installed with Rust. I am a little surprised that the install is into the Postgres.app rather than /Users/gscar/Library/Application Support/Postgres/var-16/

Thanks for any suggestions on how to proceed.

@MtnBiker MtnBiker added the bug Something isn't working label Dec 30, 2023
@adam-micromelon
Copy link

Did you find a solution to this?

@spohlenz
Copy link

@adam-micromelon I encountered this a couple of days ago. I was able to get it working by replacing any instances of .so with .dylib in tools/post-install/src/main.rs and re-running the release command.

diff --git a/tools/post-install/src/main.rs b/tools/post-install/src/main.rs
index 6669ff3..2909c0e 100644
--- a/tools/post-install/src/main.rs
+++ b/tools/post-install/src/main.rs
@@ -47,7 +47,7 @@ fn try_main() -> xshell::Result<()> {
     // is left anywhere in the install script, it will fail to install.
     remove_module_path_from_control_file(&extension_info);
 
-    // rename timescaledb_toolkit.so to timescaledb_toolkit-<current version>.so
+    // rename timescaledb_toolkit.dylib to timescaledb_toolkit-<current version>.dylib
     add_version_to_binary(&extension_info);
 
     // replace `MODULE_PATH` with `$libdir/timescaledb_toolkit-<current version>`
@@ -189,8 +189,8 @@ fn add_version_to_binary(
         ..
     }: &ExtensionInfo,
 ) {
-    let bin_file = path!(bin_dir / "timescaledb_toolkit.so");
-    let versioned_file = path!(bin_dir / format!("timescaledb_toolkit-{}.so", current_version));
+    let bin_file = path!(bin_dir / "timescaledb_toolkit.dylib");
+    let versioned_file = path!(bin_dir / format!("timescaledb_toolkit-{}.dylib", current_version));
     rename_file(bin_file, versioned_file);
 }

@adam-micromelon
Copy link

@spohlenz Thank you! That fixed it for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants