# The order of library loading

**URL:** <https://discourse.chef.io/t/the-order-of-library-loading/3278>\
**Category:** Chef Infra (archive)\
**Created:** [November 12, 2012, 4:16pm UTC](https://discourse.chef.io/t/the-order-of-library-loading/3278 "2012-11-12T16:16:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tetsu\_soh](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@tetsu\_soh](https://discourse.chef.io/u/tetsu_soh)\
**Post date:** [November 12, 2012, 4:16pm UTC](https://discourse.chef.io/t/the-order-of-library-loading/3278/1 "2012-11-12T16:16:51Z")

</div>

Hello everyone,

According to the document, chef client will first load all the libraries from every cookbook at its compile time.  
But in what order the libraries are loaded? Is it the order of cookbooks in the run list?

Thank you.

Tetsu

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [November 12, 2012, 4:54pm UTC](https://discourse.chef.io/t/the-order-of-library-loading/3278/2 "2012-11-12T16:54:29Z")

</div>

On Monday, November 12, 2012 at 8:16 AM, Tetsu Soh wrote:

> Hello everyone,
> 
> According to the document, chef client will first load all the libraries from every cookbook at its compile time.  
> But in what order the libraries are loaded? Is it the order of cookbooks in the run list?
> 
> Thank you.
> 
> Tetsu  
> Right now, it's hash order, which is nondeterministic. I recently added run\_list based ordering to attributes files for Chef 11[0], if there's some spare cycles before the Chef 11 beta release comes out I'll apply the same logic for other file types[1].

The logic is all there already, so it shouldn't be much work if someone wants to take this on.

--  
Daniel DeLeo

1. [http://tickets.opscode.com/browse/CHEF-2903](http://tickets.opscode.com/browse/CHEF-2903)
2. [http://tickets.opscode.com/browse/CHEF-3376](http://tickets.opscode.com/browse/CHEF-3376)

---

<div class="post-metadata">

**Author:** ![tetsu\_soh](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@tetsu\_soh](https://discourse.chef.io/u/tetsu_soh)\
**Post date:** [November 12, 2012, 9:31pm UTC](https://discourse.chef.io/t/the-order-of-library-loading/3278/3 "2012-11-12T21:31:12Z")

</div>

Hello Daniel,

Thank you for the info.

Tetsu

On Nov 13, 2012, at 1:54 AM, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote:

> On Monday, November 12, 2012 at 8:16 AM, Tetsu Soh wrote:
> 
> > Hello everyone,
> > 
> > According to the document, chef client will first load all the libraries from every cookbook at its compile time.  
> > But in what order the libraries are loaded? Is it the order of cookbooks in the run list?
> > 
> > Thank you.
> > 
> > Tetsu  
> > Right now, it's hash order, which is nondeterministic. I recently added run\_list based ordering to attributes files for Chef 11[0], if there's some spare cycles before the Chef 11 beta release comes out I'll apply the same logic for other file types[1].
> 
> The logic is all there already, so it shouldn't be much work if someone wants to take this on.
> 
> --  
> Daniel DeLeo
> 
> 1. [http://tickets.opscode.com/browse/CHEF-2903](http://tickets.opscode.com/browse/CHEF-2903)
> 2. [http://tickets.opscode.com/browse/CHEF-3376](http://tickets.opscode.com/browse/CHEF-3376)
