All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Env
will now manage$PWD
and$OLDPWD
whenever the current working directory is changed- Added
Read
/Write
impls for&EventedFileDesc
- Added the
FileDescOpener
trait for abstracting over opening files/pipes through the environment - Added the
FileDescManager
trait to encompass opening file descriptors, managing their permissions, and performing async I/O over them - Added
PlatformSpecificFileDescManagerEnv
environment and an atomic counterpart as a successor toPlatformSpecificAsyncIoEnv
- Added inherent methods on
ThreadPoolAsyncIoEnv
for anyAsyncIoEnvironment
related operations for more efficient operations which do not require ownedFileDesc
handles as long as the provided input can be borrowed as aFileDesc
- Added the
ReportFailureEnvironment
trait for reporting arbitraryFail
types - Added the
BuiltinEnvironment
andBuiltinUtility
traits for spawning builtin utilities - Added
BuiltinEnv
as which is aBuiltinEnvironment
implementation which supports all provided builtin utilities definitions - Added
simple_command_with_restorers
function which allows spawning a simple command with the specified redirect and var restorers - Added
FunctionFrameEnvironment
trait for tracking the stack size of currently executing functions.
- Breaking: Instantiating an
Env
now requires itsWD
parameter to implementWorkingDirectoryEnvironment
for managing the$PWD
and$OLDPWD
environment variables - Breaking: The
WorkingDirectoryEnvironment
implementation ofEnv
now requires that it also implementsVariableEnvironment
for managing the$PWD
and$OLDPWD
environment variables - Breaking: Corrected the signature of
VarRestorer::set_exported_var
to match that ofVarRestorer2::set_exported_var
- Breaking: Corrected
EvalRedirectOrVarAssig
to handle earlier assignment references by using the implementation ofEvalRedirectOrVarAssig2
- Breaking: Bumped dependency of
winapi
to0.3.4
- Breaking: Improved debug printing of
spawn::Simple
after requiring a few additional generic parameters to implementDebug
- Breaking:
AsyncIoEnvironment
must now specify an associated typeIoHandle
for what file handle it accepts, thus it is no longer forced to operate with aFileDesc
- Breaking:
AsyncIoEnvironment
now returns anio::Result
when creating an async read/write adapter over a file handle, instead of surfacing the error at the first interaction with the new handle - Breaking:
Env
now delegates file descriptor management to a single type instead of separate file descriptor mapper, async I/O environment, etc. - Breaking:
Env
can now delegate to aBuiltinEnvironment
implementation - Breaking: The
FileDescWrapper
trait now represents anything that can be unwrapped into an ownedFileDesc
instead of anything that can be cloned and borrowed as aFileDesc
- Breaking: EventedAsyncIoEnv has been rewritten to yield opaque file handles
- Breaking: Changing the blocking/nonblocking state of a
FileDesc
now requires a mutable reference - Breaking:
IsFatalError
now requires the implementor to also implementfailure::Fail
instead ofstd::error::Error
- Breaking: All previous consumers of
ReportErrorEnvironment
now requireReportFailureEnvironment
implementations instead - Breaking: All error types now implement
Fail
instead ofError
. UseFail::compat
to get back anError
implementation. - Breaking:
ExecutableEnvironment
no longer enforces thatSelf::Future = CommandError
which gives implementors the flexibility to use their own error types. - Breaking: Spawning a simple command now requires that errors arising from
executing commands implement
Fail
- Breaking:
ExecutorEnvironment::Future
has been renamed toExecFuture
- Breaking:
ExecutorEnvironment
is now implemented for all&mut T
whereT: ExecutableEnvironment
- Breaking:
SimpleCommand
now supports spawning builtin utilities, (but requires that the environment supportSpawn
able builtins) - Breaking:
Sequence
now requires the environment to implementIsInteractiveEnvironment
to avoid situations where it blocks waiting for input which is not yet available - Breaking:
Function
now keeps track of the current function stack size and now requires that the environment implementFunctionFrameEnvironment
- Subsequently, other combinators such as
Subshell
,If
,Case
,Substitution
andParameterSubstitution
also require the additional bound forIsInteractiveEnvironment
- Breaking: the
shift
builtin command's spawnedFuture
has been changed to potentially write an error message, and is no longer just a simpleExitStatus
. SimpleCommand
is now generic over the redirect and var restorers it is given. These generic parameters will default toRedirectRestorer
andVarRestorer
to remain backwards compatible (which was effectively the previous behavior as well).RuntimeError
now implementsFrom<void::Void>
to satisfy type conversions- Builtin commands now print out their error messages as part of their execution instead of requiring the environment to report it
EventedFileDesc
no longer attempts to reregister a file descriptor into the event loop if the originalregister
call returnsErrorKind::AlreadyExists
- Fixed building on latest nightlies
0.1.5 - 2018-09-22
- The
Pipeline
future now avoids reallocating memory during eachpoll
, and instead reuses a scratch buffer which is allocated once for the lifetime of the future.
- Tests now avoid the "ambiguous macro name" error, and can build on 1.30
- Deprecated
FileDescExt::into_evented2
, renamed toFileDescExt::into_evented
- Deprecated
VarRestorer2
sinceVarRestorer
has been corrected and the two traits now behave identically - Deprecated
EvalRedirectOrVarAssig2
since it is now an alias forEvalRedirectOrVarAssig
- Breaking: Removed the previous version of
FileDescExt::into_evented
and replaced it with the signature ofFileDescExt::into_evented2
- Breaking: Removed deprecated
RedirectEnvRestorer
methods - Breaking: Removed deprecated
VarRestorer
methods - Breaking: Removed deprecated
eval_redirects_or_var_assignments
andeval_redirects_or_var_assignments_with_restorer
functions - Breaking: Removed
PlatformSpecificAsyncIoEnv
,PlatformSpecificRead
, andPlatformSpecificWriteAll
as they are superceded by the newPlatformSpecificFileDescManagerEnv
- Breaking: Removed the
ReportErrorEnvironment
trait, as it is superceded by theReportFailureEnvironment
trait
0.1.4 - 2018-01-27
- Removed usage of nightly features on Windows. Windows builds now work on stable!
0.1.3 - 2018-01-25
- Fixed nightly windows builds by updating the unstable feature
unique
toptr_internals
0.1.2 - 2018-01-03
- Added a
EvalRedirectOrVarAssig2
implementation which behaves similar to its predecessor, except it applies variables directly into the environment and provide aVarRestorer
when finished - Added
eval_redirects_or_var_assignments_with_restorers
which allows evaluating anyRedirectOrVarAssig
with a specifiedRedirectEnvRestorer
andVarEnvRestorer
instances - Added
VarEnvRestorer2
trait as a correction to theVarEnvRestorer
interface in a backwards compatible manner. - Added
ShiftArgumentsEnvironment
as an interface for shifting positional arguments. - Added a
spawn::builtin
module for hosting shell-builtin command implementations - Added a builtin implementations for the following shell commands:
shift
:
true
false
cd
pwd
echo
- Added a
NormalizedPath
wrapper for working with logically or physically normalized paths - Added builder-like methods to
EnvConfig
to facilitate replacing the type of any environment implementation without having to specify all other values again - Added
FileDescExt::into_evented2
which gracefully handles regular files (which cannot be registered with tokio) - Added a
spawn::function_body
method for spawning a function without having to look it up from the environment
- Reduced required bounds for implementing
VarEnvRestorer
to justE: VariableEnvironment
- Spawning a simple command now (more) correctly evaluates variable assignments where one
assignment depends on an earlier one (e.g.
var1=foo var2=${bar:-$var1} env
) - Removed aggressive redirect restorer pre-allocations when evaluating redirects: most shell scripts will not apply redirects to the majority of commands, nor will they have obscene amounts of redirects when they do occur, so we can avoid allocating memory until we really need it.
- Deprecated
eval_redirects_or_var_assignments
,eval_redirects_or_cmd_words_with_restorer
andEvalRedirectOrVarAssig
: the existing implementation does not handle referencing earlier variable assignments (e.g.var1=foo var2=${bar:-$var1} env
) but cannot be ammended without introducing breaking changes - Deprecated
FileDescExt::into_evented
since it does not handle regular files gracefully
EventedAsyncIoEnv
gracefully handles regular files by not registering them with tokio (since epoll/kqueue do not support registering regular files)- Fixed the behavior of an unset
$PATH
variable to behave like other shells (i.e. raises command not found errors) instead of using thePATH
env variable of the current process
0.1.1 - 2017-09-13
- Added
RedirectEnvRestorer
trait to abstract overRedirectRestorer
and other implementations - Added
spawn_with_local_redirections_and_restorer
to allow specifying a specificRedirectEnvRestorer
implementation - Added
VarEnvRestorer
trait to abstract overVarRestorer
and other implementations - Added
VirtualWorkingDirEnv::with_path_buf
constructor to avoid unneccessaryPathBuf
copies
eval_redirects_or_cmd_words_with_restorer
is now generic over aRedirectEnvRestorer
EvalRedirectOrCmdWordError
is also generic over anyRedirectEnvRestorer
, but defaults toRedirectRestorer
for backward compatibilityeval_redirects_or_var_assignments_with_restorer
is now generic over aRedirectEnvRestorer
EvalRedirectOrVarAssig
is also generic over anyRedirectEnvRestorer
, but defaults toRedirectRestorer
for backward compatibilityLocalRedirections
is also generic over anyRedirectEnvRestorer
, but defaults toRedirectRestorer
for backward compatibility
- Deprecated most of the direct methods on
RedirectRestorer
in favor of theRedirectEnvRestorer
trait - Deprecated most of the direct methods on
VarRestorer
in favor of theVarEnvRestorer
trait
- First release!