Bug 232527 - bsd.prog.mk includes bsd.nls.mk unconditionally.
Summary: bsd.prog.mk includes bsd.nls.mk unconditionally.
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Bryan Drewery
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-22 14:46 UTC by ktullavik
Modified: 2019-03-04 21:11 UTC (History)
4 users (show)

See Also:
bdrewery: mfc-stable12?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ktullavik 2018-10-22 14:46:54 UTC
Only noticed this while building
java/intellij-fsnotifier
so I maybe I'm mistaken claiming it to a more general problem.

src.conf:
WITHOUT_NLS=
WITHOUT_NLS_CATALOGS=

===>  Building for intellij-fsnotifier-20160221_4
make[2]: "/usr/share/mk/bsd.prog.mk" line 283: Could not find bsd.nls.mk
make[2]: Fatal errors encountered -- cannot continue
make[2]: stopped in /usr/ports/java/intellij-fsnotifier/work/fsnotifier-a04fbff6e21d58fea7a3ed2a6a21e53cbef4b7af
===> Compilation failed unexpectedly.


Workaround
----------
Temporarily commented the offending lines in bsd.prog.mk

NLSNAME?=     ${PROG}
.include <bsd.nls.mk>

while building intellij-fsnotifier.
Haven't seen any runtime problems with my intellij build.
Comment 1 jarrod 2019-01-21 07:01:22 UTC
With the same options in src.conf, this also appears to affect the building of some ports under Poudriere as bsd.nls.mk is also blindly included by share/mk/bsd.lib.mk (releng/12.0 r340773 line 440).

===>  Building for libsunacl-1.0.1
make[1]: "/usr/share/mk/bsd.opts.mk" line 101: warning: "NO_PROFILE is defined, but deprecated. Please use MK_PROFILE=no instead."
make[1]: "/usr/share/mk/bsd.lib.mk" line 440: Could not find bsd.nls.mk
make[1]: Fatal errors encountered -- cannot continue
make[1]: stopped in /wrkdirs/usr/ports/sysutils/libsunacl/work/libsunacl-1.0.1
*** Error code 1

Stop.
make: stopped in /usr/ports/sysutils/libsunacl

According to tools/build/mk/OptionalObsoleteFiles.inc (releng/12.0 r338929 line 6283), which is included by ObsoleteFiles.inc, usr/share/mk/bsd.nls.mk is considered optional (well, assuming my interpretation is correct) when NLS support is disabled therefor is deleted on a "make delete-old".

.if ${MK_NLS} == no
OLD_DIRS+=usr/share/nls/
OLD_DIRS+=usr/share/nls/C
OLD_FILES+=usr/share/mk/bsd.nls.mk  <-- this one here
OLD_FILES+=usr/share/nls/C/ee.cat
OLD_DIRS+=usr/share/nls/af_ZA.ISO8859-1

If this is the case, the file cannot be relied upon and should be .sinclude'd instead or unmarked as being optional in OptionalObsoleteFiles.inc.  Probably the latter is the safer?
Comment 2 Bryan Drewery freebsd_committer freebsd_triage 2019-02-28 20:44:28 UTC
Broken by r335011
Comment 3 commit-hook freebsd_committer freebsd_triage 2019-02-28 20:49:14 UTC
A commit references this bug:

Author: bdrewery
Date: Thu Feb 28 20:48:18 UTC 2019
New revision: 344666
URL: https://svnweb.freebsd.org/changeset/base/344666

Log:
  bsd.nls.mk isn't optional.

  It is protected by MK_NLS.  If it should really be optional then
  it needs to be documented as such in share/mk/bsd.README and
  .sinclude used where needed.

  This fixes a regression from r335011.

  PR:		232527
  Submitted by:	jarrod@downtools.com.au
  Reported by:	ktullavik@gmail.com
  MFC after:	3 days

Changes:
  head/tools/build/mk/OptionalObsoleteFiles.inc
Comment 4 Bryan Drewery freebsd_committer freebsd_triage 2019-02-28 20:50:55 UTC
Fixed in head. Will MFC to stable in a few days.
Comment 5 commit-hook freebsd_committer freebsd_triage 2019-03-04 21:11:29 UTC
A commit references this bug:

Author: bdrewery
Date: Mon Mar  4 21:10:41 UTC 2019
New revision: 344781
URL: https://svnweb.freebsd.org/changeset/base/344781

Log:
  MFC r344666:

    bsd.nls.mk isn't optional.

  PR:		232527

Changes:
_U  stable/12/
  stable/12/tools/build/mk/OptionalObsoleteFiles.inc