/srv/irclogs.ubuntu.com/2011/04/22/#upstart.txt

jMCgKeybuk: 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
KeybukjMCg: $@ is the make variable for "the target"00:25
Keybukso $@_SOURCES for init expands to init_SOURCES00:25
Keybuk$($@_SOURCES) is thus "the contents of $(init_SOURCES)"00:25
Keybukthe .SECONDEXPANSION bit tells automake to expand the objects of a target twice, and in the second time variables like $@ are set00:25
jMCgKeybuk: unintentionally, I use that...00:25
jMCgsee: https://scm.brainsware.org/svn/webstack/linux/Makefile00:26
jMCgKeybuk: ah.. my innitial understanding was that you didn't use automake.00:27
Keybukthat isn't automake00:27
Keybuksorry00:27
Keybuk"tells MAKE to expand"00:27
* jMCg tries to reparse.00:28
jMCgAh, okay, that explains the escaping of the $.00:29
Keybuknow for the advanced class00:38
Keybukhttp://paste.ubuntu.com/597191/00:38
Keybukwork out what *that* does00:38
Keybukand why it's awesome :D00:38
jMCgKeybuk: what's $1?00:50
jMCgOh.00:50
Keybukso:00:50
jMCgIt's Whatever $$@ gets expanded to.00:50
Keybukdep_dir turns src/foo.c into src/.deps/00:50
Keybukand dep_file turns src/foo.c into src/.deps/foo.mk00:50
jMCgWhy do you have an .mk file for each .c file?00:51
Keybukboth are written using Make functions so they work if you pass them multiple arguments00:51
jMCgGNU Make, anyway.00:51
Keybukso $(call dep_file,src/foo.c tests/bar.c baz.c) returns src/.deps/foo.mk tests/.deps/bar.mk ./.deps/baz.mk00:52
Keybukthe next bit is the implicit compile rule00:52
Keybukit 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 -MP00:52
Keybukis an operative bit there00:52
Keybukit means: AS WELL AS compiling the .o file, generate src/.deps/foo.mk00:53
Keybukthat is a Makefile snippet that lists all of the .h files that gcc found00:53
Keybukso it might look like:00:53
Keybuksrc/foo.o: src/foo.c src/common.h src/log.h00:53
jMCgACK.00:54
Keybukand then00:54
Keybuk-include $(call dep_file,$(SOURCES))00:54
Keybukmeans include every .mk file for every defined file in $(SOURCES)00:54
jMCgWhat's -include?00:54
Keybuk-include means "ignore error due to not existing"00:54
Keybukso the first time you type "make" none of these .deps files exist00:54
Keybukso make doesn't know which headers are deps00:54
Keybukbut that's ok00:54
Keybuknone of the .o files exist either ;-)00:54
jMCgI suppse you define $(SOURCES) somewhere above.00:54
Keybukso the first time you compile, make's brain is populated with all of the .h deps00:55
Keybukso the next time, it rebuilds based on what you changed00:55
Keybukyeah, $(SOURCES) is put together elsewhere using $(foreach ...)00:55
Keybukthe one other strange bit is the stamp madness00:55
jMCgThat's bordering insane -- but then, so is autocrap.00:55
Keybukeach .o file depends on the equivalent src/.deps/stamp file00:55
Keybukand that rule is simple, it makes the .deps directory and touches the stamp file in it00:56
Keybukthis means there's only one mkdir call for each .deps directory00:56
Keybukrather than one for each C file00:56
Keybuknot strictly necessary, but it looks better in the make V=1 output :p00:56
jMCgKeybuk: how long did you work on upstart's Makefile?00:58
Keybukoh, that stuff?00:59
Keybukon the shuttle this morning00:59
Keybukso about an hour00:59
jMCgI hereby declare you my personal hero of the hour.01:00
jMCgWould you very much mind removing all the autocrap from trafficserver: https://svn.apache.org/repos/asf/trafficserver/traffic/trunk/ - please?01:00
jMCgInstead 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
Keybukheh, I don't hate autotools01:03
KeybukI'm listed in AUTHORS after all01:03
Keybukbut Upstart simply doesn't need any of the portability stuff01:03
Keybukwe can assume GNU make and GCC or clang01:03
Keybukand Linux01:03
Keybukand Automake's requirements to list every single binary was *really* causing me problems with maintaining the ever-growing test suite01:03
Keybukby switching to GNU Make turned up to 11, I can just have a single TESTS = ... that lists every binary01:04
Keybukand where I need it linked to .o files from the source, add01:04
Keybuktests/blah: src/blah.o src/foo.c01:04
Keybukand everything else is automatic01:04
jMCghttp://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
Keybukagree01:06
KeybukLinux + OS X01:06
Keybukand those are largely GNU Toolchain01:06
Keybukhell, I build Upstart on OS X on my MBP half the time when testing random bits01:06
jMCgSolaris 11 will be moving to gmake and much of the GNU Tool chain - well, I suppose they will keep their compiler.01:07
jMCgAnd maybe, one day, FreeBSD will have moved to clang -- but they will still have the rest of the GNU chain.01:07
KeybukSolwhatnow?01:08
jMCgThe thing we use at $work.01:08
Keybukoh, that Oracle thing01:08
KeybukI thought they were pushing Red Hat ;-)01:08
Keybukwell, Oracle Ripped Off Linux01:08
jMCgWell, there's a couple of things in Solaris I'd really love to see in Linux.01:09
ionI want a good port of zfs on Linux or the 2018 release of btrfs.01:09
jMCgSMF is, by now, I believe, suprior to upstart.01:09
jMCgion: +101:09
ion(Also, i want it now.)01:10
jMCgWell, 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
jMCgThat really rocks.01:11
jMCgI can run Tomcat on port 80 without feeling dirty.01:11
JanCwasn't there some talk about some BSDs switching to PCC ?  ;)01:12
KeybukjMCg: really? what do you think SMF does better than Upstart?01:12
jMCgJanC: long, long time ago. I think they've hopped on the LLVM bandwagon, because that one's actually moving.01:12
KeybukSMF was pretty basic last time I looked01:12
jMCgKeybuk: 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
KeybukjMCg: yeah, just got that01:13
Keybuk+1 then ;-)01:13
Keybukthat's coming in one week01:13
jMCgAbout 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
jMCgwhoa.01:13
KeybukI have a patch from someone that adds all the useful bits01:13
Keybukbut that person refused to sign the CLA01:13
jMCgPity.01:14
Keybukand I promised the Canonical CTO that I would continue those negotiations until the end of April01:14
Keybukso 1st May, bzr merge ... ;-)01:14
JanClol01:14
KeybukI've suggested what I think is a sensible compromise between the positions01:15
Keybukit's up to them01:15
jMCgWhen someone gives you code - on the ML or via launchpad, don't they basically automatically give up all rights?01:15
KeybukjMCg: no, Geneva Convention means they still own copyright01:15
jMCgI 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
KeybukApache has a signed CLA01:16
Keybukwhich I find unusual, since the Apache Licence already specifies everything necessary01:16
jMCgBut they are highly paranoid about IP.01:16
jMCgs/they/we(?)/01:16
KeybukI guess01:17
jMCghttp://monster-island.org/tinashumor/humor/howinst.html < "By breaking this seal, ..."01:17
JanCthe Geneva convention doesn't say anything about copyright really  ;)01:19
Keybukerr01:19
KeybukBerne01:19
JanCit's an international treaty about the treatment of war victims01:19
JanC;)01:19
Keybukto be fair, Berne and Geneva are both cities in Switzerland01:20
Keybukand you can see how I got there01:20
jMCgBy air plane?01:20
Keybukhaha, yes, train no more01:20
jMCghmm.. any chances that new patchset will make it into Natty? :O01:22
JanCjMCg: natty releases before the 1st of May  ;)01:22
jMCgAnd 10.10 comes with: ii  upstart                                               0.6.6-4                                               event-based init daemon01:23
jMCgThat's sad :-/01:23
Keybukaye01:27
Keybukit could be worse01:27
Keybuk11.04 could come with a version of Upstart that was invented by Ubuntu, and doesn't match any upstream release at all ;-)01:27
jMCgugh.01:28
jMCgKeybuk: can you link the bzr branch that contains your Makefile?01:35
Keybukit's not in a branch, it's just on my laptop at the moment01:44
Keybukon the shuttle trip home, I shall make po/pot generation work01:50
Keybukand then maybe tomorrow morning, "make dist"01:51
benccwhen removing and purging a package I still have processes running so I think I don't stop it correctly in my upstart script12:04
bencchttp://dpaste.com/534618/12:04
benccwhy doesn't my server being stopped?12:05
JanCI'd say it's more likely something is wrong in the packaging...16:11
hallynWhen 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
JanChallyn: is that job a task ?16:50
JanCthe DBus method EmitEvent has a Boolean 'wait' parameter, and if the waiting job is a task, waiting will wait until the task is run16:54
JanC"initctl emit" also has an option --no-wait that you can use16:55
hallynah, i see.16:56
hallynyeah it's a task16:56
hallynso mountall must do a --wait16:56
hallynJanC: thanks16:57
JanCwell, mountall probably uses the DBus API directly, but yeah  ☺16:57
hallynso 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!