aboutsummaryrefslogtreecommitdiff
path: root/src/os.cpp
AgeCommit message (Collapse)Author
2019-04-26Fix path canonicalization when $HOME has a trailing slashAndrew Kelley
2019-04-24remove Shebang (#!) supportShawn Landden
Closes: #2165
2019-04-13make os_file_close poison file handle after closeBen Noordhuis
This helps track down use-after-close bugs.
2019-04-02better error message when os_file_overwrite failsAndrew Kelley
2019-03-27fix build on arm64Shawn Landden
2019-03-11fix build on windowsAndrew Kelley
2019-03-11stage1 caching system: detect problematic mtimesAndrew Kelley
closes #2045
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 windows buildAndrew Kelley
2019-03-07better behavior when cache dir unavailableAndrew Kelley
and choose different manifest dir for local cache to avoid conflict with zig build
2019-03-07fix regressions on macosAndrew Kelley
2019-03-04initial glibc supportAndrew Kelley
2019-02-28struct types get fully qualified namesAndrew Kelley
and function symbol names become fully qualified
2019-02-26windows returns EINVAL for fopen when there is an asterisk in the nameAndrew Kelley
closes #508
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-02-23better libc detection (#1996)Andrew Kelley
* better libc detection This introduces a new command `zig libc` which prints the various paths of libc files. It outputs them to stdout in a simple text file format that it is capable of parsing. You can use `zig libc libc.txt` to validate a file. These arguments are gone: --libc-lib-dir [path] directory where libc crt1.o resides --libc-static-lib-dir [path] directory where libc crtbegin.o resides --msvc-lib-dir [path] (windows) directory where vcruntime.lib resides --kernel32-lib-dir [path] (windows) directory where kernel32.lib resides Instead we have this argument: --libc [file] Provide a file which specifies libc paths This is used to pass a libc text file (which can be generated with `zig libc`). So it is easier to manage multiple cross compilation environments. `--cache on` now works when linking against libc. `ZigTarget` now has a bool field `is_native` Better error messaging when you try to link against libc or use `@cImport` but the various paths cannot be found. It should also be faster. * save native_libc.txt in zig-cache This avoids having to detect libc at runtime on every invocation.
2019-02-17Add NetBSD supportMaya Rashish
Mostly picking the same paths as FreeBSD. We need a little special handling for crt files, as netbsd uses its own (and not GCC's) for those, with slightly different names.
2019-01-31os.cpp: fix regression on Windows from 59c050e7Andrew Kelley
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-12-12freebsd: fix os_self_exe_path function and update std libAndrew Kelley
2018-11-27Merge branch 'master' into freebsd2Andrew Kelley
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-19Merge branch 'freebsd-up' of https://github.com/myfreeweb/zig into freebsd2Andrew Kelley
2018-11-18src/os.cpp: os_file_read: return ErrorIsDir on case EISDIR;kristopher tate
2018-11-16Fixed typosVallentin
2018-11-08made colored output more consistent (#1706)emekoi
* made colored output more consistent * added os.supportsAnsiEscapeCodes
2018-11-06limit integer types to maximum bit width of 65535Andrew Kelley
closes #1541
2018-11-02support building static self hosted compiler on macosAndrew Kelley
* add a --system-linker-hack command line parameter to work around poor LLD macho code. See #1535 * build.zig correctly handles static as well as dynamic dependencies when building the self hosted compiler. - no more unnecessary libxml2 dependency - a static build on macos produces a completely static self-hosted compiler for macos (except for libSystem as intended).
2018-10-20Add FreeBSD support to os.cppGreg V
2018-10-09stage1 os: workaround for macos not having environ variableAndrew Kelley
2018-10-09more efficient builtin library code generationAndrew Kelley
* introduce --disable-pic option which can generally be allowed to be the default. compiler_rt.a and builtin.a get this option when you build a static executable. * compiler_rt and builtin libraries are not built for build-lib --static * posix_spawn instead of fork/execv * disable the error limit on LLD. Fixes the blank lines printed
2018-10-06Merge pull request #1429 from shawnl/arm64Andrew Kelley
initial arm64 support
2018-10-06arm64: respond to code reviewShawn Landden
2018-09-22rm extraneous macroJeff Fowler
2018-09-18minor cleanups from 68c1d05917Andrew Kelley
2018-09-18compiling on mingw is now supported (#1542)emekoi
* compiles on mingw-w64 * fixed error in os_file_overwrite on windows * fixed windows hello_world example
2018-09-17remove `zig build --init`. add `zig init-lib` and `zig init-exe`Andrew Kelley
init-lib creates a working static library with tests, and init-exe creates a working hello world with a `run` target. both now have test coverage with the new "cli tests" file. closes #1035
2018-09-12windows os.cpp implementationsAndrew Kelley
2018-09-11darwin fixupsAndrew Kelley
2018-09-11Merge remote-tracking branch 'origin/master' into stage1-cachingAndrew Kelley
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-09`zig id` commandAndrew Kelley
2018-09-09basic compiler id hash workingAndrew Kelley
2018-09-08Fixes a path corruption when compiling on windows.Sahnvour
2018-09-08use vfork in stage1 compiler to avoid OOMShawn Landden
2018-09-04port std.os.path.resolve to stage1Andrew Kelley
2018-07-20self-hosted: share C++ code for finding libc on windowsAndrew Kelley
2018-06-26Fix os_path_join for case where dirname is emptyIsaac Hier
2018-06-18stage1: update darwin code to workaround old libc bugAndrew Kelley
See #1128