Commit graph

216 commits

Author SHA1 Message Date
John Colvin
8e5d4c39c2 test inheritFDs 2016-12-17 16:19:30 +00:00
Steven Schveighoffer
43a4d2cc1e Merge pull request #4934 from John-Colvin/fix_spawn
Fix Issue 16955 - std.process.spawnProcessImpl can crash due to alloca
2016-12-11 14:12:53 -05:00
John Colvin
aec837beca Fix Issue 16955 - std.process.spawnProcessImpl can crash due to alloca 2016-12-09 16:39:09 +00:00
John Colvin
fe29c5ba51 cosmetics 2016-12-09 00:35:07 +00:00
John Colvin
bbf8f2ab59 move to infinite looping to get env var 2016-12-08 21:47:43 +00:00
John Colvin
37849e1c93 harden window get environment variables 2016-12-08 21:45:54 +00:00
Martin Nowak
ebbdf21a7e fix Issue 16580 - spawnShell segfaults on macOS
- partially Revert "Merge pull request #4493 from schveiguy/fixcycles2"
- recreate processinit (and import it from std.process)
  to call std.process shared ctor w/o creating a cycle
- keep it separate from phobosinit to not drag std.encoding
  into any binary using std.process
2016-10-04 23:56:38 +02:00
Jack Stouffer
e9316b4efd Remove package wide std.algorithm imports from std.process 2016-09-16 10:36:44 +01:00
Jonathan M Davis
5c2be71132 Move deprecations along. 2016-09-07 00:15:29 -07:00
Tony Tung
f81ddfb5e3 Properly handle the case where an environment variable is an empty string.
v.idup returns null when called on an empty but non-null array.  This is
undesirable because we want to differentiate between not-present and
empty-but-present.
2016-07-25 10:47:08 -07:00
Walter Bright
782e5399ea Merge pull request #4455 from JackStouffer/file
Remove some global imports from std.file
2016-07-08 20:26:52 -07:00
Jack Stouffer
bb13820459 [std.file] Removed global std.conv and std.path imports 2016-07-08 09:04:10 -04:00
David Nadlinger
c33f3862b7 Merge pull request #4493 from schveiguy/fixcycles2
Fix cycles in Phobos
2016-07-06 00:06:11 +01:00
Atila Neves
9861693bfb Add @system and @safe to std.process unit tests 2016-07-04 17:41:31 +02:00
Jack Stouffer
2bc85ac4a2 Removed global core.sys.posix.stdio import from std.process 2016-07-04 02:17:59 -04:00
Jack Stouffer
ecb5c4b9e6 Removed global core.stdc.errno import from std.process 2016-07-04 02:17:59 -04:00
Jack Stouffer
ed05655893 Removed global core.stdc.string import from std.process 2016-07-04 02:17:59 -04:00
Jack Stouffer
fd1afb27b2 Removed global std.exception import from std.process 2016-07-04 02:17:57 -04:00
Jack Stouffer
703566e28e Removed global std.path import from std.process 2016-07-03 16:07:45 -04:00
Jack Stouffer
1aa7eee00a Removed global std.conv import from std.process 2016-07-03 16:04:21 -04:00
Jack Stouffer
687c07e323 Fixed local imports in std.process 2016-07-01 12:27:31 -04:00
Steven Schveighoffer
df168487fc Fix cycles in Phobos 2016-06-28 15:00:01 -04:00
Sebastian Wilzbach
ec47ac4224 Remove the WEB macro in favor of HTTP
replacement: sed 's/\$(WEB/\$(HTTP/g' -i **/*.d
2016-06-16 00:14:51 +02:00
anonymous
7b6745727b Ddoc: CXREF -> REF (sed)
Done by:

arg='\s*([^(),]*)'
from='\$\(CXREF\s'$arg','$arg'\)'
to='$(REF \2, core,\1)'
(find . -type f -name "*.d" -print0; \
    find . -type f -name "*.dd" -print0) | \
xargs -0 sed -i -r "s/$from/$to/g"
2016-06-08 00:22:03 +02:00
Sebastian Wilzbach
2dfbc51f17 Standardize whitespace after imports
Unified with:

sed -E "s/import\s*([^ ]+)\s*:\s*(.*(,|;))/import \1 : \2/" -i **/*.d
2016-05-29 22:09:56 +02:00
anonymous
764caefa36 XREF -> REF (sed)
Done by:

(find . -type f -name "*.d" -print0; \
    find . -type f -name "*.dd" -print0) | \
xargs -0 sed -i -r \
    's/\$\(XREF\s+([^(),]*),\s*([^(),]*)\)/$(REF \2, std,\1)/g'
2016-05-27 21:32:46 +02:00
Vladimir Panteleev
cae4923372 Merge pull request #4369 from wilzbach/deprecate_wiki
remove the deprecated wiki macros
2016-05-27 08:19:55 +03:00
Sebastian Wilzbach
18b8abf60a remove the deprecated wiki macros 2016-05-27 05:52:23 +02:00
Robert Schadek
0d33ee0706 Merge pull request #4298 from CyberShadow/fork-nogc
std.process: Enforce nothrow/@nogc in forks
2016-05-26 19:02:13 +02:00
H. S. Teoh
eb3d9d24f4 Merge pull request #4305 from CyberShadow/pull-20160510-183209
std.process: Disambiguate fork call on OS X
2016-05-10 20:13:03 -07:00
Vladimir Panteleev
b7f0a17300 std.process: Disambiguate fork call on OS X 2016-05-11 01:54:29 +00:00
Vladimir Panteleev
3636733dcc Merge pull request #4299 from JackStouffer/patch-6
Prepare for long line checks in travis
2016-05-11 04:36:15 +03:00
Jack Stouffer
57c58b3b33 Fixed long lines in std/process.d 2016-05-10 20:51:39 -04:00
Vladimir Panteleev
def01a9021 std.process: Disambiguate fork calls 2016-05-10 18:32:13 +00:00
Vladimir Panteleev
7eae1b9a38 std.process: Enforce nothrow/@nogc in forks
Also fix erroneous usage of errnoEnforce in fork.
2016-05-10 14:38:20 +00:00
Sebastian Wilzbach
d1714c9afb minor style fixes 2016-04-27 04:18:22 +03:00
Sebastian Wilzbach
3d67cd228c style fix: space between operators 2016-04-26 22:26:20 +03:00
Matt Kline
bed2df7e80 Avoid brute force fd close() on Linux
The current Posix implementation of spawnProcess calls close on
every fd from 3 to the max fd count (as gathered by rlimit()).
Given that the process doesn't have that many descriptors open
in the *vast* majority of cases, this is quite pessimal.

Instead, use poll() to see which descriptors are actually open,
and close those.
2016-04-04 08:42:17 -07:00
Walter Bright
e9385287c8 browse() should take const(char)[] parameter 2016-03-26 02:35:00 -07:00
H. S. Teoh
5c53be7676 Merge pull request #3977 from joakim-noah/android
Android update
2016-02-23 13:51:42 -08:00
Martin Nowak
ce2ac192c9 fix incorrect imports/fqn usages
- mostly of the form `import a.b : sym; a.b.sym();`, which is wrong b/c
  selective imports do not add the module to the current scope
2016-02-20 14:41:44 +01:00
Akihiro Shoji
2d9415dea8 Fix Document of process.d with pipe
Current document says:
```d
auto p = pipe();
p.writeEnd.writeln("Hello World");
assert (p.readEnd.readln().chomp() == "Hello World");
```

This means that buffer is yet to be flushed.
Therefore `p.readEnd.readln` can't recieve the input, for readln waits forever if the buffer is not flushed.
Then I fixed as follow:
```d
auto p = pipe();
p.writeEnd.writeln("Hello World");
p.writeEnd.flush();
assert (p.readEnd.readln().chomp() == "Hello World");
```
2016-02-15 15:28:18 +09:00
Lars T. Kyllingstad
50e3fc6b74 Merge pull request #3989 from WalterBright/zipprocess
fix problems that prevent implementing import shadowing protection
2016-02-12 08:45:46 +01:00
Walter Bright
8e6faa560f fix problems that prevent implementing import shadowing protection 2016-02-11 22:38:53 -08:00
Joakim
10c01a0614 On Android, update std.datetime to extract timezone data and some other fixes. 2016-02-10 14:25:42 +05:30
Shriramana Sharma
5978ca7831 migrate other Phobos modules to use std.exception.basicExceptionCtors 2016-01-17 10:39:37 +05:30
Mark Isaacson
963f7e4170 Issue 15276: Allow users to specify shell for executeShell, pipeShell, spawnShell
This diff: This diff makes it possible to specify your preferred shell for the various `*shell` functions in `std.process`. By default it uses the new `nativeShell` function. `nativeShell` to always returns the native system shell (see the "some history" section for why this is the default value). I chose to create `nativeShell` rather than changeing `userShell` because I think it is still valuable to have something like `userShell` around in Phobos.

The one part of this diff I'm not super thrilled by is the use of variadic arguments (easier to see than to explain); if you have a suggestion for something better I'd love to hear it :).

Note: The default shell is a breaking change for Windows, which probably *should have* been broken same as posix in the diffs listed in the history section below, but I suspect was overlooked. Find rationale behind making a breaking change at all here: https://issues.dlang.org/show_bug.cgi?id=15000.

Some history:
a524a3571b
and
f537cb50b5

Tried to move us from a world where we preferred the shell specified in the SHELL environment variable to a world where we always went with the native system shell, /bin/sh for posix. The former of those revisions was reverted in:
5b2b1fb594
Because the documentation was not updated to reflect the change.

Presently: we are in a state of schism, whereby `userShell` has behavior that does not align with what is actually used in `executeShell`, `pipeShell`, and `spawnShell`. This is something we *must* resolve.

Personal pain: This bit me when one of my scripts at work stopped working because it dependend on features that don't exist in `sh` (but do in `bash`, `zsh`, etc). It was really frustrating that there was no simple way to work around this and specify my preferred shell; it is, of course, possible to leverage the various `escape*` functions from `std.process` and `spawnProcess` to use whichever shell I prefer, but this seems like something warranting first class support. I was sad to not have something like this after a breaking change.
2016-01-05 16:46:47 -08:00
Benjamin L. Merritt
5f08c058ab Changed "Examples:" in Ddoc to "Example:" 2015-12-17 18:32:41 -08:00
k-hara
e864e53adc fix property enforcement 2015-12-04 15:42:53 +09:00
Brian Schott
c5c87895a8 Merge pull request #3716 from CyberShadow/pull-20151014-040843
Remove declarations already declared by the new Windows headers
2015-10-16 22:00:44 -07:00