Skip to content

[pull] master from Tecnativa:master#5

Open
pull[bot] wants to merge 48 commits into
itpp-labs:masterfrom
Tecnativa:master
Open

[pull] master from Tecnativa:master#5
pull[bot] wants to merge 48 commits into
itpp-labs:masterfrom
Tecnativa:master

Conversation

@pull

@pull pull Bot commented Jun 22, 2022

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull Bot added 👽 pull from Tecnativa merge-conflict Resolve conflicts manually labels Jun 23, 2022
josep-tecnativa and others added 21 commits November 7, 2025 13:47
pgvector library files are stored under /usr/share and /usr/lib, but postgres is looking for extension files under /usr/local/share and /usr/local/lib.

With this change we move the extension files to the expected directories.
[FIX] pgvector files: copy extension files to /local/ folder
[FIX] pgvector install for Alpine Postgres images
[FIX] Define correctly PGVECTOR_VERSION
[FIX] fix alpine dependencies for pg_vector compilation
The ultimate goal of this commit is to support building arm64, but I
wound up changing a few different things along the way as well.
First of all, we build the image for both architectures in one step,
but then we have to push it to a local registry in order to pull each
architecture and test. Then, once the tests have passed, we re-tag the
image or manifest from the local registry and push it to ghcr and
Dockerhub (if Dockerhub credentials exist).
Not essential to this task, but very beneficial for myself and any
future contributors, I have made the whole thing repo agnostic, so
anyone can just fork and test, no CI customization required.
Node.js 20 is EOL, so we need to move to actions that support node.js 24
pre-commit/action should also be updated, but it seems the pre-commit
team has abandoned this Github action in favor of their https://pre-commit.ci/
service. This will have to wait for another time.
Base for Postgres 14-18 was bumped from alpine v3.23 to v3.24 in
docker-library/official-images@769849f

Alpine v3.24 dropped support for clang19/llvm19, which caused
pgvector-build to fail for versions 14 and up.

As it turns out, using hardcoded clang19/llvm19 was already not the best idea
as it did not match the version used by postgres itself. Only postgres 13
uses clang19 and llvm19, everything above uses clang21 and llvm21.

Also, pgvector 0.8.1 does not support pg12
https://github.com/pgvector/pgvector/blob/fb1b8966ebb9254032b6d0e7a594fdcc86f8efcc/CHANGELOG.md?plain=1#L34

Ultimately, I beleive pgvector was only properly installed in a few versions.
This commit makes sure it is installed from 13 upwards and also tests that
it is installed and working.
Fork PRs previously skipped the build-test-push job entirely,
preventing contributors from getting build and test feedback.

The GHCR push step used || between independent secrets:
BOT_TOKEN || GITHUB_TOKEN and BOT_LOGIN || repository_owner.
When only one BOT_* secret was set, credentials became a mismatched
pair, causing a denied: denied authentication failure from ghcr.io.

Changes:
- Remove same-repo restriction from job condition so all PRs
  run the pipeline.
- Use && to ensure both BOT_TOKEN and BOT_LOGIN must exist
  together to be used; otherwise fall back to the always-
  available GITHUB_TOKEN + github.repository_owner pair.
- Expose BOT_TOKEN and BOT_LOGIN as env vars so they can be
  evaluated in the if: condition.
- Allow GHCR push on fork PRs when bot credentials are
  available; skip only when GITHUB_TOKEN would be read-only
  (fork PR without BOT_TOKEN/BOT_LOGIN).
- Use github.repository_owner as fallback username instead of
  github.actor to avoid confusion in org fork scenarios.
ci: run build-test-push on all PRs, not just same-repo
Without explicit CFLAGS, make detects the host CPU features (e.g. AVX-512)
and generates a .so that crashes with "signal 4: Illegal instruction"
on older x86-64 CPUs.

Pinning -march=x86-64-v2 ensures compatibility with any x86-64
processor from the last ~15 years.

Without this patch, for example you cannot install PGVector if your server
runs an Intel® i9-13900 processor.

ARM64 builds are not affected.

@moduon MT-14612
fix(pgvector): target x86-64-v2 for CPU portability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants