Skip to content

Commit

Permalink
pg_tiktoken: revision bump for Postgres 17
Browse files Browse the repository at this point in the history
  • Loading branch information
bayandin committed Nov 24, 2024
1 parent 3279a45 commit f0d205c
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions Formula/pg_tiktoken.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class PgTiktoken < Formula
desc "Tiktoken tokenizer for PostgreSQL"
homepage "https://github.com/kelvich/pg_tiktoken"
url "https://github.com/kelvich/pg_tiktoken/archive/26806147b17b60763039c6a6878884c41a262318.tar.gz"
url "https://github.com/kelvich/pg_tiktoken/archive/9118dd4549b7d8c0bbc98e04322499f7bf2fa6f7.tar.gz"
version "0.0.1"
sha256 "e64e55aaa38c259512d3e27c572da22c4637418cf124caba904cd50944e5004e"
revision 1
sha256 "a5bc447e7920ee149d3c064b8b9f0086c0e83939499753178f7d35788416f628"
revision 2

bottle do
root_url "https://ghcr.io/v2/bayandin/tap"
Expand All @@ -16,19 +16,17 @@ class PgTiktoken < Formula
depends_on "rust" => :build
depends_on "bayandin/tap/neon-postgres"

uses_from_macos "llvm" => :build

resource "pgrx" do
url "https://github.com/pgcentralfoundation/pgrx/archive/refs/tags/v0.10.2.tar.gz"
sha256 "040fd7195fc350ec7c823e7c2dcafad2cf621c8696fd2ce0db7626d7fbd3d877"
url "https://github.com/pgcentralfoundation/pgrx/archive/refs/tags/v0.12.6.tar.gz"
sha256 "ba04f50b3f9f160a1c70861ad2358b3eb6485dbc13608eef09b4094460487a57"
end

def neon_postgres
Formula["bayandin/tap/neon-postgres"]
end

def pg_versions
neon_postgres.pg_versions
neon_postgres.pg_versions(with: "v17")
end

def install

Check failure on line 32 in Formula/pg_tiktoken.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

`brew install --verbose --formula --build-bottle bayandin/tap/pg_tiktoken` failed on Linux!

Compiling byteorder v1.5.0 Compiling hash32 v0.3.1 Compiling pgrx-macros v0.12.6 Compiling wyz v0.5.1 Compiling bit-set v0.5.3 error: failed to run custom build command for `pgrx-pg-sys v0.12.6` Caused by: process didn't exit successfully: `/tmp/pg_tiktoken-20241124-95231-6319cu/pg_tiktoken-9118dd4549b7d8c0bbc98e04322499f7bf2fa6f7/target/release/build/pgrx-pg-sys-3dc09324684eba3e/build-script-bindgen` (exit status: 101) --- stdout cargo:rerun-if-env-changed=PGRX_BUILD_VERBOSE cargo:rerun-if-env-changed=PGRX_PG_SYS_GENERATE_BINDINGS_FOR_RELEASE cargo:rerun-if-env-changed=PGRX_PG_CONFIG_PATH cargo:rerun-if-env-changed=PGRX_PG_CONFIG_AS_ENV cargo:rerun-if-env-changed=LLVM_CONFIG_PATH cargo:rerun-if-env-changed=LIBCLANG_PATH cargo:rerun-if-env-changed=LIBCLANG_STATIC_PATH cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=BINDGEN_EXTRA_CLANG_ARGS_x86_64_unknown_linux_gnu cargo:rerun-if-env-changed=PGRX_PG_SYS_GENERATE_BINDINGS_FOR_RELEASE cargo:rerun-if-changed=include cargo:rerun-if-changed=pgrx-cshim.c cargo:rerun-if-changed=/tmp/pg_tiktoken-20241124-95231-6319cu/pg_tiktoken-9118dd4549b7d8c0bbc98e04322499f7bf2fa6f7/.brew_home/.pgrx/config.toml cargo:rerun-if-env-changed=PGRX_TARGET_INFO_PATH_PG14_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PGRX_TARGET_INFO_PATH_PG14 cargo:rerun-if-env-changed=PGRX_BINDGEN_NO_DETECT_INCLUDES_x86_64-unknown-linux-gnu cargo:rerun-if-env-changed=PGRX_BINDGEN_NO_DETECT_INCLUDES --- stderr build_paths=BuildPaths { manifest_dir: "/home/runner/.cache/Homebrew/cargo_cache/registry/src/index.crates.io-6f17d22bba15001f/pgrx-pg-sys-0.12.6", out_dir: "/tmp/pg_tiktoken-20241124-95231-6319cu/pg_tiktoken-9118dd4549b7d8c0bbc98e04322499f7bf2fa6f7/target/release/build/pgrx-pg-sys-63b00b97019c5735/out", src_dir: "/home/runner/.cache/Homebrew/cargo_cache/registry/src/index.crates.io-6f17d22bba15001f/pgrx-pg-sys-0.12.6/src/include", shim_src: "/home/runner/.cache/Homebrew/cargo_cache/registry/src/index.crates.io-6f17d22bba15001f/pgrx-pg-sys-0.12.6/pgrx-cshim.c", shim_dst: "/tmp/pg_tiktoken-20241124-95231-6319cu/pg_tiktoken-9118dd4549b7d8c0bbc98e04322499f7bf2fa6f7/target/release/build/pgrx-pg-sys-63b00b97019c5735/out/pgrx-cshim.c" } Generating bindings for pg14 pg_config --configure CLANG = None thread '<unnamed>' panicked at /home/runner/.cache/Homebrew/cargo_cache/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.70.1/lib.rs:622:27: Unable to find libclang: "couldn't find any valid shared libraries matching: ['libclang.so', 'libclang-*.so', 'libclang.so.*', 'libclang-*.so.*'], set the `LIBCLANG_PATH` environment variable to a path where one of these files can be found (invalid: [])" note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace thread 'main' panicked at /home/runner/.cache/Homebrew/cargo_cache/registry/src/index.crates.io-6f17d22bba15001f/pgrx-bindgen-0.12.6/src/build.rs:247:41: thread panicked while generating bindings: Any { .. } warning: build failed, waiting for other jobs to finish... ==> Formula Tap: bayandin/tap Path: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/bayandin/homebrew-tap/Formula/pg_tiktoken.rb ==> Configuration HOMEBREW_VERSION: 4.4.6-45-g3b1d59d ORIGIN: https://github.com/Homebrew/brew HEAD: 3b1d59d8c4fbf8c0ba0c9752007ff27bec3bc8b3 Last commit: 2 days ago Core tap JSON: 24 Nov 12:43 UTC HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew HOMEBREW_BOOTSNAP: set HOMEBREW_CACHE: /home/runner/.cache/Homebrew HOMEBREW_CASK_OPTS: [] HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: 3650 HOMEBREW_COLOR: set HOMEBREW_CURL_PATH: /usr/bin/curl HOMEBREW_FAIL_LOG_LINES: 150 HOMEBREW_GITHUB_API_TOKEN: set HOMEBREW_GIT_EMAIL: [email protected] HOMEBREW_GIT_NAME: BrewTestBot HOMEBREW_GIT_PATH: /usr/bin/git HOMEBREW_LOGS: /home/runner/work/homebrew-tap/homebrew-tap/logs HOMEBREW_MAKE_JOBS: 4 HOMEBREW_NO_AUTO_UPDATE: set HOMEBREW_NO_EMOJI: set HOMEBREW_NO_ENV_HINTS: set HOM
Expand All @@ -47,16 +45,13 @@ def install
system "cargo", "pgrx", "init", *args

pg_versions.each do |v|
# Ref https://github.com/postgres/postgres/commit/b55f62abb2c2e07dfae99e19a2b3d7ca9e58dc1a
dlsuffix = (OS.linux? || "v14 v15".include?(v)) ? "so" : "dylib"

system "cargo", "pgrx", "package", "--profile", "release",
"--pg-config", neon_postgres.pg_bin_for(v)/"pg_config",
"--out-dir", "stage-#{v}"

stage_dir = Pathname("stage-#{v}#{HOMEBREW_PREFIX}")
mkdir_p lib/neon_postgres.name/v
mv stage_dir/"lib/neon-postgres/#{v}/pg_tiktoken.#{dlsuffix}", lib/neon_postgres.name/v
mv stage_dir/"lib/neon-postgres/#{v}/pg_tiktoken.#{neon_postgres.dlsuffix(v)}", lib/neon_postgres.name/v

from_ext_dir = stage_dir/"share/neon-postgres/#{v}/extension"
to_ext_dir = share/neon_postgres.name/v/"extension"
Expand Down

0 comments on commit f0d205c

Please sign in to comment.