New Ticket     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #13458 (closed defect: fixed)

Opened 2 years ago

Last modified 16 months ago

Lint and Livecheck targets should not require root access

Reported by: rhwood@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 1.7.0
Component: base Version: 1.6.0
Keywords: lint livecheck Cc:
Port:

Description

The commands port lint foo and port livecheck foo should not require write access at the root level to anything. Perhaps we should distinguish between commands that make changes that should survive the port operation and those that should not survive the port operation (The results of the fetch, extract, patch, configure, build, destroot, archive, install, activate, etc... commands need to be maintained after port has finished, but this is not true for lint and livecheck)

Attachments

patch-macports-state-13458.diff Download (3.0 KB) - added by raimue@… 2 years ago.

Change History

Changed 2 years ago by afb@…

They do have a target_runtype of "always", if that is usable somehow... ?

Changed 2 years ago by wsiegrist@…

The problem with lint at least seems to be the need to write to the state file which is in the build area and requires root privileges to write to. These sort of operations dont affect the state of the port so the file shouldnt be written to, IMO. Sorry if this is already obvious to the devs but I wanted to comment here since I ran into the issue and my ticket was marked a dup of this one.

Changed 2 years ago by raimue@…

Changed 2 years ago by raimue@…

It needs

target_state ${org.macports.foo} no

for every target which is meant to be run without writing to the state file.

I tried to make this possible, but one of the remaining issues is that livecheck tries to write to ${workpath}/livecheck.TMP. Where should livecheck write else? For example /tmp? Tcl does not seem to provide any access to the UNIX syscall mktemp(3), which provides some unique name for a temporary file usually.

With the attached patch it will work if livecheck writes to some other place. At the moment it fails with an Permission denied error (after r34288).

Please review.

Changed 2 years ago by afb@…

Looks good to me, added patch as r34513.

Changed 2 years ago by raimue@…

  • status changed from new to closed
  • resolution set to fixed

Use /tmp for livecheck in r34515.

Changed 16 months ago by blb@…

  • milestone changed from MacPorts base bugs to MacPorts 1.7.0
Note: See TracTickets for help on using tickets.