opened
dzhu
username_0
The HTML context object provided by this package [contains functions as values](https://github.com/username_1/sphinx-material/blob/aebde13c30dd4bc63159482d5b6a87fc3f211556/sphinx_material/__init__.py#L242). As a result, the [config hash](https://github.com/sphinx-doc/sphinx/blob/e7a0af807a58f97be826c19644fac72b50fb6769/sphinx/builders/html.py#L70) in the `.buildinfo` generated by the HTML builder changes on every build, since it includes the `str` of a function, which includes an address in memory that changes each time (e.g., `<function table_fix at 0x7f5dcdef2738>`). Therefore the caching is broken and Sphinx does a full rebuild each time.

I've also opened [an issue on the Sphinx repo](https://github.com/sphinx-doc/sphinx/issues/7093), since I don't know whether this case is intended to be supported or not.

Steps to reproduce the behavior:
```
$ wget https://github.com/sphinx-doc/sphinx/files/4146498/sphinx-test.zip
$ unzip sphinx-test.zip
$ cd sphinx-test
$ pip install -r requirements.txt
$ make html
...
building [html]: targets for 1 source files that are out of date
...
$ make html
...
building [html]: targets for 1 source files that are out of date
...
```
The second time, there should be no files marked out of date.
`get_html_context` breaks Sphinx caching
issue
created
bashtage
username_1
There is a fix in #28.  It is a bit heavy-handed.  Sphinx considers two builds to be the same if str(obj) is the same for everything in the conf.  Functions do not naturally have stable str, so the rebuild.
comment
closed
bashtage
username_1
issue
created
bashtage
username_1
When you get a chance, can you confirm that the fix in master works for you?
comment
created
dzhu
username_0
It appears to be working great. Thanks for the quick response!
comment