Message ID | 20161129023613.GB4657@tungsten.ozlabs.ibm.com |
---|---|
State | Not Applicable |
Headers | show |
Hello, On Tue, 29 Nov 2016 13:36:13 +1100, Sam Bobroff wrote: > I couldn't replicate this, but I tried hacking strace into the process > so I could see if usb_modeswitch_dispatcher was being deleted during the > build. It looks like it is, by the C compiler -- presumably removing the > existing output file before it writes a new one. And then that makes sense, indeed. > So you could see an interleaving where Make has seen the file but it's > deleted either just before, or during, /usr/bin/install. And this can > happen as long as Make thinks its OK to run those two rules in parallel. > > If that's correct, you could try converting the dependency on > usb_modeswitch_dispatcher (which, as you point out, isn't really working > anyway) into an order only dependency (or you could even just delete it > -- it doesn't seem to do anything necessary unless you're running a > "make install-static" without having first done a "make static" but > buildroot does that). This really isn't fixing the whole problem (IMHO > the makefile is quite broken) but it might hack around it by not forcing > the unnecessary recompilation thus avoiding the racy delete. Or we simply use $(MAKE1) to build/install this package, which is anyway quite small, and avoid the problem altogether. I also agree that the Makefile is quite broken, and I'm not sure we want to fix it (it would require a complete rewrite). Best regards, Thomas
On 29-11-16 09:55, Thomas Petazzoni wrote: > Hello, > > On Tue, 29 Nov 2016 13:36:13 +1100, Sam Bobroff wrote: > >> I couldn't replicate this, but I tried hacking strace into the process >> so I could see if usb_modeswitch_dispatcher was being deleted during the >> build. It looks like it is, by the C compiler -- presumably removing the >> existing output file before it writes a new one. > > And then that makes sense, indeed. > >> So you could see an interleaving where Make has seen the file but it's >> deleted either just before, or during, /usr/bin/install. And this can >> happen as long as Make thinks its OK to run those two rules in parallel. >> >> If that's correct, you could try converting the dependency on >> usb_modeswitch_dispatcher (which, as you point out, isn't really working >> anyway) into an order only dependency (or you could even just delete it >> -- it doesn't seem to do anything necessary unless you're running a >> "make install-static" without having first done a "make static" but >> buildroot does that). This really isn't fixing the whole problem (IMHO >> the makefile is quite broken) but it might hack around it by not forcing >> the unnecessary recompilation thus avoiding the racy delete. > > Or we simply use $(MAKE1) to build/install this package, which is > anyway quite small, and avoid the problem altogether. I also agree that > the Makefile is quite broken, and I'm not sure we want to fix it (it > would require a complete rewrite). Still, it's unfortunate that we're doing build during the installation step. Oh well. Upstream doesn't even have a publicly accessible VCS... Regards, Arnout
--- a/Makefile 2016-11-29 13:29:55.238791205 +1100 +++ b/Makefile 2016-11-29 13:30:47.967090359 +1100 @@ -89,11 +89,11 @@ install: install-script -install-script: dispatcher-script install-common +install-script: install-common | dispatcher-script -install-shared: dispatcher-shared install-common +install-shared: install-common | dispatcher-shared -install-static: dispatcher-static install-common +install-static: install-common | dispatcher-static uninstall: $(RM) $(SBINDIR)/usb_modeswitch