Skip to content

Conversation

shyim
Copy link
Contributor

@shyim shyim commented Feb 5, 2024

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues
License MIT

cache:clear sometimes throws a warning as it tries to access /proc/mounts. This does not exist on macOS. Therefore I skipped that check completely for non linux systems.

Example output from the command line:
Screenshot 2024-02-04 at 18 34 30

@carsonbot carsonbot added this to the 5.4 milestone Feb 5, 2024
@shyim shyim force-pushed the remove-warning-on-mac branch from d3f80bd to dced288 Compare February 5, 2024 07:16
@@ -204,6 +198,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int

private function isNfs(string $dir): bool
{
if ('Linux' !== \PHP_OS) {
Copy link
Member

Choose a reason for hiding this comment

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

on 7.1, we have this instead:

            if ('/' === \DIRECTORY_SEPARATOR && is_readable('/proc/mounts') && $files = @file('/proc/mounts')) {

@nicolas-grekas nicolas-grekas changed the title Remove warning accessing /proc/mounts on non Linux systems [FrameworkBundle] Prevent silenced warning by checking if /proc/mount exists Feb 6, 2024
@nicolas-grekas
Copy link
Member

Thank you @shyim.

@nicolas-grekas nicolas-grekas merged commit 354cc2c into symfony:5.4 Feb 6, 2024
@shyim
Copy link
Contributor Author

shyim commented Feb 6, 2024

Ohh thanks for pushing into. was traveling.

@shyim shyim deleted the remove-warning-on-mac branch February 6, 2024 07:21
This was referenced Feb 27, 2024
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.

3 participants