Skip to content

Commit

Permalink
Merge branch 'master' into master-patched
Browse files Browse the repository at this point in the history
  • Loading branch information
JeDaYoshi committed Aug 7, 2024
2 parents ea551e0 + 0506e95 commit 70b9991
Show file tree
Hide file tree
Showing 1,169 changed files with 85,569 additions and 17,833 deletions.
33 changes: 6 additions & 27 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,27 @@
# TODO: test msvc
version: 0.0.0.0.1-branch-{branch}-build-{build}
clone_depth: 10
environment:
matrix:
- cygwin_url: https://cygwin.com/setup-x86_64.exe
build_with: cmake
- cygwin_url: https://cygwin.com/setup-x86.exe
build_with: cmake
- cygwin_url: https://cygwin.com/setup-x86_64.exe
build_with: autoconf
- cygwin_url: https://cygwin.com/setup-x86.exe
build_with: autoconf
install:
- ps: Invoke-WebRequest $env:cygwin_url -OutFile c:\cygwin-setup.exe
- ps: Invoke-WebRequest https://cygwin.com/setup-x86_64.exe -OutFile c:\cygwin-setup.exe
# libcrypt-devel is needed only on x86_64 and only for modperl... probably some dependency problem.
- c:\cygwin-setup.exe --quiet-mode --no-shortcuts --no-startmenu --no-desktop --upgrade-also --only-site --site http://cygwin.mirror.constant.com/ --root c:\cygwin-root --local-package-dir c:\cygwin-setup-cache --packages automake,gcc-g++,make,pkg-config,wget,openssl-devel,libicu-devel,zlib-devel,libcrypt-devel,perl,python3-devel,swig,libsasl2-devel,libQt5Core-devel,cmake,libboost-devel,gettext-devel
- c:\cygwin-setup.exe --quiet-mode --no-shortcuts --no-startmenu --no-desktop --upgrade-also --only-site --site http://cygwin.mirror.constant.com/ --root c:\cygwin-root --local-package-dir c:\cygwin-setup-cache --packages gcc-g++,make,pkg-config,wget,libssl-devel,libicu-devel,zlib-devel,libcrypt-devel,perl,python3-devel,swig,libsasl2-devel,libQt5Core-devel,cmake,libboost-devel,gettext-devel,libargon2-devel
- c:\cygwin-root\bin\sh -lc "echo Hi"
- c:\cygwin-root\bin\sh -lc "uname -a"
- c:\cygwin-root\bin\sh -lc "cat /proc/cpuinfo"
- c:\cygwin-root\bin\sh -lc "cat /proc/meminfo"
- c:\cygwin-root\bin\sh -lc "cygcheck -s -v > $APPVEYOR_BUILD_FOLDER/cygcheck.log 2>&1"
- ps: Push-AppveyorArtifact cygcheck.log
- ps: |
if ($env:build_with -eq "cmake") {
$env:cfg_suffix = ".sh"
$env:unittest = "unittest"
$env:inttest = "inttest"
} else {
$env:cfg_suffix = ""
$env:unittest = "test"
$env:inttest = "test2"
}
# stdin is broken at AppVeyor, so we open it explicitly as /dev/null
build_script:
- git submodule update --init
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER; ./autogen.sh < /dev/null"
- mkdir build
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; ../configure$cfg_suffix --enable-charset --enable-zlib --enable-openssl --enable-perl --enable-python --enable-cyrus < /dev/null; result=$?; if [[ $build_with == cmake ]]; then cmake --system-information > config.log; fi; appveyor PushArtifact config.log; exit $result"
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; ../configure --enable-charset --enable-zlib --enable-openssl --enable-perl --enable-python --enable-cyrus --enable-argon < /dev/null; result=$?; cmake --system-information > config.log; appveyor PushArtifact config.log; exit $result"
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; make VERBOSE=1 -j2 < /dev/null"
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; make install < /dev/null"
- c:\cygwin-root\bin\sh -lc "znc --version"
# fix fork()
- c:\cygwin-root\bin\sh -lc "find /usr/local/lib/znc -iname '*.dll' -o -iname '*.so' | tee /tmp/files-to-rebase"
- c:\cygwin-root\bin\sh -lc "rebaseall -v -T /tmp/files-to-rebase"
- c:\cygwin-root\bin\sh -lc "rebase -s -v $(cat /tmp/files-to-rebase)"
test_script:
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; make VERBOSE=1 $unittest < /dev/null"
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; make VERBOSE=1 $inttest < /dev/null"
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; make VERBOSE=1 unittest < /dev/null"
- c:\cygwin-root\bin\sh -lc "cd $APPVEYOR_BUILD_FOLDER/build; make VERBOSE=1 inttest < /dev/null"
32 changes: 15 additions & 17 deletions .ci/Jenkinsfile.crowdin
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This script is run daily by https://jenkins.znc.in/ to:
// * upload new English strings to https://crowdin.com/project/znc-bouncer
// * download new translations
// * create a pull request with results to ZNC repo
// * commits results to ZNC repo

import groovy.json.JsonSlurper;
import groovy.json.JsonOutput;
Expand All @@ -11,7 +11,7 @@ def upstream_user = 'znc'
def upstream_repo = 'znc'
def my_user = 'znc-jenkins'
def my_repo = 'znc'
def branches = ['master', '1.7.x']
def branches = ['master', '1.9.x']

def pr_mode = false

Expand All @@ -30,7 +30,7 @@ timestamps {
stage(upstream_branch) {
dir(upstream_branch) {
stage("Checkout ${upstream_branch}") {
checkout([$class: 'GitSCM', branches: [[name: "*/${upstream_branch}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]], userRemoteConfigs: [[credentialsId: '6ef10f80-20dc-4661-af45-52a6e1e15749', name: 'upstream', url: "github.com:${upstream_user}/${upstream_repo}.git"]]])
checkout([$class: 'GitSCM', branches: [[name: "*/${upstream_branch}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'SubmoduleOption', recursiveSubmodules: true]], userRemoteConfigs: [[credentialsId: '6ef10f80-20dc-4661-af45-52a6e1e15749', name: 'upstream', url: "git@github.com:${upstream_user}/${upstream_repo}.git"]]])
}
stage("Prepare strings for ${upstream_branch}") {
dir("build") {
Expand All @@ -50,6 +50,13 @@ timestamps {
}
sh 'LANG=C.UTF-8 find . -name "*.po" -exec msgfilter -i "{}" -o "{}.replacement" .ci/cleanup-po.pl ";"'
sh 'find . -name "*.po" -exec mv "{}.replacement" "{}" ";"'
withCredentials([string(credentialsId: 'fe727e3e-a8e0-4019-817f-6583c3c51ef7', variable: 'CROWDIN_API2_KEY')]) {
def headers = [[maskValue: true, name: 'Authorization', value: "Bearer ${env.CROWDIN_API2_KEY}"], [maskValue: false, name: 'User-Agent', value: 'https://github.com/znc/znc/blob/master/.ci/Jenkinsfile.crowdin']]
def contributors = httpRequest consoleLogResponseBody: true, customHeaders: headers, url: "https://crowdin.com/api/v2/projects/289533/members?limit=500"
writeFile file: 'contributors.tmp', text: contributors.content
}
sh '.ci/crowdin-contributors.py < contributors.tmp'
sh 'rm contributors.tmp'
}
stage("Push ${upstream_branch}") {
sh 'git config user.name "ZNC-Jenkins"'
Expand All @@ -67,24 +74,15 @@ timestamps {
echo 'No changes found'
return
}
sh "git remote add my github.com:${my_user}/${my_repo}.git"
// TODO simplify when https://issues.jenkins-ci.org/browse/JENKINS-28335 is fixed
sh "git remote add my [email protected]:${my_user}/${my_repo}.git"
if (!pr_mode) {
withCredentials([sshUserPrivateKey(credentialsId: 'baf2df74-935d-40e5-b20f-076e92fa3e9f', keyFileVariable: 'GITHUB_KEY')]) {
sh 'echo ssh -i $GITHUB_KEY -l git -o StrictHostKeyChecking=no \\"\\$@\\" > run_ssh.sh'
sh 'chmod +x run_ssh.sh'
withEnv(['GIT_SSH=run_ssh.sh']) {
sh "git push upstream HEAD:refs/heads/${upstream_branch}"
}
sshagent(credentials: ['baf2df74-935d-40e5-b20f-076e92fa3e9f']) {
sh "git push upstream HEAD:refs/heads/${upstream_branch}"
}
return
}
withCredentials([sshUserPrivateKey(credentialsId: '6ef10f80-20dc-4661-af45-52a6e1e15749', keyFileVariable: 'GITHUB_KEY')]) {
sh 'echo ssh -i $GITHUB_KEY -l git -o StrictHostKeyChecking=no \\"\\$@\\" > run_ssh.sh'
sh 'chmod +x run_ssh.sh'
withEnv(['GIT_SSH=run_ssh.sh']) {
sh "git push my HEAD:refs/heads/${my_branch} -f"
}
sshagent(credentials: ['6ef10f80-20dc-4661-af45-52a6e1e15749']) {
sh "git push my HEAD:refs/heads/${my_branch} -f"
}
// Create pull request if it doesn't exist yet
withCredentials([string(credentialsId: '7a2546ae-8a29-4eab-921c-6a4803456dce', variable: 'GITHUB_OAUTH_KEY')]) {
Expand Down
4 changes: 3 additions & 1 deletion .ci/cleanup-po.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
print $text;
} else {
for (split(/^/, $text)) {
print unless /^PO-Revision-Date:/;
next if /^PO-Revision-Date:/;
s/^Last-Translator: \K.*/Various people/;
print;
}
}
25 changes: 25 additions & 0 deletions .ci/crowdin-contributors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python3

import json
import sys

array = []

data = json.load(sys.stdin)
for user in data['data']:
user = user['data']
if user['fullName']:
array.append('* {} ({})'.format(user['username'], user['fullName']))
else:
array.append('* ' + user['username'])

array.sort(key=lambda x: x.lower())

sys.stdout = open('TRANSLATORS.md', 'wt', encoding='utf-8')

print('These people helped translating ZNC to various languages:')
print()
for u in array:
print(u)
print()
print('Generated from https://crowdin.com/project/znc-bouncer')
6 changes: 3 additions & 3 deletions .travis-generate-docs.sh → .ci/generate-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ doxygen
cd "$HOME"
git clone --depth=1 --branch=gh-pages github:znc/docs.git gh-pages || exit 1

cd "$TRAVIS_BUILD_DIR/doc/html/"
cd "$GITHUB_WORKSPACE/doc/html/"
mv ~/gh-pages/.git ./
echo docs.znc.in > CNAME
git add -A
Expand All @@ -28,9 +28,9 @@ if [[ ! -f ~/docs_need_commit ]]; then
fi

git commit -F- <<EOF
Latest docs on successful travis build $TRAVIS_BUILD_NUMBER
Latest docs on successful CI build $GITHUB_RUN_NUMBER
ZNC commit $TRAVIS_COMMIT
ZNC commit $GITHUB_SHA
EOF
git push origin gh-pages

Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ ignore:
- /modules/modpython/znc_core.py
- /modules/modperl/ZNC.pm
fixes:
- "usr/local/lib/znc/::modules/" # C++ and Python seem to work without this, but Perl needs this.
- "usr/local/lib/znc/::modules/"
- "/usr/local/lib/znc/::modules/"
codecov:
ci:
# Cygwin fails integration test with --coverage enabled, I don't know why
Expand Down
55 changes: 55 additions & 0 deletions .github/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
set -x

pwd
ls -la

cpanm --local-lib=~/perl5 local::lib
eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
cpanm --notest Devel::Cover::Report::Clover
pip3 install --user coverage
export ZNC_MODPERL_COVERAGE=1
#export ZNC_MODPYTHON_COVERAGE=1

case "${CC:-gcc}" in
gcc)
export CXXFLAGS="$CXXFLAGS --coverage"
export LDFLAGS="$LDFLAGS --coverage"
;;
clang)
export CXXFLAGS="$CXXFLAGS -fprofile-instr-generate -fcoverage-mapping"
export LDFLAGS="$LDFLAGS -fprofile-instr-generate"
;;
esac

mkdir build
cd build
../configure --enable-debug --enable-perl --enable-python --enable-tcl --enable-cyrus --enable-charset --enable-argon $CFGFLAGS
cmake --system-information

make -j2 VERBOSE=1
env LLVM_PROFILE_FILE="$PWD/unittest.profraw" make VERBOSE=1 unittest
sudo make install
/usr/local/bin/znc --version

# TODO: use DEVEL_COVER_OPTIONS for https://metacpan.org/pod/Devel::Cover
env LLVM_PROFILE_FILE="$PWD/inttest.profraw" ZNC_MODPERL_COVERAGE_OPTS="-db,$PWD/cover_db" PYTHONWARNINGS=error make VERBOSE=1 inttest
ls -lRa

~/perl5/bin/cover --no-gcov --report=clover

case "${CC:-gcc}" in
gcc)
lcov --directory . --capture --output-file lcov-coverage.txt
lcov --list lcov-coverage.txt
;;
clang)
if [[ x$(uname) == xDarwin ]]; then
export PATH=$PATH:/Library/Developer/CommandLineTools/usr/bin
fi
llvm-profdata merge unittest.profraw -o unittest.profdata
llvm-profdata merge inttest.profraw -o inttest.profdata
llvm-cov show -show-line-counts-or-regions -instr-profile=unittest.profdata test/unittest_bin > unittest-cmake-coverage.txt
llvm-cov show -show-line-counts-or-regions -instr-profile=inttest.profdata /usr/local/bin/znc > inttest-znc-coverage.txt
find /usr/local/lib/znc -name '*.so' -or -name '*.bundle' | while read f; do llvm-cov show -show-line-counts-or-regions -instr-profile=inttest.profdata $f > inttest-$(basename $f)-coverage.txt; done
;;
esac
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
4 changes: 4 additions & 0 deletions .github/ubuntu_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sudo apt-get update
sudo apt-get install -y tcl-dev libsasl2-dev libicu-dev swig qtbase5-dev libboost-locale-dev libperl-dev libargon2-dev cpanminus gettext clang llvm lcov
sudo apt-get upgrade -y

Loading

0 comments on commit 70b9991

Please sign in to comment.