[00:24] Keybuk: how does it work? Why does it work? And: Even if it makes automake obsolete, it doesn't really make for understandable code :-/ [00:25] jMCg: $@ is the make variable for "the target" [00:25] so $@_SOURCES for init expands to init_SOURCES [00:25] $($@_SOURCES) is thus "the contents of $(init_SOURCES)" [00:25] the .SECONDEXPANSION bit tells automake to expand the objects of a target twice, and in the second time variables like $@ are set [00:25] Keybuk: unintentionally, I use that... [00:26] see: https://scm.brainsware.org/svn/webstack/linux/Makefile [00:27] Keybuk: ah.. my innitial understanding was that you didn't use automake. [00:27] that isn't automake [00:27] sorry [00:27] "tells MAKE to expand" [00:28] * jMCg tries to reparse. [00:29] Ah, okay, that explains the escaping of the $. [00:38] now for the advanced class [00:38] http://paste.ubuntu.com/597191/ [00:38] work out what *that* does [00:38] and why it's awesome :D [00:50] Keybuk: what's $1? [00:50] Oh. [00:50] so: [00:50] It's Whatever $$@ gets expanded to. [00:50] dep_dir turns src/foo.c into src/.deps/ [00:50] and dep_file turns src/foo.c into src/.deps/foo.mk [00:51] Why do you have an .mk file for each .c file? [00:51] both are written using Make functions so they work if you pass them multiple arguments [00:51] GNU Make, anyway. [00:52] so $(call dep_file,src/foo.c tests/bar.c baz.c) returns src/.deps/foo.mk tests/.deps/bar.mk ./.deps/baz.mk [00:52] the next bit is the implicit compile rule [00:52] it says any .c file can be turned into a .o file using CC (gcc, clang) [00:52] -MMD -MT $@ -MT src/.deps/foo.mk -MP [00:52] is an operative bit there [00:53] it means: AS WELL AS compiling the .o file, generate src/.deps/foo.mk [00:53] that is a Makefile snippet that lists all of the .h files that gcc found [00:53] so it might look like: [00:53] src/foo.o: src/foo.c src/common.h src/log.h [00:54] ACK. [00:54] and then [00:54] -include $(call dep_file,$(SOURCES)) [00:54] means include every .mk file for every defined file in $(SOURCES) [00:54] What's -include? [00:54] -include means "ignore error due to not existing" [00:54] so the first time you type "make" none of these .deps files exist [00:54] so make doesn't know which headers are deps [00:54] but that's ok [00:54] none of the .o files exist either ;-) [00:54] I suppse you define $(SOURCES) somewhere above. [00:55] so the first time you compile, make's brain is populated with all of the .h deps [00:55] so the next time, it rebuilds based on what you changed [00:55] yeah, $(SOURCES) is put together elsewhere using $(foreach ...) [00:55] the one other strange bit is the stamp madness [00:55] That's bordering insane -- but then, so is autocrap. [00:55] each .o file depends on the equivalent src/.deps/stamp file [00:56] and that rule is simple, it makes the .deps directory and touches the stamp file in it [00:56] this means there's only one mkdir call for each .deps directory [00:56] rather than one for each C file [00:56] not strictly necessary, but it looks better in the make V=1 output :p [00:58] Keybuk: how long did you work on upstart's Makefile? [00:59] oh, that stuff? [00:59] on the shuttle this morning [00:59] so about an hour [01:00] I hereby declare you my personal hero of the hour. [01:00] Would you very much mind removing all the autocrap from trafficserver: https://svn.apache.org/repos/asf/trafficserver/traffic/trunk/ - please? [01:02] Instead of reading the GNU m4 handbook and subscribing to the libtool-users mailinglist, maybe I should have read the GNU make handbook instead. [01:03] heh, I don't hate autotools [01:03] I'm listed in AUTHORS after all [01:03] but Upstart simply doesn't need any of the portability stuff [01:03] we can assume GNU make and GCC or clang [01:03] and Linux [01:03] and Automake's requirements to list every single binary was *really* causing me problems with maintaining the ever-growing test suite [01:04] by switching to GNU Make turned up to 11, I can just have a single TESTS = ... that lists every binary [01:04] and where I need it linked to .o files from the source, add [01:04] tests/blah: src/blah.o src/foo.c [01:04] and everything else is automatic [01:05] http://www.varnish-cache.org/docs/trunk/phk/autocrap.html << regarding portability: we're down to a handful of unices anyway, so portability isn't that much of an issue. [01:06] agree [01:06] Linux + OS X [01:06] and those are largely GNU Toolchain [01:06] hell, I build Upstart on OS X on my MBP half the time when testing random bits [01:07] Solaris 11 will be moving to gmake and much of the GNU Tool chain - well, I suppose they will keep their compiler. [01:07] And maybe, one day, FreeBSD will have moved to clang -- but they will still have the rest of the GNU chain. [01:08] Solwhatnow? [01:08] The thing we use at $work. [01:08] oh, that Oracle thing [01:08] I thought they were pushing Red Hat ;-) [01:08] well, Oracle Ripped Off Linux [01:09] Well, there's a couple of things in Solaris I'd really love to see in Linux. [01:09] I want a good port of zfs on Linux or the 2018 release of btrfs. [01:09] SMF is, by now, I believe, suprior to upstart. [01:09] ion: +1 [01:10] (Also, i want it now.) [01:11] Well, actually there's only two things missing: switching users/groups without using *ugly* "hacks" - and reducing privileges(5) (on Linux: Capabilities(7)) so you don't have to start a daemon as root. [01:11] That really rocks. [01:11] I can run Tomcat on port 80 without feeling dirty. [01:12] wasn't there some talk about some BSDs switching to PCC ? ;) [01:12] jMCg: really? what do you think SMF does better than Upstart? [01:12] JanC: long, long time ago. I think they've hopped on the LLVM bandwagon, because that one's actually moving. [01:12] SMF was pretty basic last time I looked [01:13] Keybuk: 02:18:46 < jMCg> Well, actually there's only two things missing: switching users/groups without using *ugly* "hacks" - and reducing privileges(5) (on Linux: Capabilities(7)) so you don't have to start a daemon as root. [01:13] jMCg: yeah, just got that [01:13] +1 then ;-) [01:13] that's coming in one week [01:13] About a year ago, I asked you if there's a chance these will get into upstart and you gave an ~18 month estimate :) [01:13] whoa. [01:13] I have a patch from someone that adds all the useful bits [01:13] but that person refused to sign the CLA [01:14] Pity. [01:14] and I promised the Canonical CTO that I would continue those negotiations until the end of April [01:14] so 1st May, bzr merge ... ;-) [01:14] lol [01:15] I've suggested what I think is a sensible compromise between the positions [01:15] it's up to them [01:15] When someone gives you code - on the ML or via launchpad, don't they basically automatically give up all rights? [01:15] jMCg: no, Geneva Convention means they still own copyright [01:15] I kinda figured that was the position with apache, but I try not to care too much about CLAs. I just write and commit happily away. [01:16] Apache has a signed CLA [01:16] which I find unusual, since the Apache Licence already specifies everything necessary [01:16] But they are highly paranoid about IP. [01:16] s/they/we(?)/ [01:17] I guess [01:17] http://monster-island.org/tinashumor/humor/howinst.html < "By breaking this seal, ..." [01:19] the Geneva convention doesn't say anything about copyright really ;) [01:19] err [01:19] Berne [01:19] it's an international treaty about the treatment of war victims [01:19] ;) [01:20] to be fair, Berne and Geneva are both cities in Switzerland [01:20] and you can see how I got there [01:20] By air plane? [01:20] haha, yes, train no more [01:22] hmm.. any chances that new patchset will make it into Natty? :O [01:22] jMCg: natty releases before the 1st of May ;) [01:23] And 10.10 comes with: ii upstart 0.6.6-4 event-based init daemon [01:23] That's sad :-/ [01:27] aye [01:27] it could be worse [01:27] 11.04 could come with a version of Upstart that was invented by Ubuntu, and doesn't match any upstream release at all ;-) [01:28] ugh. [01:35] Keybuk: can you link the bzr branch that contains your Makefile? [01:44] it's not in a branch, it's just on my laptop at the moment [01:50] on the shuttle trip home, I shall make po/pot generation work [01:51] and then maybe tomorrow morning, "make dist" [12:04] when removing and purging a package I still have processes running so I think I don't stop it correctly in my upstart script [12:04] http://dpaste.com/534618/ [12:05] why doesn't my server being stopped? [16:11] I'd say it's more likely something is wrong in the packaging... [16:33] When I have something wiating on 'mounted MOUNTPOINT=/', then mountall stops after emitting that signal, until the wiating job has finished. I'm just curious - is that done by upstart, for any job which says 'emit X', or is mountall doing that specially? [16:50] hallyn: is that job a task ? [16:54] the DBus method EmitEvent has a Boolean 'wait' parameter, and if the waiting job is a task, waiting will wait until the task is run [16:55] "initctl emit" also has an option --no-wait that you can use [16:56] ah, i see. [16:56] yeah it's a task [16:56] so mountall must do a --wait [16:57] JanC: thanks [16:57] well, mountall probably uses the DBus API directly, but yeah ☺ [17:22] so is there any way, from an upstart job, to say 'start on x and y' where only the later one of x and y will be waited upon? === robbiew is now known as robbiew_