EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Base 3.14.12.5 make uninstall not removing bin or lib
From: "Johnson, Andrew N. via Core-talk" <[email protected]>
To: "Baker, Keith (DLSLtd,RAL,LSCI)" <[email protected]>
Cc: EPICS core-talk <[email protected]>
Date: Thu, 14 Nov 2019 21:09:17 +0000
Hi Keith,

On 11/14/19 5:26 AM, Baker, Keith (DLSLtd, RAL, LSCI) via Core-talk wrote:

Thank you.  That confirms what I was seeing. I appreciate R3.14 is quite old, so sorry for dragging you back to that, but I was surprised to see the “bug” persist through later releases.

However, you have a plan to remove the cleandirs target anyway, which will tidy things up again.

 

I like your plan but we actually use the cleandirs target to remove another directory we create called $(INSTALL_LOCATION)/data.

We’ll find another way to do that, probably adding it to the realuninstall recipes.

Take a look at the comments and examples in configure/CONFIG_FILE_TYPE in Base. It sounds to me that your data directory might be added as a FILE_TYPE. The description in that file explains how, and this has the advantage that the uninstallDirs rule will automatically delete the install directory for you. You should also look at how CFG (described in the same file above) lets you provide your own CONFIG and RULES files in a support module, and then every IOC and support module that points to that module will automatically pull in those CONFIG and/or RULES files at build-time. The idea is to allow sites to put their build customizations in support modules without having to make any changes to the files in Base.

Combining the above two, in a src directory of your module that processes 'data' files say you would create a file CONFIG_DATA containing:
    FILE_TYPE += DATA
    INSTALL_DATA = $(INSTALL_LOCATION)/data
and install that by adding
    CFG += CONFIG_DATA
to the Makefile in that src directory. You can also put any build rules you want for 'data' files in a similar RULES_DATA file. Now the Makefile of any IOC that links to this module can do
    DATA += file1.data file2.data
to have those files installed (and can use rules from RULES_DATA to create the files first if necessary). Now a 'make uninstall' in the IOC's top directory should remove the data directory automatically, no modifications to Base are needed at all.

HTH,

- Andrew


 

Like you say, adjusting which targets we use will get round my current problem with bin and lib, and ‘make distclean’ is shorter which I’m always happy with.

Thanks for your help.

Keith

 

 

From: Johnson, Andrew N. <[email protected]>
Sent: 12 November 2019 21:53
To: Baker, Keith (DLSLtd,RAL,LSCI) <[email protected]>; [email protected]
Subject: Re: Base 3.14.12.5 make uninstall not removing bin or lib

 

Hi Keith,

On 11/7/19 4:01 AM, Baker, Keith (DLSLtd, RAL, LSCI) via Core-talk wrote:

After updating from R3.14.12.3 or R3.14.12.7 I now find that a “make uninstall” does not remove INSTALL_LOCATION_BIN or INSTALL_LOCATION_LIB.

 

In RULES_TOP the cleandirs: target checks if those directories are empty and if so removes them, but the check seems to fail even though the directories should have just been emptied by the uninstall: target.

 

This used to work until this change was introduced in R3.14.12.5,

 

-archuninstall: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS))

-              @$(MAKE) -f Makefile cleandirs

+archuninstall: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS)) | cleandirs

Yeah, that's a bug that I introduced, sorry! I normally use 'make distclean' which removes all the O.<arch> directories and everything under the bin and lib directories unconditionally. 'make clean uninstall' only removes files for the target architectures that this host-arch is configured to build, and is more to type anyway.

For future releases I'm probably going to remove the cleandirs target and do something like this diff against the 3.15 tree (3.14 is no longer supported):


diff --git a/configure/RULES_TOP b/configure/RULES_TOP
--- a/configure/RULES_TOP
+++ b/configure/RULES_TOP
@@ -24,25 +24,19 @@ UNINSTALL_DIRS += $(INSTALL_DBD) $(INSTALL_INCLUDE) $(INSTALL_DOC) \
 uninstallDirs:
        $(RMDIR) $(UNINSTALL_DIRS)
 
+EMPTY_INSTALL_DIRS = \
+    $(if $(wildcard $(INSTALL_LOCATION_BIN)/*),,$(INSTALL_LOCATION_BIN)) \
+    $(if $(wildcard $(INSTALL_LOCATION_LIB)/*),,$(INSTALL_LOCATION_LIB))
 uninstall: archuninstall uninstallDirs
+       $(RMDIR) $(EMPTY_INSTALL_DIRS)

 
-archuninstall: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS)) | cleandirs
+archuninstall: $(addprefix uninstall$(DIVIDER),$(BUILD_ARCHS))
 
 archPart = $(word 2, $(subst $(DIVIDER), ,$@))
 uninstall$(DIVIDER)%:
        $(RMDIR) $(INSTALL_LOCATION_BIN)/$(archPart)
        $(RMDIR) $(INSTALL_LOCATION_LIB)/$(archPart)
 
-cleandirs:
-       @$(NOP)
-ifeq ($(wildcard $(INSTALL_LOCATION_BIN)/*),)
-       $(RMDIR) $(INSTALL_LOCATION_BIN)
-endif
-ifeq ($(wildcard $(INSTALL_LOCATION_LIB)/*),)
-       $(RMDIR) $(INSTALL_LOCATION_LIB)
-endif
-
 

 help:
        @echo "Usage: gnumake [options] [target] ..."


This does the directory-is-empty tests after their contents have been removed but without having to use a recursive make call, which is what I was originally trying to clean up. A 'make archuninstall' will no longer remove the empty top-level bin and lib directories when deleting the last remaining architecture, but 'make uninstall' is less typing and should be close enough anyway.

Thanks for the bug report,

- Andrew

-- 
Complexity comes for free, Simplicity you have to work for.

 

-- 

This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
 


-- 
Complexity comes for free, Simplicity you have to work for.

References:
Base 3.14.12.5 make uninstall not removing bin or lib Baker, Keith (DLSLtd, RAL, LSCI) via Core-talk
Re: Base 3.14.12.5 make uninstall not removing bin or lib Johnson, Andrew N. via Core-talk
RE: Base 3.14.12.5 make uninstall not removing bin or lib Baker, Keith (DLSLtd, RAL, LSCI) via Core-talk

Navigate by Date:
Prev: Re: no more __DATE__ Konrad, Martin via Core-talk
Next: Re: [Merge] ~info-martin-konrad/epics-base:fix-crash-dbloadrecords-after-iocinit into epics-base:3.15 Andrew Johnson via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Base 3.14.12.5 make uninstall not removing bin or lib Baker, Keith (DLSLtd, RAL, LSCI) via Core-talk
Next: checkRelease problem Zimoch Dirk (PSI) via Core-talk
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
ANJ, 14 Nov 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·