thephpleague / commonmark

Highly-extensible PHP Markdown parser which fully supports the CommonMark and GFM specs.
https://commonmark.thephpleague.com
BSD 3-Clause "New" or "Revised" License
2.75k stars 194 forks source link

Problems with QuoteParser.php file permissions #1042

Closed VelziDM closed 3 months ago

VelziDM commented 3 months ago

Version(s) affected

2.4.4 and all after

Description

Issue Title: Permission Issues with Composer Package Installation on macOS Sonoma(Version 14.5)

Description:

After updating to the latest version of CommonMark (commit 50bd4dce0d53e1b3b51a153fc2e44a7dc3f7ee5b), file before commit I'm experiencing permission issues with Composer package installation on macOS.

Issue Summary:

When installing a Composer package, my colleagues and I are encountering an issue where the file is created empty and cannot be modified, even when using sudo. This prevents Composer from creating the autoloader file.

How to reproduce

Scenario 1.

  1. Install the version of CommonMark after 2.4.3.
  2. Attempt to install a Composer package using the usual command (composer install or composer update).
  3. Observe that the file is created empty and cannot be modified, even when using sudo. screenshot 1 screenshot 2

Scenario 2.

  1. Download source code from github version after 2.4.3.
  2. Observe that the file is empty and cannot be modified, even when using sudo. screenshot 1 screenshot 2

Expected Behavior:

The Composer package should be installed successfully, creating the required files with proper permissions.

Actual Behavior:

The file is created empty and cannot be modified, preventing Composer from creating the autoloader file.

Possible solution

Downgrade to "league/commonmark": "2.4.3", helps.

Additional context

Not reproduced on windows

Did this project help you today? Did it make you happy in any way?

Someday we will be cool as you are)

colinodell commented 3 months ago

Hey there!

where the file is created empty and cannot be modified

This prevents Composer from creating the autoloader file.

Composer is responsible for writing those files. It sounds like you might be experiencing issues related to your local filesystem. Unfortunately we don't provide help for Composer or macOS filesystem problems (since they're beyond the scope of this project), but I'd recommend trying to delete your entire vendor directory and re-running composer install. If that fails, double-check your file permissions and ownership on your project directory, or seek help from any other knowledgeable macOS users.

I hope you're able to figure this out!