Dependency cycle between plist/headers <-> cache.capnp.h?

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Dependency cycle between plist/headers <-> cache.capnp.h?

jason
textmate (master) λ git rev-parse HEAD
fd827fb8179cd74e553680d605d2172e05822e07
textmate (master) λ git clean -dffx . && git submodule foreach git clean -dffx
Entering 'Applications/SyntaxMate/resources/SyntaxMate.tmBundle'
Entering 'Applications/TextMate/icons'
Entering 'PlugIns/dialog'
Entering 'PlugIns/dialog-1.x'
Entering 'bin/CxxTest'
Entering 'vendor/MASPreferences/vendor'
Entering 'vendor/MGScopeBar/vendor'
Entering 'vendor/Onigmo/vendor'
Entering 'vendor/XcodeEditor/vendor'
Entering 'vendor/kvdb/vendor'
textmate (master) λ ./configure
rm /Users/jgavris/build/TextMate/Frameworks/SoftwareUpdate/fixtures/secret.pem
[1/1] Generate ‘build.ninja’…
[1/1] Generate source from ‘Frameworks/encoding/src/frequencies.capnp’…
[1/1] Generate source from ‘Frameworks/plist/src/cache.capnp’…
Downloading... Done!
textmate (master) λ ninja
[1/1] Generate ‘build.ninja’…
ninja: error: dependency cycle: plist/headers -> /Users/jgavris/build/TextMate/include/plist/cache.capnp.h -> Frameworks/plist/src/cache.capnp.h -> plist/headers



_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Dependency cycle between plist/headers <-> cache.capnp.h?

Allan Odgaard-4

On 15 Feb 2018, at 2:31, jason wrote:

[1/1] Generate ‘build.ninja’…
ninja: error: dependency cycle: plist/headers ->
/Users/jgavris/build/TextMate/include/plist/cache.capnp.h ->
Frameworks/plist/src/cache.capnp.h -> plist/headers

What version of ninja are you using?



_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Dependency cycle between plist/headers <-> cache.capnp.h?

jason
In reply to this post by jason
I'm on ninja 1.8.2

_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Dependency cycle between plist/headers <-> cache.capnp.h?

Ryan Schmidt
I think this is the same problem I reported to support a month ago:

> Begin forwarded message:
>
> From: Ryan Schmidt
> Subject: Re: ninja: error: dependency cycle: plist/headers
> Date: January 25, 2018 at 02:13:16 CST
> To: Michael Sheets

> I've done some manual bisecting, and the problem starts with https://github.com/textmate/textmate/commit/a377b35bdebc63e62c64fb7ab778c2b037508ece
>
> If I understand what's going on with the LINK line in those target files, with this commit, io now depends on OakFoundation, whereas OakFoundation always depended on io already, so now there's a dependency cycle.


_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Dependency cycle between plist/headers <-> cache.capnp.h?

jason
I've definitely built TextMate since that commit (2016?!).

On Mon, Feb 26, 2018 at 12:45 AM, Ryan Schmidt <[hidden email]> wrote:
I think this is the same problem I reported to support a month ago:

> Begin forwarded message:
>
> From: Ryan Schmidt
> Subject: Re: ninja: error: dependency cycle: plist/headers
> Date: January 25, 2018 at 02:13:16 CST
> To: Michael Sheets

> I've done some manual bisecting, and the problem starts with https://github.com/textmate/textmate/commit/a377b35bdebc63e62c64fb7ab778c2b037508ece
>
> If I understand what's going on with the LINK line in those target files, with this commit, io now depends on OakFoundation, whereas OakFoundation always depended on io already, so now there's a dependency cycle.


_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate



_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Dependency cycle between plist/headers <-> cache.capnp.h?

Allan Odgaard-4
In reply to this post by Ryan Schmidt

On 26 Feb 2018, at 12:45, Ryan Schmidt wrote:

I think this is the same problem I reported to support a month ago:

The commit that introduced the cycle seems to be 75e8723e64c695e464dc78f5b9d84681b9b994da

So you can revert this, and it should work, but there’s a link to another thread that describes why this commit was required.

However, once you have the headers in place, you can build without the explicit dependency, so that can work as a short-term solution.



_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Dependency cycle between plist/headers <-> cache.capnp.h?

jason
Perfect, thanks! 

I didn't `git bisect` to find it, though I should have. 

Was more curious that nobody else had this problem.

On Wed, Mar 7, 2018 at 11:53 PM, Allan Odgaard <[hidden email]> wrote:

On 26 Feb 2018, at 12:45, Ryan Schmidt wrote:

I think this is the same problem I reported to support a month ago:

The commit that introduced the cycle seems to be 75e8723e64c695e464dc78f5b9d84681b9b994da

So you can revert this, and it should work, but there’s a link to another thread that describes why this commit was required.

However, once you have the headers in place, you can build without the explicit dependency, so that can work as a short-term solution.



_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate



_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Dependency cycle between plist/headers <-> cache.capnp.h?

jason
Any interest in trying out the Bazel build system? It's really fast (like ninja), and does not allow undeclared dependencies in C-language build rules by design.


On Wed, Mar 7, 2018 at 11:58 PM, jason <[hidden email]> wrote:
Perfect, thanks! 

I didn't `git bisect` to find it, though I should have. 

Was more curious that nobody else had this problem.

On Wed, Mar 7, 2018 at 11:53 PM, Allan Odgaard <[hidden email]> wrote:

On 26 Feb 2018, at 12:45, Ryan Schmidt wrote:

I think this is the same problem I reported to support a month ago:

The commit that introduced the cycle seems to be 75e8723e64c695e464dc78f5b9d84681b9b994da

So you can revert this, and it should work, but there’s a link to another thread that describes why this commit was required.

However, once you have the headers in place, you can build without the explicit dependency, so that can work as a short-term solution.



_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate




_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Dependency cycle between plist/headers <-> cache.capnp.h?

pavel.evst
In reply to this post by Allan Odgaard-4
I can confirm, it works

1. Add "ns" to Frameworks/OakFoundation/target: "LINK        += io text ns"
2. Run ./configure
3. Remove "ns"
4. Run ./configure
5. Run ninja TextMate




--
Sent from: http://textmate.1073791.n5.nabble.com/textmate-users-f3.html

_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Dependency cycle between plist/headers <-> cache.capnp.h?

jason
Indeed, that works. Can we get a proper patch into master for this?

On Fri, May 25, 2018 at 8:41 AM, pavel.evst <[hidden email]> wrote:
I can confirm, it works

1. Add "ns" to Frameworks/OakFoundation/target: "LINK        += io text ns"
2. Run ./configure
3. Remove "ns"
4. Run ./configure
5. Run ninja TextMate




--
Sent from: http://textmate.1073791.n5.nabble.com/textmate-users-f3.html

_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate



_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Dependency cycle between plist/headers <-> cache.capnp.h?

Allan Odgaard-4

On 25 May 2018, at 20:07, jason wrote:

Indeed, that works. Can we get a proper patch into master for this?

This has now been pushed to master: https://github.com/textmate/textmate/commit/ae470335a234e336c3d0337f065e26b29751e668



_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Dependency cycle between plist/headers <-> cache.capnp.h?

Allan Odgaard-4
In reply to this post by jason

On 10 Mar 2018, at 20:10, jason wrote:

Any interest in trying out the Bazel build system? It's really fast (like
ninja), and does not allow undeclared dependencies in C-language build
rules by design.

The ninja build system itself is a bit like make in that it’s just a low-level DSL to describe the dependency graph.

There is a script that generates the graph, which is heavily customized to the needs of TextMate (and myself). I have looked at other build systems, and I also took a quick look at Bazel, but I do not see an advantage in switching, as I would have to write a ton of custom code to bring it up to what the current system does, and for this, it’s actually best with a low-level build system rather than one that tries to handle everything, since there are no standards for how to manage multiple targets that can depend on each other, use each other’s header files, resources, etc., which means all the free stuff you get out of the box with these higher level build systems are often stuff that is just in the way when you have a complex project…

For the dependency cycle that ninja “did not detect”, I do actually have some (non-committed) code that improves on dependency detection which would have caught this, but it’s not just a simple “source depends on header” issue, but about link dependencies, which can be a little tricky, as you can’t assume that including a header file means you necessarily wants to link with the library to which the header belongs, for example some sources may include oak/debug.h but do not want to automatically link with my oak debug library, unless in debug mode, and iirc that was the primary reason I didn’t yet push the code that automatically figures out link dependencies.



_______________________________________________
textmate mailing list
[hidden email]
http://lists.macromates.com/listinfo/textmate
Reply | Threaded
Open this post in threaded view
|

Re: Dependency cycle between plist/headers <-> cache.capnp.h?

Allan Odgaard-4

On 12 Jun 2018, at 0:20, Allan Odgaard wrote:

For the dependency cycle that ninja “did not detect”, I do actually have some (non-committed) code that improves on dependency detection which would have caught this, but it’s not just a simple “source depends on header” issue, but about link dependencies, which can be a little tricky, as you can’t assume that including a header file means you necessarily wants to link with the library to which the header belongs, for example some sources may include oak/debug.h but do not want to automatically link with my oak debug library, unless in debug mode, and iirc that was the primary reason I didn’t yet push the code that automatically figures out link dependencies.

For anyone interested in this stuff, I have updated the build process: https://github.com/textmate/textmate/commit/412e6798ca206b15cdc8f86a1387835a3f4f82e7

This should address the issues some have experienced during initial full build where a header is unavailable because that target has not yet been built yet.

More details in the commit message.



_______________________________________________
textmate mailing list
[hidden email]
https://lists.macromates.com/listinfo/textmate