Commit Graph

8027 Commits

Author SHA1 Message Date
Andrew Kelley
767f041068 std.process: fix typo 2020-02-22 17:49:52 -05:00
Andrew Kelley
cfffb9c5e9
improve handling of environment variables on Windows
std.os.getenv and std.os.getenvZ have nice compile errors when not linking
libc and using Windows.

std.os.getenvW is provided as a Windows-only API that does not require
an allocator. It uses the Process Environment Block.
std.process.getEnvVarOwned is improved to be a simple wrapper on top of
std.os.getenvW.

std.process.getEnvMap is improved to use the Process Environment Block
rather than calling GetEnvironmentVariableW.

std.zig.system.NativePaths uses process.getEnvVarOwned instead of
std.os.getenvZ, which works on Windows as well as POSIX.
2020-02-22 17:35:36 -05:00
Andrew Kelley
936d0b18b1
update std lib to integrate with libc for environ
closes #3511
2020-02-22 15:59:13 -05:00
Andrew Kelley
0cd89e9176
std.os.execvpeZ_expandArg0: fix not restoring argv[0]
This function expands argv[0] into the absolute path resolved with PATH
environment variable before making the execve syscall. However, in case
the execve fails, e.g. with ENOENT, it did not restore argv to how it
was before it was passed in. This resulted in the caller performing an
invalid free.

This commit also adds verbose debug info when native system C compiler
detection fails. See #4521.
2020-02-22 13:56:02 -05:00
LemonBoy
495e894225 delete extra code, more forgiveness 2020-02-22 12:44:21 +01:00
LemonBoy
41bca1ce76 unification: windows debug info 2020-02-22 12:05:50 +01:00
LemonBoy
c060cae3ce unification: osx debug info 2020-02-22 11:51:45 +01:00
Andrew Kelley
dca19b6757
fix regression in detecting native glibc version
closes #4519
2020-02-21 20:48:50 -05:00
Andrew Kelley
6305ce828b
fix regression in standardTargetOptions 2020-02-21 19:22:50 -05:00
Andrew Kelley
570973761a
add regression test for already fixed bug
closes #3586
2020-02-21 15:31:00 -05:00
Andrew Kelley
6aecc268fd
remove the allocator from std.event.Loop
closes #3539
2020-02-21 15:20:36 -05:00
Andrew Kelley
dff7ca6784
annotate TODO comment with bug tracker link 2020-02-21 14:20:07 -05:00
Andrew Kelley
10e0b07135
Merge pull request #4509 from ziglang/sub-architecture-annihilation
sub-architecture annihilation
2020-02-21 14:19:20 -05:00
xackus
783e8ad031 remove @bytesToSlice, @sliceToBytes from std lib 2020-02-21 19:46:53 +01:00
xackus
fdae5f5a07 implement bytesAsSlice, sliceAsBytes 2020-02-21 19:40:29 +01:00
Andrew Kelley
71573584cd
std.Target.parse gives parsing diagnostics 2020-02-21 13:34:55 -05:00
Andrew Kelley
7da7fbb912
update ARM cpu models to correctly include the sub-arch 2020-02-21 12:29:27 -05:00
Andrew Kelley
61c67a9833
remove sub-arch from stage1 2020-02-21 11:47:34 -05:00
Andrew Kelley
ab56d3e18c
fix std.Target unit tests 2020-02-21 11:07:56 -05:00
LemonBoy
8df4d7e4f4 unsure 2020-02-21 12:11:04 +01:00
Andrew Kelley
a391a82e49
fix zig build adding invalid cli args 2020-02-21 01:58:40 -05:00
Andrew Kelley
7b8b4d200c
fix not initializing some ZigTarget fields 2020-02-21 01:54:00 -05:00
Michael Dusan
770631cc79
stage1: free more heap after analysis
- immediately free dangling IrInstGenConst after analysis
- fixup mem::List params `&Allocator` → `*Allocator`
2020-02-20 21:05:37 -05:00
Andrew Kelley
2de7d0b10c
fix zig build, ABI ABI, and update tests to new Target layout 2020-02-20 18:50:20 -05:00
Andrew Kelley
903127f36c
Merge remote-tracking branch 'origin/master' into sub-architecture-annihilation 2020-02-20 18:36:04 -05:00
Andrew Kelley
0f016b368d
support -mcpu=baseline, both in stage1 and stage2
See e381a42de9 for more details.
This is set up so that if we wish to make "baseline" depend on the
OS in the future, it is possible to do that.
2020-02-20 18:31:17 -05:00
Andrew Kelley
e381a42de9
quick fix: add -mcpu=baseline support to zig0
When the build.zig logic to build libzigstage2 was converted to a cmake
command, it neglected to use baseline CPU features rather than compiling
with native features.

This adds a hard coded flag `-mcpu=baseline` which can be used to detect
the native target, but mark it as non-native so that it does not get the
CPU features specific to the host used to compile libzigstage2.

Full `-mcpu` support is happening in the upcoming pull request #4509,
and so this "quick fix" will be cleaned up in that branch, before it is
merged to master.

closes #4506
2020-02-20 17:02:29 -05:00
Andrew Kelley
b0d2ebe529 remove std.io.readLine
This was deceptive. It was always meant to be sort of a "GNU readline"
sort of thing where it provides a Command Line Interface to input text.
However that functionality did not exist and it was basically a red
herring for people trying to read line-delimited input from a stream.

In this commit the API is deleted, so that people can find the proper
API more easily.

A CLI text input abstraction would be useful but may not even need to be
in the standard library. As you can see in this commit, the guess_number
CLI game gets by just fine by using `std.fs.File.read`.
2020-02-20 15:30:00 -05:00
Andrew Kelley
33c69d5cb6
arm: clarify which CPU features are sub-architectures
versus which ones are instruction sets.
2020-02-20 15:27:42 -05:00
LemonBoy
a4d0d7f1de soldier on 2020-02-20 20:48:54 +01:00
LemonBoy
342a274948 tidy interface, const correctness 2020-02-20 20:18:51 +01:00
LemonBoy
ce2efbdca6 Correctly count all the loaded modules on Windows 2020-02-20 19:41:29 +01:00
LemonBoy
d5b583008a sudoku 2020-02-20 19:41:29 +01:00
LemonBoy
fabab58528 less hideous 2020-02-20 19:41:29 +01:00
LemonBoy
b9c02e4076 elvis entered the building 2020-02-20 19:41:29 +01:00
LemonBoy
2a350cf174 osx 2020-02-20 19:41:29 +01:00
LemonBoy
b3f728585a windows widestring 2020-02-20 19:41:29 +01:00
LemonBoy
463f704431 wide 2020-02-20 19:41:29 +01:00
LemonBoy
99649794e9 win 2020-02-20 19:41:29 +01:00
LemonBoy
b0b60cd468 tmp 2020-02-20 19:41:29 +01:00
LemonBoy
3620b67c26 debug: Split the DWARF stuff in its own file 2020-02-20 19:41:28 +01:00
Andrew Kelley
3d53a95718
Merge branch 'LemonBoy-fix-4508' 2020-02-20 12:40:11 -05:00
Andrew Kelley
ec889d5888
NO_MEDIA_IN_DEVICE => return error.NoDevice 2020-02-20 12:39:46 -05:00
Andrew Kelley
9c3eff9193
Revert "arm: clean up the messy sub-architecture & CPU features"
This reverts commit 96f45c27b6.
2020-02-20 12:18:32 -05:00
LemonBoy
ae16a6773f std: Handle NO_MEDIA_IN_DEVICE error in openFileWindows
Closes #4507
2020-02-20 13:25:45 +01:00
LemonBoy
a385547786 ir: Compile error on result_loc type mismatch w/ slicing
Closes #4508
2020-02-20 13:14:19 +01:00
Michael Dusan
c49ab049c5
Merge pull request #4511 from mikdusan/stage1-verbose-ir
stage1/ir_print: show GenConst in trailing fahsion
2020-02-20 02:48:03 -05:00
Michael Dusan
81cc52d4af
stage1/ir_print: show GenConst in trailing fahsion 2020-02-20 00:51:36 -05:00
Andrew Kelley
3c76e5e33d
update tls in std lib for lack of sub-arch 2020-02-19 22:09:35 -05:00
Andrew Kelley
7c298c8c17
fix generation of builtin import 2020-02-19 22:09:25 -05:00