aboutsummaryrefslogtreecommitdiff
path: root/src/cache_hash.cpp
AgeCommit message (Collapse)Author
2020-02-16rename libuserland to libstage2Andrew Kelley
2019-05-29add review changesMichael Dusan
- use std.heap.c_allocator - use @panic instead of unreachable - use extern enum for tokenizer result type
2019-05-27new .d file parser for C compilationMichael Dusan
- wip for #2046 - clang .d output must be created with `clang -MV` switch - implemented in Zig - hybridized for zig stage0 and stage1 - zig test src-self-hosted/dep_tokenizer.zig
2019-05-13cache_add_dep_file: handle ErrorFileNotFound speciallyAndrew Kelley
2019-05-13Assemble asm files using CCLemonBoy
Stuffing all the files together and compiling the resulting blob with the main program is a terrible idea. Some files, namely the .S ones, must be run trough the C preprocessor before assembling them (#2437). Beside that the aggregate may be mis-compiled due to the presence of some flags that affect the following code. For example let's consider two files, a.s and b.s a.s ``` fn1: ret .data data1: .word 0 ``` b.s ``` fn2: ret ``` Now, fn1 and fn2 will be both placed in the .text section as intended if the two files are compiled separately. But if we merge them the `.data` flag ends up placing fn2 in the wrong section! This fixes a nasty crash where musl's memset ended up in the non-executable data segment, leading to too many hours of head-scratching.
2019-04-24remove Shebang (#!) supportShawn Landden
Closes: #2165
2019-04-13don't close cache manifest file prematurelyBen Noordhuis
ErrorInvalidFormat is not a fatal error so don't close the cache manifest file right away but instead let cache_final() handle it. Fixes the following (very common) warning when running the test suite: Warning: Unable to write cache file [..]: unexpected seek failure The seek failure is an lseek() system call that failed with EBADF because the file descriptor had already been closed.
2019-04-13make os_file_close poison file handle after closeBen Noordhuis
This helps track down use-after-close bugs.
2019-04-02fix cache hash regressionAndrew Kelley
fixes "warning: unexpected seek failure" fix regression introduced by 27e31f04758d95cb7cf51a74e2a3903553ce3bc5 the fd should be closed only if returning with an error
2019-04-02fix fd leak in stage1 cacheing codeShawn Landden
2019-03-11stage1 caching system: detect problematic mtimesAndrew Kelley
closes #2045
2019-03-08fix .d file parsing and string literal ast renderingAndrew Kelley
2019-03-08breaking changes to zig build API and improved cachingAndrew Kelley
* in Zig build scripts, getOutputPath() is no longer a valid function to call, unless setOutputDir() was used, or within a custom make() function. Instead there is more convenient API to use which takes advantage of the caching system. Search this commit diff for `exe.run()` for an example. * Zig build by default enables caching. All build artifacts will go into zig-cache. If you want to access build artifacts in a convenient location, it is recommended to add an `install` step. Otherwise you can use the `run()` API mentioned above to execute programs directly from their location in the cache. Closes #330. `addSystemCommand` is available for programs not built with Zig build. * Please note that Zig does no cache evicting yet. You may have to manually delete zig-cache directories periodically to keep disk usage down. It's planned for this to be a simple Least Recently Used eviction system eventually. * `--output`, `--output-lib`, and `--output-h` are removed. Instead, use `--output-dir` which defaults to the current working directory. Or take advantage of `--cache on`, which will print the main output path to stdout, and the other artifacts will be in the same directory with predictable file names. `--disable-gen-h` is available when one wants to prevent .h file generation. * `@cImport` is always independently cached now. Closes #2015. It always writes the generated Zig code to disk which makes debug info and compile errors better. No more "TODO: remember C source location to display here" * Fix .d file parsing. (Fixes the MacOS CI failure) * Zig no longer creates "temporary files" other than inside a zig-cache directory. This breaks the CLI API that Godbolt uses. The suggested new invocation can be found in this commit diff, in the changes to `test/cli.zig`.
2019-03-07fix .d file processing and use -MV to quote spacesAndrew Kelley
2019-03-04initial glibc supportAndrew Kelley
2019-02-25`@cImport` works with `--cache on`Andrew Kelley
We pass -MD -MF args to clang when doing `@cImport`, which gives us a complete list of files that the C code read from. Then we add these to the cache. So even when using `@cImport` Zig's caching system remains perfect. This is a proof of concept for the mechanism that the self-hosted compiler will use to watch and rebuild files.
2019-01-30collapse os_file_mtime into os_file_open_r and check for directoryAndrew Kelley
This is a manual merge of kristate's pull request #1754, due to conflicts + a couple fixups. closes #1754
2018-11-26stage1: better file path handlingAndrew Kelley
* better message printed when cache hash fails * better handling of '/' as root source file * os_path_split parses '/' and '/a' correctly closes #1693 closes #1746
2018-11-16Fixed typosVallentin
2018-09-18stage1 caching: don't write manifest until cache releaseAndrew Kelley
this prevents the situation where we determine the cache manifest and write it, but then crash or otherwise error out before putting the artifacts in the proper place. now the artifacts will be in place because cache_release happens after that step is done.
2018-09-13alternate fix using the rest() functionAndrew Kelley
2018-09-13src/cache_hash.cpp: support file paths that contain spaces;kristopher tate
ref: #1510
2018-09-11bring back zig-cacheAndrew Kelley
we need somewhere to put .o files and leave them while the user executes their program, so that stack traces on MacOS can find the .o files and get at the DWARF info. if we try to clean up old global tmp dir files, first of all that's a hard and complicated problem, and secondly it's not clear how that is better than dumping the .o file inside zig-cache locally.
2018-09-11ability to disable cache. off by default except for...Andrew Kelley
...zig run, zig build, compiler_rt.a, and builtin.a
2018-09-10stage1 caching: zig no longer uses zig-cacheAndrew Kelley
2018-09-10caching is workingAndrew Kelley
* add almost all the input parameter state to the hash - missing items are the detected MSVC installation on Windows and detected libc installation on POSIX - also missing are C files and .h files that libclang finds * artifacts are created in global cache directory instead of zig-cache. - exception: builtin.zig is still in zig-cache * zig run uses the new cache correctly * zig run uses execv on posix systems
2018-09-10stage1: always optimize blake and softfloat even in debug modeAndrew Kelley
2018-09-09`zig id` commandAndrew Kelley
2018-09-09basic compiler id hash workingAndrew Kelley