Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only recompile when needed (or asked) #120

Open
jhoobergs opened this issue Jan 11, 2023 · 0 comments
Open

Only recompile when needed (or asked) #120

jhoobergs opened this issue Jan 11, 2023 · 0 comments
Assignees
Projects

Comments

@jhoobergs
Copy link
Collaborator

jhoobergs commented Jan 11, 2023

If the exam.json file in the _output folder equals the new one that it would like to compile, no recompilation is needed.
When the user really wants, they should be able to recompile, by adding a no-cache options.

Except:

  • When the numbas version changes: We can keep a file with the git hash in each exam output folder and compare that one
  • When the version of one of the extension changes: We can keep a file with the git hashes of all used extensions in each exam output folder.
  • When one of the resources changed. We can compare the resource files. (Things to keep in mind: https://stackoverflow.com/a/71799977)
  • When the theme has changed: much harder to detect. Themes can also inherit from other themes, so we should also check whether any of the parent themes has changed (in files that were not overriden by the child). (https://docs.numbas.org.uk/en/latest/themes/index.html#themes)

Options for the theme:

  • somehow hash the entire theme folder and compare it
  • add a mandatory version file in the theme folder and just compared that one (and the once of the parents)
  • compare the directory structures of the themes, if different, recompile, else compare each file byte by byte.
@jhoobergs jhoobergs self-assigned this Jan 11, 2023
@jhoobergs jhoobergs added this to To do in Version 1 via automation Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant