1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
Commit Graph

802 Commits

Author SHA1 Message Date
Delyan Angelov
fa6f7d4c83
os: add os.quoted_path/1, use it consistently for running V itself 2022-01-22 21:13:28 +02:00
playX
7fe62a8b3e
js,os: fix return in or blocks; Properly get path_delimiter and path_separator in JS (#13179) 2022-01-15 09:55:03 +02:00
Larpon
7fbd856bf8
os: add font module, move from gg (#13144) 2022-01-13 12:16:18 +02:00
Larpon
17911432b9
android: fix and test compilation to raw Android C code (#13080) 2022-01-07 16:57:05 +02:00
jeffmikels
a60b381d5e
docs: adding skeleton README.md files for all vlib modules (#13034) 2022-01-05 18:06:08 +02:00
Alexander Medvednikov
59ed4be49a all: update copyright year 2022-01-04 12:21:12 +03:00
playX
a2468e1e0c
js,os: fix integer arithmetic; add Process.close() and os.is_readable() for VJS; Make tetris run on JS backend (#12940) 2021-12-23 11:36:42 +02:00
playX
5f0160bf11
js,gg: more work on porting gg to JS backend (#12903) 2021-12-20 16:18:21 +03:00
playX
cb4c67588c
os: add support for signal handling on JS backend (#12818) 2021-12-13 20:18:12 +02:00
playX
0da7e2f8ab
js: make vlib/v/util compile on JS backend (#12660) 2021-12-03 12:25:36 +02:00
Delyan Angelov
5e8288528a
ci: fix v -b js vlib/builtin/js/array_test.js.v 2021-11-22 15:11:33 +02:00
Delyan Angelov
6a252ed015
os: implement a JS version of os.join_path_single too 2021-11-22 15:03:05 +02:00
Delyan Angelov
7a0dc60d04
os: re-add the leak in os.join_path (the os.join_path(x, ...arr) case should be handled by V). Add a memleak free os.join_path_single version. 2021-11-22 14:40:55 +02:00
Delyan Angelov
c3b8e5e181 ci: fix compilation on FreeBSD 2021-11-22 09:32:13 +00:00
Delyan Angelov
84aa05f8fb
ci: fix macos build 2021-11-22 11:07:26 +02:00
Delyan Angelov
fe48380e85
os: cleanup; ci: fix a segfault in the tcc32 job when calling pref.vexe_path() -> os.real_path(os.executable()) 2021-11-22 10:32:10 +02:00
Delyan Angelov
e77a11001e
os: make init_os_args_wide (windows), more simillar to the current init_os_args (unix) 2021-11-21 23:04:30 +02:00
Delyan Angelov
c7bd74e0f8
ci: fix build, remove [manualfree] from os.vmodules_paths for now 2021-11-21 22:34:38 +02:00
Delyan Angelov
1aaac13a60
cgen: make os less special, fix an -autofree leak on just import os
* Improve documentation of v.util.Surrounder

* Remove `os` from the list of "no auto free" `builtin` mods

* Fix -autofree freeing of `const x = []string{}`.

* Add a valgrind regression test.

* Implement os.getenv_opt in vlib/os/environment.js.v too.
2021-11-21 21:50:10 +02:00
Delyan Angelov
24ffc1ffb2
os: fix os.rmdir_all for folders with recursive symlinks 2021-11-20 10:28:12 +02:00
Delyan Angelov
762a7fde2a
os: add os.getenv_opt/1 2021-11-19 17:47:45 +02:00
Delyan Angelov
50a608aab3
os: remove unnecessary heap allocation from os.execute 2021-11-12 11:45:37 +02:00
Delyan Angelov
c6b8b0bb0a
ci: make test_execute in os_test.v more robust 2021-11-12 11:24:37 +02:00
Delyan Angelov
fcecf527ec
ci: fix failing os_test.v on the CI 2021-11-12 10:27:35 +02:00
Delyan Angelov
20d63de136
os: fix os.execute for command output that contains 0 bytes 2021-11-12 09:39:15 +02:00
Delyan Angelov
d1acca3e52
ci: fix ./v -cg -cstrict -o v cmd/v job failures for clang 2021-10-29 17:21:53 +03:00
Delyan Angelov
71392111f8
ci: fix cross compilation of vc/v.c 2021-10-29 17:12:05 +03:00
Delyan Angelov
b86c79329b
os, builtin: reduce leaks without -autofree 2021-10-29 15:49:30 +03:00
Delyan Angelov
bb71089b70
os: make the os_test.v functions more robust on windows (normalise the returned paths before comparing them) 2021-10-24 19:54:00 +03:00
Delyan Angelov
e99b699ac6
os: make os.mkdir_all more robust (honor / on windows too), add a test for it 2021-10-24 19:16:46 +03:00
Delyan Angelov
f34daf9ff4
os: add os.walk_with_context/3 and a test for it 2021-10-24 19:12:14 +03:00
Delyan Angelov
e34046a0e1
os: remove pub from impl_walk_ext 2021-10-24 18:48:54 +03:00
Delyan Angelov
d1c4b470bc
os: make os.ls('') return an error, make os.walk_ext more memory efficient on deep hierarchies, add tests for os.walk_ext 2021-10-24 18:44:13 +03:00
playX
864d6eae6b
js: codegen & vlib fixes, replace the Game of Life CLI example (#12272) 2021-10-22 22:03:19 +03:00
Delyan Angelov
eed94c727c
os: move C struct declarations in their own _default.c.v files (#12268) 2021-10-22 17:08:08 +03:00
czkz
5607224be6
docs: improve os.ProcessState markdown rendering (#12245) 2021-10-21 11:19:01 +03:00
playX
57c79770b3
js: port more methods (os, builtin) (#12238) 2021-10-20 16:02:21 +03:00
playX
c1aa782a6c
js,checker: fix some modules build for v -b js self, fix or block check in ast.CallExpr (#12231) 2021-10-19 12:11:54 +03:00
playX
d373eba79b
js: implement more functions for JS backend (#12167) 2021-10-13 09:40:14 +03:00
Alexander Ivanov
0386f2bbea
checker: add an interface check for mutability, fixes #1081, fixes #7038 (#11963) 2021-10-11 15:41:31 +03:00
Delyan Angelov
5bc8b4dadb
os: implement support for VOPEN_URI_CMD env override for os.open_uri 2021-10-06 06:33:04 +03:00
Delyan Angelov
514443a019
ci: comment out a failing assert in the tests for os.notify 2021-10-05 16:01:54 +03:00
Delyan Angelov
eef8017281
ci: reduce flakyness of notify_test.v, by re-trying it 3 times 2021-10-05 15:50:38 +03:00
Delyan Angelov
bfb8116623
ci: let process_test.v repeatedly fail 3 times, before consider it failed 2021-10-03 20:26:38 +03:00
Larpon
b62520af9e
os: fix rare crash in read_file. Fix #12052 (#12053) 2021-10-03 18:24:06 +03:00
Nicolas Sauzede
117091452b
os: workaround _ = C.pipe(&pipeset[0]) gcc warning warning: ignoring return value of pipe declared with attribute warn_unused_result (#12046) 2021-10-03 08:09:08 +03:00
Delyan Angelov
7bd145d88a
os,net: cleanup deprecated @VROOT usages 2021-09-19 16:24:24 +03:00
Delyan Angelov
eec930b86a
os: turn some panics into return error() 2021-09-18 10:45:04 +03:00
czkz
816c6c62b5
os: fix documentation typo in args.v (#11526) 2021-09-17 20:55:16 +03:00
playX
c175b4fd48
v.gen.js: refactor code, fix alias codegen, -stats now again works with tests on the JS backend (#11512) 2021-09-16 14:00:15 +03:00
Enzo
e57b068df0
os: add open_uri/1, use it in v bug (#11450) 2021-09-09 10:48:53 +03:00
playX
72089c4feb
js: use prefixed names for functions and global symbols (#11387) 2021-09-08 20:30:46 +03:00
yuyi
e5360e164a
fmt: remove unnecessary parentheses after return (fix #11423) (#11435) 2021-09-08 14:19:53 +03:00
Enzo
e3b65092d6
parser: deprecate size_t (#11443) 2021-09-08 13:09:32 +03:00
Delyan Angelov
166dd61e90
Revert "Revert "term: obtain the cursor position via termios.h (#11372)""
This reverts commit 0376cbf6bd.
2021-09-06 19:04:14 +03:00
Alexander Medvednikov
0376cbf6bd Revert "term: obtain the cursor position via termios.h (#11372)"
This reverts commit af28d09630.
2021-09-06 18:21:55 +03:00
AAAA
af28d09630
term: obtain the cursor position via termios.h (#11372) 2021-09-06 17:24:39 +03:00
Larpon
bd33eaa3b8
os: add function to expand "~" to home directory (#11362) 2021-09-01 16:32:28 +03:00
Alexander Medvednikov
cf4081e2dd all: more chdir/chmod fixes 2021-08-28 12:52:48 +03:00
Alexander Medvednikov
f731060caf all: update chmod/chdir usages 2021-08-28 10:23:01 +03:00
Alexander Medvednikov
853d3cb83e os: make chmod() return error 2021-08-28 09:37:24 +03:00
Alexander Medvednikov
858ba25d55 os: make chdir() return error 2021-08-28 09:35:39 +03:00
playX
bdf11d969a
js: add basic support for running tests, fix string.replace_each (#11314) 2021-08-26 15:20:54 +03:00
Delyan Angelov
db194abeac os: merge os.c.v and os_c.c.v 2021-08-26 10:01:55 +03:00
playX
109d5d5847
js: os now compiles to the JS backend, more builtins & minor codegen fixes (#11302) 2021-08-25 14:40:53 +03:00
playX
d78e7e3b2b
js: codegen fixes, W.I.P os availability for JS backend (#11281) 2021-08-23 14:25:02 +03:00
div72
2bf1015ae1
os: add File.read_into_ptr (#11219) 2021-08-18 17:08:41 +03:00
pancake
90b25e7a4b
os: filesystem level locking api (#11191) 2021-08-17 08:21:33 +03:00
Delyan Angelov
8fbd8f790d
os: cleanup for -Wimpure-v 2021-08-12 21:53:29 +03:00
Enzo
506c30a291
builtin: remove methods that can be autogenerated (#11109) 2021-08-09 15:42:31 +03:00
Delyan Angelov
efa8dcf4d2
time: turn Time.unix to i64, so it can represent times before 1970-01-01, fix time operators, add more tests (#11050) 2021-08-04 13:12:02 +03:00
pancake
00d4c7082e
native: add support for print, eprint and eprintln (#11034) 2021-08-03 16:04:31 +03:00
Delyan Angelov
d82d41d804
os: fix os.dir, os.base, os.file_name, when the argument contains / on windows 2021-07-31 13:52:54 +03:00
Delyan Angelov
44892fd942
os: let os.dir("/xyz") return "/" (fixes compiling .v files in /) 2021-07-30 03:28:53 +03:00
Delyan Angelov
8eb544146e
os: fix building V on Haiku 2021-07-27 20:28:04 +03:00
Delyan Angelov
44828cbb29
ci: fix -cstrict job 2021-07-22 18:47:23 +03:00
Delyan Angelov
b537c9f624 tests: add a separate File.tell() test 2021-07-22 16:25:23 +03:00
Delyan Angelov
c4da74dbf6 ci: fix building V on windows with tcc (regression since d7dcb47) 2021-07-22 14:50:22 +03:00
Delyan Angelov
9171c1131e
ci: skip a failing f.tell() test on macos only 2021-07-22 13:28:00 +03:00
Delyan Angelov
ec585b4a54
os: fix sporadic failing glob_test.v 2021-07-22 13:26:23 +03:00
Bastian Buck
8f3646cb81
os: fix debugger_present for solaris (#10902)
-solaris has no `sys/ptrace.h`, instead `ptrace` is included in  `sys/types.h` and `unistd.h`
2021-07-22 10:44:00 +03:00
Delyan Angelov
d7dcb47db3
os: implement File.seek/2 and File.tell/0 2021-07-22 08:00:21 +03:00
Delyan Angelov
5098334e65
os: add execute_or_exit(cmd), use it consistently instead of execute_or_panic(cmd) 2021-07-20 15:22:04 +03:00
Delyan Angelov
1bf6743987
vinix: support -os vinix (part 2) 2021-07-13 11:41:45 +03:00
pancake
fe65cde03b
tools: use os.symlink instead of system('ln -s') in v symlink (#10769) 2021-07-12 14:23:25 +03:00
waspoza
075e09b10e
os: fix a file descriptor leak in os.read_bytes() (#10723) 2021-07-09 23:49:46 +03:00
pancake
47bf64473c
vlib: reimplement glob in V for UNIX to not depend on libc (#10707) 2021-07-09 03:27:16 +03:00
Delyan Angelov
7b4c342396
os: disable os.glob() on Android for now (fixes termux compilation) 2021-07-08 00:00:40 +03:00
yuyi
c4b5805890
checker: check generic method call args mismatch (#10669) 2021-07-05 10:14:00 +03:00
Delyan Angelov
972542d6ee
checker: [noreturn] part 2 (cleanup) (#10667) 2021-07-05 05:05:37 +03:00
shadowninja55
da9c75f2ca
checker: string != IError (#10665) 2021-07-05 05:05:08 +03:00
Daniel Däschle
3881e97a40
vlib: remove ustring usage (#10618) 2021-06-30 22:30:28 +03:00
Bastian Buck
8cc49b5e9e
os: add utime() (#9796) 2021-06-30 10:21:23 +03:00
Bastian Buck
d2f19ac494
os: add a glob() function (#10497) 2021-06-30 08:30:18 +03:00
Bastian Buck
97b83a4986
os: add debugger_present() for linux (#10257) 2021-06-29 15:00:48 +03:00
Delyan Angelov
6890756cd2
os: cleanup of old deprecated functions. Add File.write_full_buffer/2; use it in os.write_file/2 2021-06-25 22:51:59 +03:00
Uwe Krüger
72358833e0
time: use Duration(C.INT64_MAX) as infinite (#10539) 2021-06-22 12:17:44 +03:00
Bastian Buck
1e9e717111
os: fix using Win32-API with TCC32 (#10496) 2021-06-21 14:14:58 +03:00
Bastian Buck
acf9d168cb
os: fix some C compiler warnings for windows (#10506) 2021-06-18 20:07:25 +03:00
Delyan Angelov
b7fea87d07
os: fix normalize_drive_letter (used by os.real_path) returning a parameter 2021-06-18 13:06:52 +03:00
Miccah
a0b7e1a0ca
os/notify: make epoll wrapper thread safe (#10473) 2021-06-16 04:03:33 +03:00
Uwe Krüger
60c880a0cc
vlib: use malloc_noscan() where possible (#10465) 2021-06-15 14:47:11 +03:00
Delyan Angelov
48b3ab831b
ci: fix failing test test_realpath_existing for os.real_path on macos 2021-06-15 14:13:12 +03:00
Delyan Angelov
0c922f5570
ci: fix the failing os.real_path tests on windows 2021-06-15 13:34:28 +03:00
Delyan Angelov
51596da314
os: fix returning parameter in [manualfree]os.real_path(fpath), when fpath=="" 2021-06-15 13:10:41 +03:00
Miccah
e328b1d292
os: create epoll wrapper (#10404) 2021-06-15 04:44:31 +03:00
Emily Hudson
535dcac8fa
net: ipv6 support, merge unix+ip;[pack:x] attribute (#9904) 2021-06-13 23:53:38 +03:00
Andreas Heissenberger
96c8d147b2
v.gen.js: add source map creation support (inline only, no src) (#10384) 2021-06-10 08:33:46 +03:00
Delyan Angelov
95cf120e2e
ci: fix linux-cross job; os.real_path cleanup 2021-06-08 18:34:15 +03:00
Delyan Angelov
d820f2da6f
os: use arr.trim() in read_bytes, instead of a arr[0..x].clone() 2021-06-08 17:24:07 +03:00
Delyan Angelov
4772146a7e tests: fix failing tests on M1 2021-06-07 18:23:18 +03:00
Bastian Buck
d6e462a6ca
os: fix os.is_link and os.symlink on windows, add new functions os.getppid, os.getgid, os.getegid (#10251) 2021-05-29 23:26:13 +03:00
Uwe Krüger
2d8a136d6e
os: fix file read (#10247) 2021-05-29 16:53:42 +03:00
Delyan Angelov
bf97faf32a
os: simplify os.read_bytes_into_newline to fix compilation on freebsd 2021-05-22 07:48:12 +03:00
Delyan Angelov
b7bf4b034e
os: use stricter declarations for C.getc/1, C.fseeko/3 and C._fseeki64/3 2021-05-22 07:45:00 +03:00
Sebastian Schicho
04ea2824d3
os: implement File.read_bytes_into_newline method for reading into a buffer, line by line (#10129) 2021-05-21 13:18:08 +03:00
Alexander Medvednikov
f09a5135e9 checker: handle builtin enum init correctly 2021-05-20 03:14:32 +03:00
Delyan Angelov
453fb1b08b
term.ui: use os.signal_opt instead of os.signal 2021-05-18 11:59:57 +03:00
Delyan Angelov
21b34b3a0b
ci: bump up the deprecation date of os.signal to 2021-06-18 2021-05-18 11:06:00 +03:00
Leigh McCulloch
49deeac71e
os: fix file read end-of-file detection (#10070) 2021-05-13 09:48:55 +03:00
kevin70g
e9c84ce154
os: fix is_abs_path() panic, when path is only one letter on windows (#10071) 2021-05-10 10:01:32 +03:00
Delyan Angelov
4728d102d9
os: add Process.finalise() and Process.free() methods to cleanup pipe descriptors 2021-05-09 21:50:47 +03:00
Delyan Angelov
38d16229ef
os: fix panic on os.is_abs_path('') 2021-05-09 10:45:34 +03:00
Enzo
4ac751d773
os: add signal_opt and deprecate signal (#10005) 2021-05-05 15:39:02 +03:00
Miccah
12c3f85507
os: add getuid and geteuid (#10002) 2021-05-05 14:20:11 +03:00
Delyan Angelov
298fc533e4
ci: run v fmt -w vlib/os/file.c.v 2021-05-04 08:40:27 +03:00
Leigh McCulloch
0fa9a648ae
os: add os.stdout() and os.stderr(), returning os.File, similarly to os.stdin() (#9990) 2021-05-03 19:00:51 +03:00
Leigh McCulloch
4ba11b7752
os: deprecate os.open_stdin in favor of os.stdin (#9989) 2021-05-03 18:57:21 +03:00
Enzo
fb7ddcd4c9
checker: fix looking for unprefixed os functions (#9968) 2021-05-02 21:46:12 +03:00
Uwe Krüger
787a63dab6
cgen: execute defer block *after* return expression is evaluated (#9893) 2021-04-27 01:42:16 +03:00
Bastian Buck
160b605640
os: use C.GetUserNameW for os.loginname() instead + improvements os.uname() (#9872) 2021-04-25 18:16:14 +03:00
Alexander Medvednikov
7f5c3cc1f8 checker: do not allow modifying consts via mutable refs 2021-04-24 14:08:50 +03:00
Delyan Angelov
b506d8fcc0
os: use C.getlogin for os.loginname, instead of C.getlogin_r (C.getlogin_r absent on Android) 2021-04-24 13:33:34 +03:00
Marcos Diaz
187895c93c
os: use GetComputerNameW to retrieve hostname on Windows (#9861) 2021-04-24 13:22:04 +03:00
Alexander Medvednikov
c7a6d28e13 all: improve unused variable warning (fix x = 1, x += 1 etc) 2021-04-23 13:33:48 +03:00
Delyan Angelov
59e23dbb57
ci: re-enable testing of ./v -freestanding run vlib/os/bare/bare_example_linux.v on ubuntu 2021-04-22 12:50:56 +03:00
zakuro
7443179cc8
checker: make use of private enum from outside module an error. (#9821) 2021-04-22 07:07:56 +03:00
Nicolas Sauzede
258be508f4
builtin,os: fix unused return C warnings for real (#9814) 2021-04-20 17:28:58 +03:00
Bastian Buck
9ec91f4d58
os: add new function os.loginname(), improve some error messages (#9794) 2021-04-19 14:57:25 +03:00
Bastian Buck
515d8c0bc8
os: remove unnecessary check (#9722) (#9773) 2021-04-17 02:37:57 +03:00
Bastian Buck
aa49bc2708
os: implement os.truncate() + improve error handling (#9752) 2021-04-16 11:53:44 +03:00
Bastian Buck
546dc91967
os: create os.hostname() and os.chown() + os.uname() for windows (#9722) 2021-04-15 01:49:05 +02:00
crthpl
14434cc86a
all: bare metal support (fix -freestanding) (#9624) 2021-04-14 07:50:50 +02:00
Lukas Neubert
ada763e0f4
fmt: remove parenthesis around single ident (#9696) 2021-04-12 16:01:03 +03:00
Henrixounez
7ba13a415a
os: handle fread errors (#9687) 2021-04-12 10:26:08 +03:00
Lukas Neubert
1d5ed89138
fmt: remove trailing space in comments (#9620) 2021-04-07 15:25:11 +02:00
Delyan Angelov
db84d5e221
os: cleanup os.environ implementation 2021-04-06 18:02:12 +03:00
Delyan Angelov
d8cb24eef0 ci: fix -cflags -Werror jobs 2021-04-05 23:42:26 +03:00
Delyan Angelov
19b915b105 ci: fix windows-tcc job 2021-04-05 23:35:22 +03:00
Delyan Angelov
10619d098c
ci: fix a race in vlib/v/compiler_errors_test.v execution on m1 2021-04-05 22:57:59 +03:00