Changes between Initial Version and Version 3 of Ticket #73237


Ignore:
Timestamp:
Nov 15, 2025, 12:23:50 AM (9 months ago)
Author:
judaew (Vadym-Valdis Yudaiev)
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #73237

    • Property Type changed from defect to request
    • Property Summary changed from Error: Failed to open statefile for <port>: Could not open file <file> to Feature request: Improve error message when statefile cannot be opened due to insufficient privileges
  • Ticket #73237 – Description

    initial v3  
    1 Today, after updating from 2.11.5 to 2.11.6, I encountered this error:
     1After updating from 2.11.5 to 2.11.6, I initially thought I had hit a bug because the following error appeared when trying to build a local port. However, after Ryan’s explanation, it became clear that this is expected behavior: the macports user simply lacks the necessary permissions to read the Portfile in this location.
     2
     3Still, it would be helpful to provide a clearer and more informative message for users who encounter this for the first time.
     4
    25{{{
    36$ sudo port install -dt pre-commit
    47DEBUG: Opening port in directory: /Users/judaew/wrk/github.com/judaew/macports-ports/python/pre-commit
    5 DEBUG: OS darwin/24.6.0 (macOS 15.7.2) arch i386
    6 DEBUG: Re-registering default for distname
    7 DEBUG: Re-registering <...cut...>
     8...
    89DEBUG: Sourcing PortGroup python 1.0 from /Users/judaew/wrk/github.com/judaew/macports-ports/_resources/port1.0/group/python-1.0.tcl
    9 DEBUG: only one arch supported, so not adding the default universal variant
    10 DEBUG: Running callback portconfigure::add_automatic_compiler_dependencies
    11 DEBUG: Finished running callback portconfigure::add_automatic_compiler_dependencies
    12 DEBUG: Running callback portbuild::add_automatic_buildsystem_dependencies
    13 DEBUG: Finished running callback portbuild::add_automatic_buildsystem_dependencies
    14 DEBUG: Running callback portstartupitem::add_notes
    15 DEBUG: Finished running callback portstartupitem::add_notes
     10...
    1611DEBUG: Running callback python_add_dependencies
    1712DEBUG: Finished running callback python_add_dependencies
     
    2621Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
    2722Error: Processing of port pre-commit failed
    28 
    29 >>>>>>
    30 
    31 $ tree /Users/judaew/wrk/github.com/judaew/macports-ports/python/pre-commit
    32 /Users/judaew/wrk/github.com/judaew/macports-ports/python/pre-commit
    33 ├── Portfile
    34 └── work -> /opt/local/var/macports/build/pre-commit-f505e05e/work
    35 
    36 2 directories, 1 file
    37 
    38 >>>>>>
    39 
    40 $ ls -lR /opt/local/var/macports/build/*pre-commit*
    41 /opt/local/var/macports/build/_Users_judaew_wrk_github.com_judaew_macports-ports_python_pre-commit:
    42 total 0
    43 lrwxr-xr-x 1 macports wheel 49 Nov 14 02:43 pre-commit -> /opt/local/var/macports/build/pre-commit-f505e05e
    44 
    45 /opt/local/var/macports/build/pre-commit-f505e05e:
    46 total 0
    47 drwxr-xr-x 4 macports wheel 128 Nov 14 02:43 work
    48 
    49 /opt/local/var/macports/build/pre-commit-f505e05e/work:
    50 total 0
    5123}}}
    52 
    53 Maybe related to #72740, IDK.