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