Commit graph

317 commits

Author SHA1 Message Date
Tomoya Tanjo
7b4a336bf7
Fix issue 21575 - Child processes spawned by std.process.spawnProcess accidentally inherit signal masks in parent process (#7766)
Fix issue 21575 - Child processes spawned by std.process.spawnProcess accidentally inherit signal masks in parent process
merged-on-behalf-of: unknown
2021-04-19 17:58:16 +02:00
Iain Buclaw
c6c8b12852 Implement missing OpenBSD ports in phobos 2021-02-01 18:46:54 +01:00
Vladimir Panteleev
05ab29770c
std.process: Simplify error message generation on Windows
Based on #7394 and as discussed in #7726.
2020-12-17 17:43:05 +00:00
Vladimir Panteleev
5cc514835a
std.process: Improve searchPathFor
- Make @safe
- Reduce allocations
2020-12-17 17:43:05 +00:00
Vladimir Panteleev
cca9f214cc
std.process: Make isExecutable accept a range 2020-12-17 17:43:05 +00:00
Vladimir Panteleev
3b0aad98a1
std.process: Refactor environment
- Perform idup caching on all platforms (on Windows it also avoids
  eliding conversion to UTF-8)

- Make getImpl more reusable

- Reduce redundancy between get / opIndex
2020-12-17 17:43:05 +00:00
Vladimir Panteleev
de8207f62d
std.process: Remove unfixable TODO
Environment.remove cannot be @safe due to its use of the C functions
SetEnvironmentVariableW and unsetenv, and doesn't have sufficient
functionality to encapsulate the non-@safe fragments.
2020-12-17 17:43:05 +00:00
Vladimir Panteleev
cdd9824531
std.process: Remove unnecessary @trusted 2020-12-17 17:43:05 +00:00
Vladimir Panteleev
5226ec2ba3
std.process: Rename spawnProcessImpl to spawnProcessWin / Posix
Improve code clarity and remove platform-specific "overloads" with
functions with the same name but different argument lists.
2020-12-17 16:47:08 +00:00
Martin Kinkelin
7f0bd1526a std.process: Include program name in exception msg if it cannot be found
On Windows, the message for this common error case wasn't as informative
as it should be:

Failed to spawn new process (The system cannot find the file specified.)

Handle this just like on POSIX via a message like:

Executable file not found: 7z.exe

Also include the program name on POSIX if it contains a path (a dir
separator) - `Failed to execute program (No such file or directory)` =>
`Failed to execute './program' (No such file or directory)`.
2020-12-17 16:15:23 +01:00
Martin Kinkelin
fd9f853976 Fix little unittest compilability regression for iOS-derived targets
The std.process.uniqueTempPath() helper is needed for a
std.experimental.checkedint unittest.
2020-12-04 00:07:31 +01:00
Andrei Alexandrescu
9852c1ce41 Review 2020-09-21 16:11:17 -04:00
Andrei Alexandrescu
88568f7ffe Try a different syntax for echo 2020-09-21 14:01:01 -04:00
Andrei Alexandrescu
986b8202ec Use std.ascii.newline 2020-09-20 23:55:07 -04:00
Andrei Alexandrescu
c41ec6f560 Do the right thing and verify the stderr output 2020-09-20 20:13:39 -04:00
Andrei Alexandrescu
5da48602d8 Use redirection of stderr to null 2020-09-20 13:57:42 -04:00
Andrei Alexandrescu
e28ac3c61d EASY: obey the rule of silence. 2020-09-19 22:48:09 -04:00
Vladimir Panteleev
90261c1e19 Fix Issue 20984 - Heisenbug: FreeBSD64 Phobos random test suite failure in std/process 2020-08-11 19:40:59 +02:00
Vladimir Panteleev
e2fc53f405 Fix Issue 20765 - Can't run processes with relative paths when specifying a working directory
Remove the dubious check which attempted to duplicate the operating
system's behavior.
2020-08-10 20:43:45 +02:00
Geod24
04f3979317 Replace 'Issue XXX' with Bugzilla links
Make the links clickable, as was done in the DMD repository.
Also avoids any ambiguity w.r.t. where the issue is stored.
2020-04-13 16:28:09 +09:00
Jacob Carlborg
280f3fce87 Disable most of std.process on iOS derived platforms
A process does not have permission to create new processes on
iOS derived platforms.
2020-03-03 12:51:07 +01:00
Vladimir Panteleev
2b86fe1ff9
Fix Issue 20521 - Checking for and getting empty variables on Wine / XP fails
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48471
2020-01-21 15:07:43 +00:00
Alexandru Militaru
bb62aaca3d Replaced version (unittest) with version (StdUnittest) to avoid unnecessary overhead when compiling with -unittest 2020-01-19 14:05:17 +02:00
Alexandru Militaru
d3e1bb0cdb Some version (unittest) blocks removed 2020-01-06 17:53:09 +02:00
Ali Akhtarzada
ca4ac2c158 Make Pid.osHandle nogc 2019-11-23 17:02:52 +01:00
Bernhard Seckinger
97abb91952 Fix Issue 10902 - some phobos unittests take an excessive amount of time 2019-11-12 20:21:03 +01:00
Hiroki Noda
682544575f std.process: use local imports
In current phobos policy, local imports should be preferred over global
imports.
2019-08-21 09:35:00 +09:00
Hiroki Noda
c25c94bb47 std.process: add missing check for failed malloc() (#7116)
std.process: add missing check for failed malloc()
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2019-08-20 12:34:52 +02:00
Hiroki Noda
8dc81bb83f Add comment for using non async-signal-safe function 2019-07-25 09:23:24 +09:00
JinShil
3ca8d026b7 std.process.forkChild cannot be inlined 2019-06-05 22:04:56 +09:00
John Colvin
85adbf1133
core.stdc.stdlib._Exit not core.stdc.stdlib._exit 2019-02-25 17:53:59 +00:00
Nathan Sashihara
6ffd4e7f28 Replace imports of core.sys.windows.windows to speed up compilation 2018-12-17 21:03:31 -05:00
Walter Bright
f30f6b3ce1 inure against windows.d changes by casting to LPCWSTR 2018-12-04 22:56:29 -08:00
Rainer Schuetze
8f0aeedfc7 Fix issue 19275 - std.process: redirecting output in a non-console application fails
MS runtime up to VS2013 used pseudo handle _NO_CONSOLE_FILENO in that case
2018-09-29 20:37:45 +02:00
Iain Buclaw
fd5facfe04 posix.mak: Enforce whitespace before opening parenthesis for version conditions 2018-09-22 16:57:24 +02:00
Walter Bright
33cceac7ac switch Digital Mars copyright to D Language Foundation 2018-09-05 13:49:46 -07:00
Basile Burg
db819575f1 Fix issue 11959 - Set private symbols declared in version(unittest) blocks 2018-08-26 10:22:11 +02:00
Walter Bright
60a766128f process: add scope 2018-06-09 21:32:38 -07:00
Walter Bright
faf2bdf4e4 process.d: add scope 2018-06-08 13:43:17 -07:00
Sebastian Wilzbach
c324714fde Remove a few cases of underscore escaping 2018-06-04 13:05:01 +02:00
Sebastian Wilzbach
42894784dd Markdownify Phobos
$(D word) -> `word`
2018-04-02 22:32:47 +02:00
Sebastian Wilzbach
a670e31918 Remove a cast from std.process 2018-03-14 10:52:13 +01:00
Jack Stouffer
663b5b9278 Revert addition of StdUnittest 2018-02-20 13:32:32 -05:00
Sebastian Wilzbach
9eb62085c2
Merge pull request #6134 from wilzbach/enforce-2
Turn enforce into an eponymous template + undocument enforceEx
2018-02-09 15:04:34 +01:00
Mike Franklin
32c28b58ad
Fix typo in std/process.d 2018-02-09 10:53:27 +09:00
The Dlang Bot
4933e91df2
Merge pull request #6140 from wilzbach/ref1
Use REF1 macro instead of OBJECTREF
merged-on-behalf-of: Vladimir Panteleev <github@thecybershadow.net>
2018-02-08 13:18:11 +01:00
Sebastian Wilzbach
5df71793da Replace OBJECTREF with REF1 and remove redundant LREF1 2018-02-08 11:09:03 +01:00
The Dlang Bot
0a0bd956da
Merge pull request #6137 from CyberShadow/pull-20180207-123000
std.process: Get rid of goofy warning in unit test
merged-on-behalf-of: Jack Stouffer <jack@jackstouffer.com>
2018-02-07 15:34:25 +01:00
Vladimir Panteleev
3b0dd34502
std.process: Get rid of goofy warning in unit test
Refactor out the need of the warning by placing the part of the test
containing "return" statements into its own function.
2018-02-07 12:31:46 +00:00
The Dlang Bot
09122acb34
Merge pull request #6117 from wilzbach/fix-18229
Fix Issue 18229 - Misleading documentation of std.process.environment.get
merged-on-behalf-of: Vladimir Panteleev <github@thecybershadow.net>
2018-02-07 04:07:36 +01:00