-
Notifications
You must be signed in to change notification settings - Fork 29
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
Configuration not correctly loaded when rebuilding postgres #52
Comments
Seems something wrong with the |
Having poked around a bit I think the problem is mostly in the When the contrary to my I am not super fluent in bash, and am not super familiar with Anyway, are you able to reproduce the behaviour of rebuilds not retaining the configuration flags configured initially? Or is there something specific to my environments. Guess not, as I can easily reproduce in a vanilla ubuntu environment. |
Good guess! Thank you a lot, it was a problem with |
When converting the configuration from the old single value approach to the new array one, the `typeset` and `declare` builtins are used. The problem is that the variables must be used as global variables, so that once the configuration is reloaded, the variable value is used. However, seems that `declare - g` is not a valid builtin on Bash on Mac OSX. Therefore, when the variable is written to the configuration file, an explicit `export` for the variable is written too. This ensures that the variable becomes globally scoped. Also fix a problem of not-evaluated variable. Related to theory#52 Close theory#54
When rebuilding a specific postgres version it seems that the configuration does not get correctly loaded.
Given the following
config/default.conf
:When I run
pgenv build 14.2
we get a compiled version of postgres 14.2 with cassert enabled. Simplest way to confirm the build configuration I know is viapg_config
Ignoring the
CFLAGS/LDFLAGS/CPPFLAGS
that I have in my environment we can clearly see the--enable-cassert
as a second configure flag being passed in.Now we run
pgenv rebuild 14.2
.Now the output of pg_config changed as follows:
Again ignore the
CFLAGS/LDFLAGS/CPPFLAGS
we find that the--enable-cassert
flag is missing.In the mean time we see two new config files created in the conf directory.
config/14.2.conf
config/14.2.conf.2022-05-04T13-54.backup
The backup seems to be indicating that at some point in time the flag was correctly stored in the version specific configuration, but unused during the rebuild as per output of
pg_config --configure
. To be completely clear, the only configuration file I have created isconfig/default.conf
, the others are (probably?) created by pgenv during builds.I ran these experiments on OSX 12.3.1, with zsh as a shell.
Both tried bash versions:
Quick experiments and asking around show the same behaviour on Ubuntu (docker ubuntu:22.04).
The text was updated successfully, but these errors were encountered: