Skip to content

yash-env-0.3.0

Compare
Choose a tag to compare
@magicant magicant released this 22 Aug 15:09
· 81 commits to master since this release
yash-env-0.3.0

[0.3.0] - 2024-08-22

Added

  • This crate now builds on non-Unix platforms. However,
    system::real::RealSystem is only available on Unix platforms.
  • The OfdAccess, OpenFlag, FdFlag, Mode, RawMode, Uid, RawUid,
    Gid, RawGid, FileType, Stat, and SigmaskOp types in the system
    module
  • The System trait now has the ofd_access, get_and_set_nonblocking,
    getuid, geteuid, getgid, and getegid methods.
  • Mode has been moved from system::virtual to system and now has constants
    with more human-friendly names, e.g., USER_READ and GROUP_WRITE.
  • The system::virtual::Inode struct now has the stat method.
  • The system::virtual::FileBody struct now has the type and size methods.
  • The system::virtual::Process struct now has the getters/setters for the
    real/effective user/group IDs: uid, set_uid, euid, set_euid, gid,
    set_gid, egid, and set_egid.
  • system::virtual::VirtualSystem::open now applies the process's umask to the
    mode argument.
  • The job::RawPid type has been added to represent the contents of job::Pid.
  • The stack::Frame enum now has the InitFile variant.
  • The crate now re-exports unix_path as path and unix_str as str.
  • External dependencies:
    • enumset 1.1.2 (previously an internal dependency)
    • unix_path 1.0.1
    • unix_str 1.0.0
  • Internal dependencies:
    • bitflags 2.6.0
    • nix 0.29.0 (with the "fs", "signal", and "user" features enabled)

Changed

  • system::FdFlag is no longer a re-export of nix::fcntl::FdFlag.
  • system::Mode is no longer a re-export of nix::sys::stat::Mode.
  • All APIs that handle std::path::Path, std::path::PathBuf, std::ffi::OsStr,
    and std::ffi::OsString now use path::Path, path::PathBuf, str::OsStr,
    and str::OsString instead.
    • system::DirEntry::name
    • system::System::confstr_path
    • system::System::getcwd
    • system::System::getpwnam_dir
    • system::System::open_tmpfile
    • system::virtual::FileBody::Directory::files
    • system::virtual::FileBody::Symlink::target
    • system::virtual::FileSystem::get
    • system::virtual::FileSystem::save
    • system::virtual::Process::chdir
    • system::virtual::SystemState::home_dirs
    • system::virtual::SystemState::path
    • system::virtual::VirtualDir::new
  • system::SignalHandling has been renamed to system::Disposition.
  • In the system::virtual::Process struct, the following methods have been
    renamed:
    • signal_handlingdisposition
    • set_signal_handlingset_disposition
  • In the trap::SignalSystem trait, the set_signal_handling method has been
    renamed to set_disposition.
  • In the trap::TrapSet struct, the following methods have been renamed:
    • enable_sigchld_handlerenable_internal_disposition_for_sigchld
    • enable_terminator_handlersenable_internal_dispositions_for_terminators
    • enable_stopper_handlersenable_internal_dispositions_for_stoppers
    • disable_terminator_handlersdisable_internal_dispositions_for_terminators
    • disable_stopper_handlersdisable_internal_dispositions_for_stoppers
    • disable_internal_handlersdisable_internal_dispositions
  • The fstat and fstatat methods of system::System now return a Stat
    instead of a nix::sys::stat::FileStat.
  • The system::System::fstatat method now takes a follow_symlinks: bool
    parameter instead of an AtFlags parameter.
  • The system::System::open method has been redefined to take OfdAccess and
    OpenFlag parameters instead of nix::fcntl::OFlag.
  • The system::System::isatty method now returns a bool instead of a
    system::Result<bool>.
  • The system::System::umask method now takes and returns a value of the new
    system::Mode type.
  • The system::System::sigmask method now takes a SigmaskOp parameter instead
    of a nix::sys::signal::SigmaskHow parameter.
  • The system::System::select method now takes Vec<io::Fd> parameters instead
    of fd_set::FdSet parameters. It also takes a Duration instead of a
    nix::sys::time::TimeSpec for the optional timeout parameter.
  • The dup, fcntl_getfl, and fcntl_setfl methods of system::System now
    operate on an EnumSet<FdFlag> parameter instead of an nix::fcntl::FdFlag
    parameter.
  • The getrlimit and setrlimit methods of system::System now returns an
    error of type system::Errno instead of std::io::Error.
  • In the system::resource module:
    • The rlim_t type has been renamed to Limit.
    • The RLIM_INFINITY constant has been renamed to INFINITY.
  • The flags: enumset::EnumSet<FdFlag> field of
    yash_env::system::virtual::FdBody has replaced
    the flag: nix::fcntl::FdFlag field.
  • The system::virtual::INode struct has been renamed to Inode.
  • The system::virtual::OpenFileDescription::i_node method has been renamed to
    inode and now returns a reference to Rc<RefCell<Inode>> rather than a
    clone of it.
  • The system::virtual::OpenFileDescription::seek method now takes a
    std::io::SeekFrom parameter instead of an offset and whence pair.
  • The system::virtual::VirtualSystem::select method now treats as ready file
    descriptors that are contained in readers but not readable, or in writers
    but not writable. Previously, the method returned an EBADF error in these
    cases.
  • External dependency versions:
    • Rust 1.77.0 → 1.79.0
    • yash-syntax 0.10.0 → 0.11.0

Deprecated

  • system::virtual::Mode in favor of system::Mode

Removed

  • The system module no longer reexports nix::fcntl::AtFlags,
    nix::fcntl::OFlag, nix::sys::stat::FileStat, nix::sys::stat::SFlag,
    nix::sys::signal::SigmaskHow, and nix::sys::time::TimeSpec.
  • The fcntl_getfl and fcntl_setfl methods from the System trait
  • The system::Errno struct's last and clear methods are no longer public.
  • The system::resource::Resource::as_raw_type method is no longer public.
  • All the fields of the system::virtual::OpenFileDescription struct are now
    private.
  • The system::fd_set module
  • impl TryFrom<semantics::ExitStatus> for nix::sys::signal::Signal
  • impl From<job::Pid> for nix::unistd::Pid
  • impl From<nix::unistd::Pid> for job::Pid
  • impl From<system::resource::LimitPair> for nix::libc::rlimit
  • impl From<nix::libc::rlimit> for system::resource::LimitPair
  • External dependencies:
    • nix 0.27.0 (now an internal dependency with the "fs", "signal" and "user"
      features enabled)