Opened 16 years ago

Closed 15 years ago

#18304 closed enhancement (fixed)

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

Reported by: ryandesign (Ryan Carsten Schmidt) 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 (1)

patch-portbuild.tcl.diff (1.3 KB) - added by lperry (Perry Lee) 15 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 15 years ago by lperry (Perry Lee)

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'

comment:2 Changed 15 years ago by lperry (Perry Lee)

Keywords: haspatch added

Changed 15 years ago by lperry (Perry Lee)

Attachment: patch-portbuild.tcl.diff added

comment:3 Changed 15 years ago by lperry (Perry Lee)

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?

comment:4 Changed 15 years ago by raimue (Rainer Müller)

Milestone: MacPorts FutureMacPorts 1.9.0
Resolution: fixed
Status: newclosed

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.