Skip to content

Commit

Permalink
Partial migration of config code generation to C.
Browse files Browse the repository at this point in the history
Parse enough of config.yaml to auto-generate config.auto.h and config.auto.c.

This commit implements most of the infrastructure needed to migrate the rest of the build code to C, but each set of auto-generated files will present its own challenges.

The build is now dependent on libyaml. At this point there is no need for a hard requirement, but that will come soon so it seems better to add the dependency now.
  • Loading branch information
dwsteele committed Jul 18, 2021
1 parent 18ffec7 commit c5ae047
Show file tree
Hide file tree
Showing 29 changed files with 1,989 additions and 562 deletions.
8 changes: 4 additions & 4 deletions .cirrus.yml
Expand Up @@ -15,7 +15,7 @@ freebsd_12_task:
cpu: 4
memory: 4G

install_script: pkg install -y bash git postgresql-libpqxx pkgconf libxml2 gmake perl5 p5-YAML-LibYAML rsync
install_script: pkg install -y bash git postgresql-libpqxx pkgconf libxml2 gmake perl5 libyaml p5-YAML-LibYAML rsync

script:
- perl ${CIRRUS_WORKING_DIR}/test/test.pl --no-gen --make-cmd=gmake --vm=none --vm-max=2 --no-coverage --no-valgrind --module=command --test=backup
Expand All @@ -30,12 +30,12 @@ macos_catalina_task:
image: catalina-xcode

environment:
LDFLAGS: -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/libpq/lib -L/usr/local/opt/libxml2/lib
CPPFLAGS: -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/libpq/include -I/usr/local/opt/libxml2/include/libxml2
LDFLAGS: -L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/libpq/lib -L/usr/local/opt/libxml2/lib -L/usr/local/opt/libyaml/lib
CPPFLAGS: -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/libpq/include -I/usr/local/opt/libxml2/include/libxml2 -I/usr/local/opt/libyaml/include
PERL5LIB: /usr/local/opt/perl5/lib/perl5

install_script:
- brew install -q openssl@1.1 libpq libxml2 cpanm
- brew install -q openssl@1.1 libpq libxml2 libyaml cpanm
- cpanm --local-lib=/usr/local/opt/perl5 install YAML::XS

script:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -73,6 +73,9 @@ jobs:
- name: Checkout Code
uses: actions/checkout@v2

- name: Install Packages
run: sudo apt-get install -y --no-install-recommends libyaml-dev

- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -21,7 +21,7 @@ pgbackrest-dev => Install development tools
sudo apt-get install rsync git devscripts build-essential valgrind lcov autoconf \
autoconf-archive libssl-dev zlib1g-dev libxml2-dev libpq-dev pkg-config \
libxml-checker-perl libyaml-perl libdbd-pg-perl liblz4-dev liblz4-tool \
zstd libzstd-dev bzip2 libbz2-dev
zstd libzstd-dev bzip2 libbz2-dev libyaml-dev
```

Some unit tests and all the integration tests require Docker. Running in containers allows us to simulate multiple hosts, test on different distributions and versions of PostgreSQL, and use sudo without affecting the host system.
Expand Down
320 changes: 0 additions & 320 deletions build/lib/pgBackRestBuild/Config/Build.pm

This file was deleted.

2 changes: 1 addition & 1 deletion build/lib/pgBackRestBuild/Config/BuildHelp.pm
Expand Up @@ -20,7 +20,7 @@ use pgBackRestDoc::Common::String;
use pgBackRestDoc::ProjectInfo;

use pgBackRestBuild::Build::Common;
use pgBackRestBuild::Config::Build;
use pgBackRestBuild::Config::BuildParse;
use pgBackRestBuild::Config::Data;

####################################################################################################################################
Expand Down

0 comments on commit c5ae047

Please sign in to comment.