gittup / tup

Tup is a file-based build system.
http://gittup.org/tup/
GNU General Public License v2.0
1.18k stars 145 forks source link

Monitor on OSX #156

Open ashleyh opened 10 years ago

ashleyh commented 10 years ago

Any reason I shouldn't start trying to implement this? Has someone already started, or is it known to be impossible, or something?

gittup commented 10 years ago

On Tue, Dec 3, 2013 at 5:04 AM, Ashley Hewson notifications@github.comwrote:

Any reason I shouldn't start trying to implement this? Has someone already started, or is it known to be impossible, or something?

See also issue 131: https://github.com/gittup/tup/issues/131

I haven't heard anything since then, so I'm not sure if they have actually started working on it or what progress has been made.

I don't believe it is impossible, though the current monitor code (in src/tup/monitor/inotify.c) is mixed between generic monitoring code & inotify/linux specific code. I'd be fine with copying inotify.c into something-osx-specific.c and replacing the inotify usage with whatver mac supports (issue 131 mentions FSEvents API). Once that passes tests, we can work on pulling out common code into a separate file.

Thanks for your interest! -Mike

ashleyh commented 10 years ago

Thanks, I saw #131 but didn't spot the comment about them trying to add it.

Up to you of course but another approach might be to factor out the inotify stuff first then add fsevents later?

gittup commented 10 years ago

On Wed, Dec 4, 2013 at 1:26 PM, Ashley Hewson notifications@github.comwrote:

Thanks, I saw #131 https://github.com/gittup/tup/issues/131 but didn't spot the comment about them trying to add it.

Up to you of course but another approach might be to factor out the inotify stuff first then add fsevents later?

I don't mind either way - I was just suggesting it as a possibility since I think it would be easier to get started. With the lua parser, the author essentially copied parser.c and added the lua bits in, and then we refactored it later. Sometimes it's hard to know what will be common and what will be - I don't know how similar inotify & fsevents are, so I'd be hard-pressed to suggest what code to pull out.

For example, in the inotify code there is support for handling event coalescing, so 'create foo.tmp; rename foo.tmp foo.real' gets converted into 'create foo.real' so that tup doesn't create a "foo.tmp" node only to delete it later. Maybe that won't be needed with FSEvents, so it could stay in inotify.c rather than getting moved to shared code.

Let me know what you think! -Mike

ashleyh commented 10 years ago

OK, I think you're right -- I don't know how similar inotify & fsevents are either.

dnozay commented 9 years ago

you may want to take a look at https://github.com/emcrisostomo/fswatch to get an idea.