Project

General

Profile

Bug #13526

cmd/availdevs always rebuilds

Added by Gordon Ross about 2 months ago. Updated 26 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

cd $SRC/cmd/availdevs
make ; make
Note that it always rebuilds. "make -d" says it's because the command changed.
This has to do with the conditional assignment of LDLIBS

all install := LDLIBS += -lxml2

(which is an unfortunate practice, given how it causes problems like this).

That was apparently done originally because we didn't have a lint lib for xml2.
No longer relevant now that we don't run lint anymore.

#1

Updated by Gordon Ross about 2 months ago

I'm not sure how many other conditional assignments of LDLIBS might exist.
If anyone is inclined to search them out, perhaps they could be fixed along with this.

#2

Updated by Gordon Ross about 2 months ago

Maybe the conditional assignments are OK if done differently. This seems to work:

diff --git a/usr/src/cmd/availdevs/Makefile b/usr/src/cmd/availdevs/Makefile
index dfa150f6c9..ecfa9e0974 100644
--- a/usr/src/cmd/availdevs/Makefile
+++ b/usr/src/cmd/availdevs/Makefile
@@ -38,7 +38,7 @@ INCS += -I$(ADJUNCT_PROTO)/usr/include/libxml2
 #
 LDLIBS += -lzfs_jni -lnvpair -lzfs
 NATIVE_LIBS += libxml2.so
-all install := LDLIBS += -lxml2
+$(PROG) := LDLIBS += -lxml2

 CPPFLAGS += $(INCS) -D_LARGEFILE64_SOURCE=1 -D_REENTRANT
 $(NOT_RELEASE_BUILD) CPPFLAGS += -DDEBUG

#3

Updated by Gordon Ross about 2 months ago

  • Description updated (diff)
#4

Updated by Electric Monk about 2 months ago

  • Gerrit CR set to 1279
#5

Updated by Gordon Ross about 1 month ago

Testing: cd $SRC/cmd/availdevs
make install
make install
2nd command does nothing.

#6

Updated by Electric Monk 26 days ago

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

git commit 5fbc1fe0da7f34cf8155bf7624c94583cc98e47c

commit  5fbc1fe0da7f34cf8155bf7624c94583cc98e47c
Author: Gordon Ross <gordon.ross@tintri.com>
Date:   2021-03-18T00:58:51.000Z

    13526 cmd/availdevs always rebuilds
    Reviewed by: Richard Lowe <richlowe@richlowe.net>
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF