Project

General

Profile

Bug #3570

Trailing / on CODEMGR_WS in illumos.sh causes build failure

Added by Rich Ercolani over 6 years ago. Updated over 5 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
-
Start date:
2013-02-17
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Exactly as the title says, I had

export CODEMGR_WS="/code/il-per/" 

in my illumos.sh, and it caused odd build failures in usr/src/cmd/localedef, looking like:
/usr/bin/rm -f /code/il-per/proto/root_i386/usr/lib/locale/da_DK.ISO8859-1/LC_COLLATE/LCL_DATA
/usr/bin/cp -f /code/il-per/proto/root_i386/usr/lib/locale/da_DK.ISO8859-1/LC_COLLATE/LCL_DATA /code/il-per/proto/root_i386/usr/lib/locale/da_DK.ISO8859-1/LC_COLLATE/LCL_DATA
cp: cannot access /code/il-per/proto/root_i386/usr/lib/locale/da_DK.ISO8859-1/LC_COLLATE/LCL_DATA
*** Error code 2

in nightly.log

Turns out that if you have a / on the end of CODEMGR_WS, this rule in the Makefile breaks:

$(ROOTDATA):    $(ROOTLOCDIRS) $(ROOTCATDIRS) $(DATA)
        $(RM) $@
        $(CP) $(@:$(ROOTLIB)/%=%) $@
        $(CHMOD) 0444 $@

(Thanks to Albert Lee and Patrickdk on #illumos for helping me track this down!)

History

#1

Updated by Albert Lee over 6 years ago

usr/src/cmd/localedef/Makefile defines ROOTDATA by preprending "$(ROOTLIB)/" to the $(DATA) paths:

ROOTDATA    = $(DATA:%=$(ROOTLIB)/%)

The rules for the actual $(ROOTDATA) targets does the inverse substition on each element to derive the original $(DATA) path:

     $(CP) $(@:$(ROOTLIB)/%=%) $@

The actual path from $@ strips extra slashes that were originally present in $(ROOTDATA), so if $(ROOTLIB) contains extra slashes, the substitution fails.

The extra slash can be introduced by the default definition of PARENT_ROOT if $PARENT_WS had a trailing slash:

export PARENT_ROOT="$PARENT_WS/proto/root_$MACH"

#2

Updated by Garrett D'Amore almost 6 years ago

  • Priority changed from Normal to Low

This is not a big deal. Developer should be know how to configure the environment file. Perhaps we should just fix this by documenting it in the environment file?

#3

Updated by Josef Sipek over 5 years ago

Garrett D'Amore wrote:

This is not a big deal. Developer should be know how to configure the environment file. Perhaps we should just fix this by documenting it in the environment file?

Full disclosure: I just got bitten by this.

Maybe I should have known better, but I feel like nightly & bldenv could have been smarter and stripped the trailing / for me.

Also available in: Atom PDF