Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cirrus.tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ env:
# Build test dependencies as part of the build step, to see compiler
# errors/warnings in one place.
MBUILD_TARGET: all testprep
MTEST_ARGS: --print-errorlogs --no-rebuild -C build
MTEST_ARGS: --print-errorlogs --no-rebuild --maxfail=3 -C build
PGCTLTIMEOUT: 120 # avoids spurious failures during parallel tests
TEMP_CONFIG: ${CIRRUS_WORKING_DIR}/src/tools/ci/pg_ci_base.conf
PG_TEST_EXTRA: kerberos ldap ssl libpq_encryption load_balance oauth
Expand Down
71 changes: 71 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# the official .clang-format style for https://github.com/taocpp
#
# clang-format-4.0 -i -style=file $(find -name '[^.]*.[hc]pp')

Language: Cpp
Standard: Cpp11

AccessModifierOffset: -3
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterEnum : true
AfterFunction : true
AfterNamespace : true
AfterStruct : true
AfterUnion : true
BeforeCatch : true
BeforeElse : true
IndentBraces : false
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: false
BreakStringLiterals: false
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 0
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 3
ContinuationIndentWidth: 3
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
IndentWidth: 3
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
PointerAlignment: Left
ReflowComments: false
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Never
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: true
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpacesInParentheses: true
SpacesInSquareBrackets: true
TabWidth: 8
UseTab: Never
18 changes: 18 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Bootstrap nix-direnv (ensures specific version, robust)
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
fi

# Watch flake.nix for changes to reload the environment
watch_file flake.nix

# Use the Nix flake to provide the development environment
use flake

# Set consistent locale for development environment
#export LANGUAGE=C.utf8
#export LANG=C.utf8
#export LC_ALL=C.utf8

# IKOS-specific environment variable (keep if needed for your IKOS workflow)
export IKOS_SCAN_NOTIFIER_FILES=""
46 changes: 46 additions & 0 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build all (WIP)

on:
workflow_dispatch:

env:
GITHUB_TOKEN: ${{ secrets.ACTION_API_PAT }}

jobs:

# Github can only have nesting of up to 20 actions in a single action
# run. We'll need way more than that, as we have actions to get the
# version, setup the compiler, upload builds and far more. So, we need
# to manually call other actions using the API to build everything.
package-tools:
runs-on: ubuntu-latest
steps:
- name: package-diffutils
run: |
curl -s -X POST -H "Authorization: Bearer ${{ env.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" -d '{"ref":"main"}' \
https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows/diffutils.yml/dispatches

- name: package-meson
run: |
curl -s -X POST -H "Authorization: Bearer ${{ env.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" -d '{"ref":"main"}' \
https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows/meson.yml/dispatches

- name: package-ninja
run: |
curl -s -X POST -H "Authorization: Bearer ${{ env.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" -d '{"ref":"main"}' \
https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows/ninja.yml/dispatches

- name: package-pkgconf
run: |
curl -s -X POST -H "Authorization: Bearer ${{ env.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" -d '{"ref":"main"}' \
https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows/pkgconf.yml/dispatches

- name: package-winflexbison
run: |
curl -s -X POST -H "Authorization: Bearer ${{ env.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" -d '{"ref":"main"}' \
https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows/winflexbison.yml/dispatches
196 changes: 196 additions & 0 deletions .github/workflows/bundle-deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
name: Bundle dependencies

on:
workflow_dispatch:
workflow_call:
schedule:
- cron: "00 04 * * *"

jobs:
get-versions:
uses: ./.github/workflows/manifest.yml
with:
config-path: manifest.json

build-all-deps:
needs: get-versions
env:
DIFFUTILS_VERSION: ${{needs.get-versions.outputs.DIFFUTILS_VERSION}}
GETTEXT_VERSION: ${{needs.get-versions.outputs.GETTEXT_VERSION}}
ICU_VERSION: ${{needs.get-versions.outputs.ICU_VERSION}}
KRB5_VERSION: ${{needs.get-versions.outputs.KRB5_VERSION}}
LIBICONV_VERSION: ${{needs.get-versions.outputs.LIBICONV_VERSION}}
LIBXML2_VERSION: ${{needs.get-versions.outputs.LIBXML2_VERSION}}
LIBXSLT_VERSION: ${{needs.get-versions.outputs.LIBXSLT_VERSION}}
LZ4_VERSION: ${{needs.get-versions.outputs.LZ4_VERSION}}
MESON_VERSION: ${{needs.get-versions.outputs.MESON_VERSION}}
NINJA_VERSION: ${{needs.get-versions.outputs.NINJA_VERSION}}
OPENSSL_VERSION: ${{needs.get-versions.outputs.OPENSSL_VERSION}}
OSSP-UUID_VERSION: ${{needs.get-versions.outputs.OSSP-UUID_VERSION}}
PKGCONF_VERSION: ${{needs.get-versions.outputs.PKGCONF_VERSION}}
WINFLEXBISON_VERSION: ${{needs.get-versions.outputs.WINFLEXBISON_VERSION}}
ZLIB_VERSION: ${{needs.get-versions.outputs.ZLIB_VERSION}}
ZSTD_VERSION: ${{needs.get-versions.outputs.ZSTD_VERSION}}


runs-on: windows-latest
steps:
- name: Download diffutils
uses: dawidd6/action-download-artifact@v3
with:
workflow: diffutils.yml
workflow_conclusion: success
name: diffutils-${{ env.DIFFUTILS_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

- name: Download gettext
uses: dawidd6/action-download-artifact@v3
with:
workflow: gettext.yml
workflow_conclusion: success
name: gettext-${{ env.GETTEXT_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

- name: Download icu
uses: dawidd6/action-download-artifact@v3
with:
workflow: icu.yml
workflow_conclusion: success
name: icu-${{ env.ICU_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

- name: Download krb5
uses: dawidd6/action-download-artifact@v3
with:
workflow: krb5.yml
workflow_conclusion: success
name: krb5-${{ env.KRB5_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

- name: Download libiconv
uses: dawidd6/action-download-artifact@v3
with:
workflow: libiconv.yml
workflow_conclusion: success
name: libiconv-${{ env.LIBICONV_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

- name: Download libxml2
uses: dawidd6/action-download-artifact@v3
with:
workflow: libxml2.yml
workflow_conclusion: success
name: libxml2-${{ env.LIBXML2_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

- name: Download libxslt
uses: dawidd6/action-download-artifact@v3
with:
workflow: libxslt.yml
workflow_conclusion: success
name: libxslt-${{ env.LIBXSLT_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

- name: Download lz4
uses: dawidd6/action-download-artifact@v3
with:
workflow: lz4.yml
workflow_conclusion: success
name: lz4-${{ env.LZ4_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

- name: Download meson
uses: dawidd6/action-download-artifact@v3
with:
workflow: meson.yml
workflow_conclusion: success
name: meson-${{ env.MESON_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

- name: Download ninja
uses: dawidd6/action-download-artifact@v3
with:
workflow: ninja.yml
workflow_conclusion: success
name: ninja-${{ env.NINJA_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

- name: Download openssl
uses: dawidd6/action-download-artifact@v3
with:
workflow: openssl.yml
workflow_conclusion: success
name: openssl-${{ env.OPENSSL_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

- name: Download ossp-uuid
uses: dawidd6/action-download-artifact@v3
with:
workflow: ossp-uuid.yml
workflow_conclusion: success
name: ossp-uuid-${{ env.OSSP-UUID_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

- name: Download pkgconf
uses: dawidd6/action-download-artifact@v3
with:
workflow: pkgconf.yml
workflow_conclusion: success
name: pkgconf-${{ env.PKGCONF_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

- name: Download winflexbison
uses: dawidd6/action-download-artifact@v3
with:
workflow: winflexbison.yml
workflow_conclusion: success
name: winflexbison-${{ env.WINFLEXBISON_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

- name: Download zlib
uses: dawidd6/action-download-artifact@v3
with:
workflow: zlib.yml
workflow_conclusion: success
name: zlib-${{ env.ZLIB_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

- name: Download zstd
uses: dawidd6/action-download-artifact@v3
with:
workflow: zstd.yml
workflow_conclusion: success
name: zstd-${{ env.ZSTD_VERSION }}-win64
path: /builddeps
if_no_artifact_found: fail

# github errors out due to too many files :(
- name: Remove docs
run: |
rm.exe -rf `
\builddeps\share\docs `
\builddeps\mesonbuild\docs `
"\builddeps\mesonbuild\test cases" `
\builddeps\html

- name: Upload Binaries
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: all-deps-win64
path: /builddeps
40 changes: 40 additions & 0 deletions .github/workflows/diffutils.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Package diffutils

on:
workflow_dispatch:
workflow_call:
schedule:
- cron: "00 00 * * *"

jobs:
get-versions:
uses: ./.github/workflows/manifest.yml
with:
config-path: manifest.json

package-diffutils:
runs-on: windows-latest
needs: get-versions
env:
DIFFUTILS_VERSION: ${{needs.get-versions.outputs.DIFFUTILS_VERSION}}

steps:
- name: Download
run: |
curl -L -o diffutils.zip "https://downloads.sourceforge.net/project/gnuwin32/diffutils/${{ env.DIFFUTILS_VERSION }}/diffutils-${{ env.DIFFUTILS_VERSION }}-bin.zip"
mkdir diffutils
cd diffutils
unzip ../diffutils.zip

- name: Download dependencies
run: |
curl -L -o diffutils-deps.zip "https://downloads.sourceforge.net/project/gnuwin32/diffutils/${{ env.DIFFUTILS_VERSION }}/diffutils-${{ env.DIFFUTILS_VERSION }}-dep.zip"
cd diffutils
unzip ../diffutils-deps.zip

- name: Upload Binaries
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: diffutils-${{ env.DIFFUTILS_VERSION }}-win64
path: diffutils
Loading