Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Allow running PHPUnit with "xdebug.scream" ON #29645

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 19, 2018

Conversation

nico-incubiq
Copy link
Contributor

@nico-incubiq nico-incubiq commented Dec 18, 2018

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Since #25733 the Kernel attempts to unlink the legacy container while being built.
This throws an error if the file did not exist, for example on a clean install, on the build, which is then silenced.

That's fine on production systems, but on our build we have enabled xdebug.scream in order to visualise every errors, which basically un-silences the errors. I believe there should not be a need to silence anything on a usual, clean usage of the system.
Making this unlink conditional fixes it.

Could you please approve and merge this PR?
Thanks

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Works for me, but note that running with xdebug.scream is unsupported in the generic case: in some situations (eg some race conditions), there is no way around triggering a silenced notice.

@@ -743,7 +743,10 @@ protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container
$fs->dumpFile($dir.$file, $code);
@chmod($dir.$file, 0666 & ~umask());
}
@unlink(\dirname($dir.$file).'.legacy');
$legacyFile = \dirname($dir.$file).'.legacy';
if (\file_exists($legacyFile)) {
Copy link
Member

Choose a reason for hiding this comment

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

please remove the \ here (but keep it for dirname)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

absolutely, I've found a mix of both in the codebase so didn't know which was the preferred one. all done now

Since symfony#25733 the Kernel attempts to unlink the legacy container while being built.
This throws an error if the file did not exist, for example on a clean install, on the build, which is then silenced.

That's fine on production systems, but on our build we have enabled "xdebug.scream" in order to visualise every errors, which basically un-silences the errors. I believe there should not be a need to silence anything on a usual, clean usage of the system.
Making this `unlink` conditional fixes it.

Could you please approve and merge this PR?
Thanks
@nicolas-grekas nicolas-grekas changed the base branch from master to 3.4 December 19, 2018 18:59
@nicolas-grekas
Copy link
Member

Thank you @nico-incubiq.

@nicolas-grekas nicolas-grekas merged commit 7a7165e into symfony:3.4 Dec 19, 2018
nicolas-grekas added a commit that referenced this pull request Dec 19, 2018
…biq)

This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #29645).

Discussion
----------

Allow running PHPUnit with "xdebug.scream" ON

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |    <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        |  <!-- required for new features -->

Since #25733 the Kernel attempts to unlink the legacy container while being built.
This throws an error if the file did not exist, for example on a clean install, on the build, which is then silenced.

That's fine on production systems, but on our build we have enabled `xdebug.scream` in order to visualise every errors, which basically un-silences the errors. I believe there should not be a need to silence anything on a usual, clean usage of the system.
Making this `unlink` conditional fixes it.

Could you please approve and merge this PR?
Thanks

Commits
-------

7a7165e Allow running PHPUnit with "xdebug.scream" ON
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.