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

Setup a CI #42

Closed
weiznich opened this issue Jul 29, 2022 · 6 comments
Closed

Setup a CI #42

weiznich opened this issue Jul 29, 2022 · 6 comments

Comments

@weiznich
Copy link
Collaborator

We should setup a CI job for this repository to check if everything builds correctly.

We should test the following cases listed in our Readme:

  • First it will look for an environment variable in the format of PQ_LIB_DIR_{TARGET} where {TARGET} gets replaced by the Target environment variable set for cross-compilation
  • Second, if the environment variable PQ_LIB_DIR is set, it will use its value
  • If the environment variable isn't set, it tries to use pkg-config to locate it. All the config options, such as PKG_CONFIG_ALLOW_CROSS, PKG_CONFIG_ALL_STATIC etc., of the crate pkg-config apply.
  • Then, for MSVC ABI builds the build script will attempt use the library from a vcpkg installation if there is one available. You may need to set VCPKG_ROOT (or run vcpkg integrate install), set VCPKGRS_DYNAMIC=1, and run vcpkg install libpq:x64-windows. See the documentation for the vcpkg crate for more.
  • If it still can't locate the library, it will invoke the Postgres command pg_config --libdir

Optimally this should be tested for windows, macos + linux.

@chadelofson
Copy link

I can work on a Github Action for that.

@weiznich
Copy link
Collaborator Author

weiznich commented Aug 6, 2022

That would be great ❤️

Diesel's CI configuration is likely a good starting point for how libpq can be setup on the different operating systems. Otherwise please just reach out if you have problems somewhere.

@chadelofson
Copy link

I am using the Diesel CI config for the starting point. Do you need to have this tested on the Stable, Beta and Nightly versions of Rust?

@weiznich
Copy link
Collaborator Author

weiznich commented Aug 8, 2022

Just testing on stable would be fine.

@chadelofson
Copy link

  • First it will look for an environment variable in the format of PQ_LIB_DIR_{TARGET} where {TARGET} gets replaced by the Target environment variable set for cross-compilation
  • Second, if the environment variable PQ_LIB_DIR is set, it will use its value
  • If the environment variable isn't set, it tries to use pkg-config to locate it. All the config options, such as PKG_CONFIG_ALLOW_CROSS, PKG_CONFIG_ALL_STATIC etc., of the crate pkg-config apply.
  • Then, for MSVC ABI builds the build script will attempt use the library from a vcpkg installation if there is one available. You may need to set VCPKG_ROOT (or run vcpkg integrate install), set VCPKGRS_DYNAMIC=1, and run vcpkg install libpq:x64-windows. See the documentation for the vcpkg crate for more.
  • If it still can't locate the library, it will invoke the Postgres command pg_config --libdir

@weiznich
Copy link
Collaborator Author

weiznich commented Nov 7, 2023

This was implemented by #45

@weiznich weiznich closed this as completed Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants