Bug 224276

Summary: [PATCH] editors/openoffice-4: Cannot build with CCACHE with synth
Product: Ports & Packages Reporter: Chris <cmangin>
Component: Individual Port(s)Assignee: Don Lewis <truckman>
Status: Closed FIXED    
Severity: Affects Only Me CC: truckman, w.schwarzenfeld
Priority: --- Flags: bugzilla: maintainer-feedback? (office)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Log file of build with CCACHE = on
none
Patch for editors/openoffice-4 none

Description Chris 2017-12-12 14:44:12 UTC
Created attachment 188753 [details]
Log file of build with CCACHE = on

If we try to build apache-openoffice with synth, with option CCACHE=on, the build fails with this error:

ccache: error: Failed to create directory /root/.ccache/tmp: Operation not permitted
dmake:  Error code 1, while making '../unxfbsdx.pro/obj/ifparser.obj'

With poudriere, this problem does not occur since CCACHE_DIR is set to /root/.ccache  where the configured ccache directory is mounted.

With synth, CCACHE_DIR = /ccache and /root is read-only. But this port still wants to write to /root/.ccache

Log file included.
Comment 1 Chris 2017-12-14 01:26:24 UTC
Created attachment 188815 [details]
Patch for editors/openoffice-4
Comment 2 Chris 2017-12-14 01:27:21 UTC
I found that the problem could be fixed by exporting CCACHE_DIR to the shell's environment prior to executing build.pl.

The attached patch does 2 things:

- Fix the failure with the synth build.
- Remove the CCACHE option and use WITH_CCACHE_BUILD to determine if the use of ccache is requested. This will allow this port to work with port builders in a more standardized way.

The patch has been tested with both synth and poudriere on 11.1-RELEASE (amd64)

I would also suggest that these 2 scripts be removed:

files/ooo.sh
files/generate.pl

These 2 files play no role in the build and seems to be leftovers from the pre-OpenOffice-4 era.
Comment 3 Don Lewis freebsd_committer 2018-01-18 18:38:23 UTC
Take this.
Comment 4 commit-hook freebsd_committer 2018-01-19 19:41:12 UTC
A commit references this bug:

Author: truckman
Date: Fri Jan 19 19:40:47 UTC 2018
New revision: 459465
URL: https://svnweb.freebsd.org/changeset/ports/459465

Log:
  Remove the CCACHE option and other ccache code from the Makefile
  and use the ccache code in the ports framework handle all of the
  details.

  Don't prepend ${WRKSRC}/solenv/bin to PATH in CONFIGURE_ENV since
  it is no longer needed and blocks the framework from adding
  CCACHE_WRAPPER_PATH to PATH in CONFIGURE_ENV and MAKE_ENV.

  Sanitize MAKE_ENV and export its to the build, similar to what is
  done by the default do-build target.  This passes CCACHE_DIR and
  HOME (set to WRKDIR) to the build, so the $HOME override in r459316
  is no longer needed.  We need to remove the CPPFLAGS setting from
  MAKE_ENV before exporting to the build because it breaks the build
  of the bundled icu module.  CFLAGS and CXXFLAGS are also removed
  because they would interfere with the carefully constructed compiler
  flags set by the port.  The include paths are already handled by
  the port, and the port also modifies the optmization flags for some
  files to work around compiler bugs.

  While here, remove files/ooo.sh files/generate.pl since they have
  been obsolete for a long while.

  No PORTREVISION bump since the package should be unchanged.

  PR:		224276

Changes:
  head/editors/openoffice-4/Makefile
  head/editors/openoffice-4/files/generate.pl
  head/editors/openoffice-4/files/ooo.sh
Comment 5 commit-hook freebsd_committer 2018-01-20 00:51:49 UTC
A commit references this bug:

Author: truckman
Date: Sat Jan 20 00:51:39 UTC 2018
New revision: 459491
URL: https://svnweb.freebsd.org/changeset/ports/459491

Log:
  Remove the CCACHE option and other ccache code from the Makefile
  and use the ccache code in the ports framework handle all of the
  details.

  Don't prepend ${WRKSRC}/solenv/bin to PATH in CONFIGURE_ENV since
  it is no longer needed and blocks the framework from adding
  CCACHE_WRAPPER_PATH to PATH in CONFIGURE_ENV and MAKE_ENV.

  Sanitize MAKE_ENV and export it to the build, similar to what is
  done by the default do-build target.  This passes CCACHE_DIR and
  HOME (set to WRKDIR) to the build, so the $HOME override in r459363
  is no longer needed.  We need to remove the CPPFLAGS setting from
  MAKE_ENV before exporting to the build because it breaks the build
  of the bundled icu module.  CFLAGS and CXXFLAGS are also removed
  because they would interfere with the carefully constructed compiler
  flags set by the port.  The include paths are already handled by
  the port, and the port also modifies the optmization flags for some
  files to work around compiler bugs.

  While here, remove files/generate.pl since it has been obsolete for
  a long while.

  No PORTREVISION bump since the package should be unchanged.

  PR:		224276

Changes:
  head/editors/openoffice-devel/Makefile
  head/editors/openoffice-devel/files/generate.pl