Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace call to stat, lstat, and maybeLstat with appropriate functions from std::filesystem #10937

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Commits on Jun 15, 2024

  1. replace some usage of the stat and lstat...

    ...with `std::filesystem` functions
    
    The `stat` defined in `file-system.cc` is not used anywhere now. This
    will be removed with the removal of the `STAT` macro defined in the same
    file.
    `lstat` is still used in some places so we cannot remove the `STAT`
    macro.
    siddhantk232 committed Jun 15, 2024
    Configuration menu
    Copy the full SHA
    9644910 View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2024

  1. remove usage of maybeLstat

    the `maybeLstat` is removed in favor of the new `maybeSymlinkStat` which
    uses the `std::filesystem` library. All the call sites have been updated
    siddhantk232 committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    f47743c View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2024

  1. remove usage of lstat with std::filesystem or...

    ... `unix::lstat`
    
    appropriate functions from `std::filesystem` is used in places where
    `lstat` was called. Places that require platform specific implementation
    are using `unix::lstat` for now.
    siddhantk232 committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    adfee1a View commit details
    Browse the repository at this point in the history
  2. fix: handle srcFile not_found correctly

    - The `std::filesystem::status` returns `not_found` and does not throw
      any error.
    
    - `std::filesystem::*` is shortened to `fs::*` for better readability
    siddhantk232 committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    63f5288 View commit details
    Browse the repository at this point in the history
  3. revert PosixSourceAccessor::cachedLstat

    The result of this function cannot be `std::filesystem::file_status` yet
    as we use it to acess `st_mtime`. The equivalent function in
    `std::filesystem` to get the last write time does follow symlinks which
    is not the behavior we want.
    siddhantk232 committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    6694d5d View commit details
    Browse the repository at this point in the history
  4. fix: wrong argument in a call to fs::permissions

    A typo (`"src" -> "dst"`) caught by functional tests is fixed
    siddhantk232 committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    f410986 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2024

  1. fix: compile error for macos

    The removed `nix::maybeLstat` was referenced here. It's replaced with
    the new function that replaced it.
    siddhantk232 committed Jun 20, 2024
    Configuration menu
    Copy the full SHA
    ad2525a View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2024

  1. Configuration menu
    Copy the full SHA
    c47c156 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1310083 View commit details
    Browse the repository at this point in the history

Commits on Jul 11, 2024

  1. Configuration menu
    Copy the full SHA
    749c037 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e0090fe View commit details
    Browse the repository at this point in the history