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

.ji files should start with "magic" identifier bytes + version #12444

Closed
stevengj opened this issue Aug 3, 2015 · 1 comment
Closed

.ji files should start with "magic" identifier bytes + version #12444

stevengj opened this issue Aug 3, 2015 · 1 comment
Labels
compiler:precompilation Precompilation of modules

Comments

@stevengj
Copy link
Member

stevengj commented Aug 3, 2015

Currently, the .ji files have no identifying header.

  • It is standard practice on Unix for binary files to start with a few bytes (usually an ASCII string) (a "magic number") that identifies the file type (e.g. for the file command). e.g. .ji files could start with "juliaimage".
  • It is also good practice to include a version identifier for the file format. e.g. we could have a 4-byte sequence of <major><minor>, and if we detect that the major version is different from what we want then we reject the .ji file as being invalid, whereas changes to <minor> could be assumed backward compatible. (Or don't bother with major/minor and just have a single version number that is required to match.)
  • For informational purposes, it might be nice to include the Julia version number that created the file.
@stevengj stevengj added the compiler:precompilation Precompilation of modules label Aug 3, 2015
@stevengj
Copy link
Member Author

stevengj commented Aug 3, 2015

The version number might be redundant, because the .ji file stores the UUID of the Core module (actually just a timestamp) and refuses to load if that doesn't match, so .ji files are effectively specific to a particular Julia build. But it wouldn't hurt to add one.

stevengj added a commit to stevengj/julia that referenced this issue Aug 4, 2015
stevengj added a commit to stevengj/julia that referenced this issue Aug 4, 2015
stevengj added a commit to stevengj/julia that referenced this issue Aug 4, 2015
stevengj added a commit to stevengj/julia that referenced this issue Aug 4, 2015
stevengj added a commit to stevengj/julia that referenced this issue Aug 4, 2015
stevengj added a commit to stevengj/julia that referenced this issue Aug 5, 2015
stevengj added a commit that referenced this issue Aug 5, 2015
fix #12444 (add magic and format version to beginning of .ji files)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:precompilation Precompilation of modules
Projects
None yet
Development

No branches or pull requests

1 participant