Skip to content

Commit

Permalink
Merge pull request #80 from phalcon/development
Browse files Browse the repository at this point in the history
v1.3.2
  • Loading branch information
sergeyklay authored Sep 30, 2019
2 parents f58b66c + 5310b49 commit 8c7be2f
Show file tree
Hide file tree
Showing 85 changed files with 3,126 additions and 18,665 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1.3.1-{build}
version: 1.3.2-{build}

environment:
matrix:
Expand Down
43 changes: 19 additions & 24 deletions .ci/after-failure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,34 @@
# For the full copyright and license information, please view
# the LICENSE file that was distributed with this source code.

$(phpenv which php) -v
$(phpenv which php) -m

PROJECT_ROOT=$(readlink -enq "$(dirname $0)/../")
cd ${PROJECT_ROOT}

shopt -s nullglob

for i in `find ./tests -name "*.out" 2>/dev/null`; do
echo "-- START ${i}"; cat ${i}; echo "-- END";
done

for i in `find ./tests -name "*.mem" 2>/dev/null`; do
echo "-- START ${i}"; cat ${i}; echo "-- END";
done

if [ -f "./configure.log" ]; then
cat "./configure.log"
fi

ls -al ${PROJECT_ROOT}

export LC_ALL=C

for i in core core.*; do
if [ -f "$i" -a "$(file "$i" | grep -o 'core file')" ]; then
gdb -q $(file "${i}" | grep -oE "'[^ ']+" | sed "s/^'//g") "$i" <<EOF
while IFS= read -r -d '' file
do
(( count++ ))
(>&1 printf ">>> START (%d)\\n%s\\n<<< END (%d)\\n\\n" $count "$(cat "$file")" $count)
done < <(find ./tests -type f \( -name '*.out' -o -name '*.mem' \) -print0)

# for some reason Ubuntu 18.04 on Travis CI doesn't install gdb
function install_gdb() {
if [ "${CI}" = "true" ] && [ "$(command -v gdb 2>/dev/null)" = "" ]
then
(>&1 echo "Install gdb...")
sudo apt-get install --no-install-recommends --quiet --assume-yes gdb 1> /dev/null
fi
}

for i in /tmp/core.php.*; do
install_gdb
(>&1 printf "Found core dump file: %s\\n\\n" "$i")
gdb -q "$(phpenv which php)" "$i" <<EOF
set pagination 0
backtrace full
info registers
x/16i \$pc
thread apply all backtrace
quit
EOF
fi
done
71 changes: 35 additions & 36 deletions .ci/install-re2c.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,65 +8,64 @@
# the LICENSE file that was distributed with this source code.

if [ -z ${RE2C_VERSION+x} ]; then
>&2 echo "The RE2C_VERSION value is not set. Stop."
exit 1
>&2 echo "The RE2C_VERSION value is not set. Stop."
exit 1
fi

if [ "${RE2C_VERSION}" == "system" ]; then
echo "Use system re2c. Skip."
exit 0
echo "Use system re2c. Skip."
exit 0
fi

pkgname=re2c
source="https://github.com/skvadrik/${pkgname}/releases/download/${RE2C_VERSION}/${pkgname}-${RE2C_VERSION}.tar.gz"
source="https://github.com/skvadrik/${pkgname}/releases/download/${RE2C_VERSION}/${pkgname}-${RE2C_VERSION}.tar.xz"
downloaddir="${HOME}/.cache/${pkgname}/${pkgname}-${RE2C_VERSION}"
prefix="${HOME}/.local/opt/${pkgname}/${pkgname}-${RE2C_VERSION}"
bindir="${prefix}/bin"

if [ ! -f "${bindir}/re2c" ]; then
if [ ! -d `dirname ${downloaddir}` ]; then
mkdir -p `dirname ${downloaddir}`
fi

cd `dirname ${downloaddir}`
if [ ! -d `dirname ${downloaddir}` ]; then
mkdir -p `dirname ${downloaddir}`
fi
cd "$(dirname "$downloaddir")" || exit 1

if [ ! -f "${pkgname}-${RE2C_VERSION}.tar.gz" ]; then
curl -sSL "$source" -o "${pkgname}-${RE2C_VERSION}.tar.gz"
fi
if [ ! -f "${pkgname}-${RE2C_VERSION}.tar.xz" ]; then
curl -sSL "$source" -o "${pkgname}-${RE2C_VERSION}.tar.xz"
fi

if [ ! -f "${pkgname}-${RE2C_VERSION}.tar.gz" ]; then
>&2 echo "Unable to locate ${pkgname}-${RE2C_VERSION}.tar.gz file. Stop."
exit 1
fi
if [ ! -f "${pkgname}-${RE2C_VERSION}.tar.xz" ]; then
>&2 echo "Unable to locate ${pkgname}-${RE2C_VERSION}.tar.xz file. Stop."
exit 1
fi

if [ ! -d "${downloaddir}" ]; then
mkdir -p "${downloaddir}"
tar -zxf "${pkgname}-${RE2C_VERSION}.tar.gz"
fi
if [ ! -d "${downloaddir}" ]; then
mkdir -p "${downloaddir}"
tar -xf "${pkgname}-${RE2C_VERSION}.tar.xz" || exit 1
fi

if [ ! -d "${downloaddir}" ]; then
>&2 echo "Unable to locate re2c source. Stop."
exit 1
fi
if [ ! -d "${downloaddir}" ]; then
>&2 echo "Unable to locate re2c source. Stop."
exit 1
fi

if [ ! -d "${prefix}" ]; then
mkdir -p "${prefix}"
fi
if [ ! -d "${prefix}" ]; then
mkdir -p "${prefix}"
fi

cd "${downloaddir}"
./configure --prefix="${prefix}"
cd "${downloaddir}" || exit 1
./configure --prefix="${prefix}"

make -j"$(getconf _NPROCESSORS_ONLN)"
make install
make -j"$(getconf _NPROCESSORS_ONLN)"
make install
fi

if [ ! -x "${bindir}/re2c" ]; then
>&2 echo "Unable to locate re2c executable. Stop."
exit 1
>&2 echo "Unable to locate re2c executable. Stop."
exit 1
fi

mkdir -p ${HOME}/bin
ln -s "${bindir}/re2c" ${HOME}/bin/re2c
mkdir -p "${HOME}/bin"
ln -s "${bindir}/re2c" "${HOME}/bin/re2c"

re2c --version
exit 0
40 changes: 0 additions & 40 deletions .ci/run-tests.sh

This file was deleted.

13 changes: 4 additions & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@

# top-most EditorConfig file
root = true
charset = utf-8
trim_trailing_whitespace = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true

[*.{php,phpt,xml,json,w32}]
[*.{yml,m4,sh,md,php,phpt,xml,json,w32}]
indent_style = space

[*.{yml,m4}]
[*.{yml,m4,sh}]
indent_size = 2
indent_style = space

[*.md]
indent_style = space
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*.o
*.lo
*.la
*.profraw

.deps
.libs
acinclude.m4
Expand Down Expand Up @@ -41,6 +43,8 @@ php_test_results_*

# Parser files
/parser/lemon
/parser/parser.c
/parser/scanner.c
/parser/zephir.c
/parser/zephir.h
/parser/zephir.out
Expand Down
65 changes: 43 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
language: php

php:
- 'master'
- '7.4snapshot'
- '7.3'
- '7.2'
- '7.1'
- '7.0'

git:
depth: 1
quiet: true
depth: 5

notifications:
email: false

addons:
apt:
Expand All @@ -17,53 +22,69 @@ addons:
- lcov

env:
global:
- MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
- ZEND_DONT_UNLOAD_MODULES=1
- USE_ZEND_ALLOC=0
- TRAVIS_COMMIT_LOG=`git log --format=fuller -2`
matrix:
- RE2C_VERSION="0.13.6"
- RE2C_VERSION="1.1.1"
- RE2C_VERSION="1.2.1"

matrix:
fast_finish: true
allow_failures:
- php: 'master'

cache:
apt: true
timeout: 604800
directories:
- ${HOME}/.local/opt
- ${HOME}/.cache/re2c
- $HOME/.local/opt
- $HOME/.cache/re2c

before_install:
- phpenv config-rm xdebug.ini || true
- ulimit -c unlimited -S
- ulimit -c unlimited -S || true
- echo '/tmp/core.%e.%p.%t' | sudo tee /proc/sys/kernel/core_pattern

install:
- .ci/install-re2c.sh
- phpize
- aclocal && libtoolize --copy --force && autoheader && autoconf
- |
./configure \
--with-php-config=$(phpenv which php-config) \
--enable-zephir-parser \
--enable-zephir-parser-debug \
--enable-coverage \
LDFLAGS="${LDFLAGS} --coverage" \
CFLAGS="${CFLAGS} -O0 -ggdb -fprofile-arcs -ftest-coverage" \
CXXFLAGS="${CXXFLAGS} -O0 -ggdb -fprofile-arcs -ftest-coverage"
- make -j"$(getconf _NPROCESSORS_ONLN)"
./configure \
--with-php-config=$(phpenv which php-config) \
--enable-zephir-parser \
--enable-zephir-parser-debug \
--enable-coverage
- make

before_script:
- make coverage-initial
- |
if [ "$(php-config --vernum)" -ge "70300" ]; then
echo "Patching PHP tests runner to silence messages about PHP memory leaks ¯\_(ツ)_/¯"
# TODO: Move to makefile
search_str="valgrind -q --tool=.* --trace-children=yes"
add_str="--suppressions=./tests/php-$(php-config --version | cut -d'.' -f1,2).supp"
sed -e "s|[\"']\($search_str\)[\"']|\"\1 $add_str\"|" run-tests.php > tmp.php
mv tmp.php run-tests.php
grep 'valgrind -q --tool=' run-tests.php
echo "Done"
fi
script:
- .ci/run-tests.sh
- make test NO_INTERACTION=1 REPORT_EXIT_STATUS=1 TEST_PHP_ARGS=-m

after_failure:
- echo "$($(phpenv which php) -v)"
- echo "$($(phpenv which php) -m)"
- .ci/after-failure.sh

after_success:
- make coverage-capture
- if [ ! -z "${CODECOV_TOKEN}" ]; then bash <(curl -s https://codecov.io/bash); fi
- bash <(curl -s https://codecov.io/bash)

notifications:
email: false
after_script:
- printf "$TRAVIS_COMMIT_RANGE\n"
- printf "$TRAVIS_COMMIT_LOG\n"
17 changes: 16 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
## [1.3.2] - 2019-09-30
### Changed
- Files `parser.c` and `scanner.c` no longer distributed.
Package maintainer should re-generate they by himself.
[#75](https://github.com/phalcon/php-zephir-parser/pull/75)

### Fixed
- Fixed `return_value` and `this_ptr` naming collision
[phalcon/zephir#1660](https://github.com/phalcon/zephir/issues/1660)
- Fixed underscore only identifiers to allow more than 4 characters
[#75](https://github.com/phalcon/php-zephir-parser/pull/75)
- Update LDFLAGS to reduce linker warnings
- Fixed PHP 7.4 support

## [1.3.1] - 2019-05-01
### Fixed
- Fixed `config.m4` to correct install headers
Expand Down Expand Up @@ -128,7 +142,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added
- Initial stable release

[Unreleased]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.1...HEAD
[Unreleased]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.2...HEAD
[1.3.2]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.1...v1.3.2
[1.3.1]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.0...v1.3.1
[1.3.0]: https://github.com/phalcon/php-zephir-parser/compare/v1.2.0...v1.3.0
[1.2.0]: https://github.com/phalcon/php-zephir-parser/compare/v1.1.4...v1.2.0
Expand Down
Loading

0 comments on commit 8c7be2f

Please sign in to comment.