New Ticket     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #18304 (closed enhancement: fixed)

Opened 3 years ago

Last modified 23 months ago

MacPorts doesn't build port "nice" if build.cmd contains a space

Reported by: ryandesign@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 1.9.0
Component: base Version: 1.7.0
Keywords: haspatch Cc:
Port:

Description

MacPorts can build ports "nice" so that they allow other CPU-intensive processes to take precedence. When this feature was added to MacPorts, it broke some ports, such as ocaml, because of the way they were setting build.cmd; see #16091. The solution to that ticket was to disable the nice build in this case, but I think we can do better and enable nice builds even in this case.

Attachments

patch-portbuild.tcl.diff Download (1.3 KB) - added by perry@… 23 months ago.

Change History

Changed 2 years ago by perry@…

I've attached a patch that seems to work for tmux (uses an "uncreative" build.cmd) and ocaml (uses a "creative" build.cmd).

--->  Building tmux
DEBUG: Executing org.macports.build (tmux)
DEBUG: Environment: CPATH='/opt/local/include' LIBRARY_PATH='/opt/local/lib' MACOSX_DEPLOYMENT_TARGET='10.5'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_Users_perry_src_macports-trunk_dports_sysutils_tmux/work/tmux-0.9" && /usr/bin/nice -n 20 /usr/bin/make -j1 all'

--->  Building ocaml
DEBUG: Executing org.macports.build (ocaml)
DEBUG: port disallows a parallel build
DEBUG: Environment: CPATH='/opt/local/include' LIBRARY_PATH='/opt/local/lib' MACOSX_DEPLOYMENT_TARGET='10.5'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_Users_perry_src_macports-trunk_dports_lang_ocaml/work
/ocaml-3.11.1" && unset LD_PREBIND LD_PREBIND_ALLOW_OVERLAP && /usr/bin/nice -n 20 /usr/bin/make world.opt'

Changed 2 years ago by perry@…

  • keywords haspatch added

Changed 23 months ago by perry@…

Changed 23 months ago by perry@…

I've updated the patch to make it a tad smarter than before. Does this look good enough where I can commit it to trunk?

Changed 23 months ago by raimue@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from MacPorts Future to MacPorts 1.9.0

Committed a completely different approach for this by using setpriority(2) in proc system instead of /usr/bin/nice. This works now correctly with any shell command.

Fixed in r65076.

Note: See TracTickets for help on using tickets.