Skip to content

Commit 8c7be2f

Browse files
authored
Merge pull request #80 from phalcon/development
v1.3.2
2 parents f58b66c + 5310b49 commit 8c7be2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+3126
-18665
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1.3.1-{build}
1+
version: 1.3.2-{build}
22

33
environment:
44
matrix:

.ci/after-failure.sh

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,34 @@
77
# For the full copyright and license information, please view
88
# the LICENSE file that was distributed with this source code.
99

10-
$(phpenv which php) -v
11-
$(phpenv which php) -m
12-
13-
PROJECT_ROOT=$(readlink -enq "$(dirname $0)/../")
14-
cd ${PROJECT_ROOT}
15-
1610
shopt -s nullglob
1711

18-
for i in `find ./tests -name "*.out" 2>/dev/null`; do
19-
echo "-- START ${i}"; cat ${i}; echo "-- END";
20-
done
21-
22-
for i in `find ./tests -name "*.mem" 2>/dev/null`; do
23-
echo "-- START ${i}"; cat ${i}; echo "-- END";
24-
done
25-
26-
if [ -f "./configure.log" ]; then
27-
cat "./configure.log"
28-
fi
29-
30-
ls -al ${PROJECT_ROOT}
31-
3212
export LC_ALL=C
3313

34-
for i in core core.*; do
35-
if [ -f "$i" -a "$(file "$i" | grep -o 'core file')" ]; then
36-
gdb -q $(file "${i}" | grep -oE "'[^ ']+" | sed "s/^'//g") "$i" <<EOF
14+
while IFS= read -r -d '' file
15+
do
16+
(( count++ ))
17+
(>&1 printf ">>> START (%d)\\n%s\\n<<< END (%d)\\n\\n" $count "$(cat "$file")" $count)
18+
done < <(find ./tests -type f \( -name '*.out' -o -name '*.mem' \) -print0)
19+
20+
# for some reason Ubuntu 18.04 on Travis CI doesn't install gdb
21+
function install_gdb() {
22+
if [ "${CI}" = "true" ] && [ "$(command -v gdb 2>/dev/null)" = "" ]
23+
then
24+
(>&1 echo "Install gdb...")
25+
sudo apt-get install --no-install-recommends --quiet --assume-yes gdb 1> /dev/null
26+
fi
27+
}
28+
29+
for i in /tmp/core.php.*; do
30+
install_gdb
31+
(>&1 printf "Found core dump file: %s\\n\\n" "$i")
32+
gdb -q "$(phpenv which php)" "$i" <<EOF
3733
set pagination 0
3834
backtrace full
3935
info registers
4036
x/16i \$pc
4137
thread apply all backtrace
4238
quit
4339
EOF
44-
fi
4540
done

.ci/install-re2c.sh

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,65 +8,64 @@
88
# the LICENSE file that was distributed with this source code.
99

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

1515
if [ "${RE2C_VERSION}" == "system" ]; then
16-
echo "Use system re2c. Skip."
17-
exit 0
16+
echo "Use system re2c. Skip."
17+
exit 0
1818
fi
1919

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

2626
if [ ! -f "${bindir}/re2c" ]; then
27-
if [ ! -d `dirname ${downloaddir}` ]; then
28-
mkdir -p `dirname ${downloaddir}`
29-
fi
30-
31-
cd `dirname ${downloaddir}`
27+
if [ ! -d `dirname ${downloaddir}` ]; then
28+
mkdir -p `dirname ${downloaddir}`
29+
fi
30+
cd "$(dirname "$downloaddir")" || exit 1
3231

33-
if [ ! -f "${pkgname}-${RE2C_VERSION}.tar.gz" ]; then
34-
curl -sSL "$source" -o "${pkgname}-${RE2C_VERSION}.tar.gz"
35-
fi
32+
if [ ! -f "${pkgname}-${RE2C_VERSION}.tar.xz" ]; then
33+
curl -sSL "$source" -o "${pkgname}-${RE2C_VERSION}.tar.xz"
34+
fi
3635

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

42-
if [ ! -d "${downloaddir}" ]; then
43-
mkdir -p "${downloaddir}"
44-
tar -zxf "${pkgname}-${RE2C_VERSION}.tar.gz"
45-
fi
41+
if [ ! -d "${downloaddir}" ]; then
42+
mkdir -p "${downloaddir}"
43+
tar -xf "${pkgname}-${RE2C_VERSION}.tar.xz" || exit 1
44+
fi
4645

47-
if [ ! -d "${downloaddir}" ]; then
48-
>&2 echo "Unable to locate re2c source. Stop."
49-
exit 1
50-
fi
46+
if [ ! -d "${downloaddir}" ]; then
47+
>&2 echo "Unable to locate re2c source. Stop."
48+
exit 1
49+
fi
5150

52-
if [ ! -d "${prefix}" ]; then
53-
mkdir -p "${prefix}"
54-
fi
51+
if [ ! -d "${prefix}" ]; then
52+
mkdir -p "${prefix}"
53+
fi
5554

56-
cd "${downloaddir}"
57-
./configure --prefix="${prefix}"
55+
cd "${downloaddir}" || exit 1
56+
./configure --prefix="${prefix}"
5857

59-
make -j"$(getconf _NPROCESSORS_ONLN)"
60-
make install
58+
make -j"$(getconf _NPROCESSORS_ONLN)"
59+
make install
6160
fi
6261

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

68-
mkdir -p ${HOME}/bin
69-
ln -s "${bindir}/re2c" ${HOME}/bin/re2c
67+
mkdir -p "${HOME}/bin"
68+
ln -s "${bindir}/re2c" "${HOME}/bin/re2c"
7069

7170
re2c --version
7271
exit 0

.ci/run-tests.sh

Lines changed: 0 additions & 40 deletions
This file was deleted.

.editorconfig

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,17 @@
22

33
# top-most EditorConfig file
44
root = true
5-
charset = utf-8
6-
trim_trailing_whitespace = true
75

86
[*]
97
end_of_line = lf
108
insert_final_newline = true
119
indent_style = tab
1210
indent_size = 4
11+
charset = utf-8
12+
trim_trailing_whitespace = true
1313

14-
[*.{php,phpt,xml,json,w32}]
14+
[*.{yml,m4,sh,md,php,phpt,xml,json,w32}]
1515
indent_style = space
1616

17-
[*.{yml,m4}]
17+
[*.{yml,m4,sh}]
1818
indent_size = 2
19-
indent_style = space
20-
21-
[*.md]
22-
indent_style = space
23-
trim_trailing_whitespace = false

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
*.o
99
*.lo
1010
*.la
11+
*.profraw
12+
1113
.deps
1214
.libs
1315
acinclude.m4
@@ -41,6 +43,8 @@ php_test_results_*
4143

4244
# Parser files
4345
/parser/lemon
46+
/parser/parser.c
47+
/parser/scanner.c
4448
/parser/zephir.c
4549
/parser/zephir.h
4650
/parser/zephir.out

.travis.yml

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
language: php
2+
23
php:
3-
- 'master'
4+
- '7.4snapshot'
45
- '7.3'
56
- '7.2'
67
- '7.1'
78
- '7.0'
89

910
git:
10-
depth: 1
11+
quiet: true
12+
depth: 5
13+
14+
notifications:
15+
email: false
1116

1217
addons:
1318
apt:
@@ -17,53 +22,69 @@ addons:
1722
- lcov
1823

1924
env:
25+
global:
26+
- MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
27+
- ZEND_DONT_UNLOAD_MODULES=1
28+
- USE_ZEND_ALLOC=0
29+
- TRAVIS_COMMIT_LOG=`git log --format=fuller -2`
2030
matrix:
2131
- RE2C_VERSION="0.13.6"
22-
- RE2C_VERSION="1.1.1"
32+
- RE2C_VERSION="1.2.1"
2333

2434
matrix:
2535
fast_finish: true
26-
allow_failures:
27-
- php: 'master'
2836

2937
cache:
3038
apt: true
3139
timeout: 604800
3240
directories:
33-
- ${HOME}/.local/opt
34-
- ${HOME}/.cache/re2c
41+
- $HOME/.local/opt
42+
- $HOME/.cache/re2c
3543

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

4049
install:
4150
- .ci/install-re2c.sh
4251
- phpize
43-
- aclocal && libtoolize --copy --force && autoheader && autoconf
4452
- |
45-
./configure \
46-
--with-php-config=$(phpenv which php-config) \
47-
--enable-zephir-parser \
48-
--enable-zephir-parser-debug \
49-
--enable-coverage \
50-
LDFLAGS="${LDFLAGS} --coverage" \
51-
CFLAGS="${CFLAGS} -O0 -ggdb -fprofile-arcs -ftest-coverage" \
52-
CXXFLAGS="${CXXFLAGS} -O0 -ggdb -fprofile-arcs -ftest-coverage"
53-
- make -j"$(getconf _NPROCESSORS_ONLN)"
53+
./configure \
54+
--with-php-config=$(phpenv which php-config) \
55+
--enable-zephir-parser \
56+
--enable-zephir-parser-debug \
57+
--enable-coverage
58+
- make
5459

5560
before_script:
5661
- make coverage-initial
62+
- |
63+
if [ "$(php-config --vernum)" -ge "70300" ]; then
64+
echo "Patching PHP tests runner to silence messages about PHP memory leaks ¯\_(ツ)_/¯"
65+
66+
# TODO: Move to makefile
67+
search_str="valgrind -q --tool=.* --trace-children=yes"
68+
add_str="--suppressions=./tests/php-$(php-config --version | cut -d'.' -f1,2).supp"
69+
sed -e "s|[\"']\($search_str\)[\"']|\"\1 $add_str\"|" run-tests.php > tmp.php
70+
mv tmp.php run-tests.php
71+
grep 'valgrind -q --tool=' run-tests.php
72+
73+
echo "Done"
74+
fi
5775
5876
script:
59-
- .ci/run-tests.sh
77+
- make test NO_INTERACTION=1 REPORT_EXIT_STATUS=1 TEST_PHP_ARGS=-m
6078

6179
after_failure:
80+
- echo "$($(phpenv which php) -v)"
81+
- echo "$($(phpenv which php) -m)"
6282
- .ci/after-failure.sh
6383

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

68-
notifications:
69-
email: false
88+
after_script:
89+
- printf "$TRAVIS_COMMIT_RANGE\n"
90+
- printf "$TRAVIS_COMMIT_LOG\n"

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

77
## [Unreleased]
8+
## [1.3.2] - 2019-09-30
9+
### Changed
10+
- Files `parser.c` and `scanner.c` no longer distributed.
11+
Package maintainer should re-generate they by himself.
12+
[#75](https://github.com/phalcon/php-zephir-parser/pull/75)
13+
14+
### Fixed
15+
- Fixed `return_value` and `this_ptr` naming collision
16+
[phalcon/zephir#1660](https://github.com/phalcon/zephir/issues/1660)
17+
- Fixed underscore only identifiers to allow more than 4 characters
18+
[#75](https://github.com/phalcon/php-zephir-parser/pull/75)
19+
- Update LDFLAGS to reduce linker warnings
20+
- Fixed PHP 7.4 support
21+
822
## [1.3.1] - 2019-05-01
923
### Fixed
1024
- Fixed `config.m4` to correct install headers
@@ -128,7 +142,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
128142
### Added
129143
- Initial stable release
130144

131-
[Unreleased]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.1...HEAD
145+
[Unreleased]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.2...HEAD
146+
[1.3.2]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.1...v1.3.2
132147
[1.3.1]: https://github.com/phalcon/php-zephir-parser/compare/v1.3.0...v1.3.1
133148
[1.3.0]: https://github.com/phalcon/php-zephir-parser/compare/v1.2.0...v1.3.0
134149
[1.2.0]: https://github.com/phalcon/php-zephir-parser/compare/v1.1.4...v1.2.0

0 commit comments

Comments
 (0)