Project

General

Profile

Bug #9692

libvscan has bad _msg dependency

Added by Jason King over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
2018-08-02
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Upstream of Joyent OS-7100:

(I'm just including Robert's analysis as it's where we finally got to the bottom of the issue)

The problem here is a little involved, but ultimately straightforward. Let's take this apart starting in libvscan and go from there.
Starting in libvscan, when one run runs dmake _msg there are a few issues. The first is that while the target is normally just:

_msg:   $(MSGDOMAINPOFILE)

There is an additional dep on _msg as part of the general SUBDIRS statement. However, this itself is problematic. Because while _msg is in the SUBDIRS list, there is no rule to conditionally assign to $(TARGET). This means that when it invokes the rule, it will descend, $(TARGET) will be unset, so it will build the default target which is all. This is seen pretty clearly when one uses -dd to dmake:
   Building i386 because new command
        cd i386; pwd; /home/rm/src/tiresias/proto.strap/usr/bin/dmake
   different from empty old command
   Building i386 because new command longer than old

This is what causes us to always try and build the actual library when we're building messages.
This on its own is not sufficient to cause the build failure seen above. When building the _msg target in $(SRC)/Makefile, it will descend into lib/ and run the target. However, there we explicitly ignore dependencies when running _msg and use the -nodepend variants. As a result it will always descend and because this is in parallel with the other install tasks, it's not hard for us to end up in a situation where due to the earlier bug, and the lack of a link against libnsl due to illumos#9673, that we then fail.

History

#1

Updated by Jason King over 1 year ago

Just to have the whole synopsis, the upstream is 'OS-7100 Build fails in libvscan after merge'

#2

Updated by Jason King over 1 year ago

I suppose the original build failure message might be useful to have as well (ECAFFEINE :P):

After the merge of:

commit 8a7aa2a592747bd90d85645126d80688e024a0e2
9673 move internet address manipulation functions to libc

builds are failing with:
The following command caused the error:
Undefined            first referenced
 symbol                  in file
inet_pton                           pics/libvscan.o  (symbol belongs to implicit dependency /lib/libnsl.so.1)
ld: fatal: symbol referencing errors. No output written to libvscan.so.1

(It should be noted that #9673 is not the cause, but just happened to change the order in which dmake built things enough to reveal the existing problem).

#3

Updated by Electric Monk over 1 year ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 4b82800c9ef42549e376c68ab63eb6d8228449ce

commit  4b82800c9ef42549e376c68ab63eb6d8228449ce
Author: Jason King <jason.king@joyent.com>
Date:   2018-08-02T16:27:08.000Z

    9692 libvscan has bad _msg dependency
    Reviewed by: Dan McDonald <danmcd@joyent.com>
    Reviewed by: Andy Fiddaman <af@citrus-it.net>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Also available in: Atom PDF