Skip to content

Get rid of build failures with symfony 2.7 #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2014
Merged

Conversation

dbu
Copy link
Contributor

@dbu dbu commented Dec 5, 2014

Symfony 2.7 calls its own deprecated methods, raising warnings that break the build if we treat deprecated as an error...

Fix #176

@dbu dbu force-pushed the ignore-deprecations branch 2 times, most recently from 9b5c0ae to 08e799b Compare December 5, 2014 12:32
@@ -35,6 +35,8 @@ matrix:

before_script:
- sh -c 'if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/symfony=$SYMFONY_VERSION; fi;'
# E_ALL & ~E_DEPRECATED is 24575
- sh -c 'FLAWED_DEPRECATIONS=`echo "$SYMFONY_VERSION >= 2.7"|bc`; if [ $FLAWED_DEPRECATIONS = 1 ]; then echo "error_reporting = 24575" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

man, bash is a horrible thing!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL! :)

@ddeboer
Copy link
Member

ddeboer commented Dec 5, 2014

Why doesn’t just echoing E_ALL & ~E_DEPRECATED instead of 24575 into php.ini work?

@dbu dbu force-pushed the ignore-deprecations branch 3 times, most recently from 2b8d7f3 to bd4306d Compare December 5, 2014 12:43
@dbu
Copy link
Contributor Author

dbu commented Dec 5, 2014

hm, that should work. i was thinking too complicated.

@dbu dbu force-pushed the ignore-deprecations branch 2 times, most recently from a1937cb to 19c5fbf Compare December 5, 2014 12:55
before_script:
- sh -c 'if [ "$SYMFONY_VERSION" != "" ]; then composer require --dev --no-update symfony/symfony=$SYMFONY_VERSION; fi;'
- sh -c 'echo "$SYMFONY_VERSION >= 2.7"|bc'
- sh -c 'FLAWED_DEPRECATIONS=`echo "$SYMFONY_VERSION >= 2.7"|bc`; echo $FLAWED_DEPRECATIONS'
- sh -c 'FLAWED_DEPRECATIONS=`echo "$SYMFONY_VERSION >= 2.7"|bc`; if [ "$FLAWED_DEPRECATIONS" = "1" ]; then echo "error_reporting = E_ALL & ~E_DEPRECATED" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi;'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a duplicate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still struggling with figuring out why travis behaves differently than my local system

@dbu dbu force-pushed the ignore-deprecations branch 2 times, most recently from ba89f6c to ac83baa Compare December 5, 2014 13:24
@ddeboer
Copy link
Member

ddeboer commented Dec 5, 2014

LOL, this is getting worse and worse. 😉

Try this:

if [ $(echo "$SYMFONY_VERSION >= 2.7" | bc) -eq 1 ]; then echo; fi

And yeah, Bash is horrible.

@dbu dbu force-pushed the ignore-deprecations branch from ac83baa to e91cc23 Compare December 5, 2014 13:31
@dbu
Copy link
Contributor Author

dbu commented Dec 5, 2014

good idea. the other problem is that bc does not like 2.7.* :-( lets see, sooner or later i will accidentally do the right thing...

@ddeboer
Copy link
Member

ddeboer commented Dec 5, 2014

Blegh, yeah, my solution doesn't work with *.

@dbu dbu force-pushed the ignore-deprecations branch from e91cc23 to 6a57021 Compare December 5, 2014 13:40
@dbu
Copy link
Contributor Author

dbu commented Dec 5, 2014

hm, now i finally manage to have "error_reporting = E_ALL & ~E_DEPRECATED" in the php.ini file, but phpunit still fails :-( damn, what to do?

@dbu dbu force-pushed the ignore-deprecations branch 4 times, most recently from b330a64 to 3329114 Compare December 5, 2014 14:34
@dbu
Copy link
Contributor Author

dbu commented Dec 5, 2014

okay, so apart from debug code that fails with hhvm, this now builds.

unfortunately, despite all the things i throw everywhere, the build still spits out tons of deprecated warnings on the console: https://travis-ci.org/FriendsOfSymfony/FOSHttpCacheBundle/jobs/43100069

shall i remove the debug code from .travis.yml and then we just merge?

@stof
Copy link
Member

stof commented Dec 5, 2014

@dbu for any such case, please open issues in Symfony. deprecation messages should be triggered only when you call deprecated methods, not when Symfony provides a BC layer that you don't call. I know that several broken PRs have been merged during the hackday last weekend. I haven't reviewed all of them yet, so issues will help me.

@dbu
Copy link
Contributor Author

dbu commented Dec 5, 2014

created symfony/symfony#12868

@dbu dbu force-pushed the ignore-deprecations branch 2 times, most recently from e6eb2eb to 382fd87 Compare December 5, 2014 16:21
…reak the build if we treat deprecated as an error
@dbu dbu force-pushed the ignore-deprecations branch from 382fd87 to f227d42 Compare December 5, 2014 16:47
dbu added a commit that referenced this pull request Dec 5, 2014
Get rid of build failures with symfony 2.7
@dbu dbu merged commit 9e8bae3 into master Dec 5, 2014
@dbu dbu deleted the ignore-deprecations branch December 5, 2014 18:04
@ddeboer ddeboer mentioned this pull request Jan 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix Symfony deprecation warnings
7 participants