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

[pull] master from MusicPlayerDaemon:master #22

Merged
merged 12 commits into from
Jan 29, 2025

Conversation

pull[bot]
Copy link

@pull pull bot commented Jan 29, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

Summary by Sourcery

Update the minimum required GCC version to 12 and Clang version to 14. Replace make_unique with make_unique_for_overwrite for dynamic allocations. Improve error messages for file access permissions. Refine the inotify update mechanism to handle newly created symlinks and directories more effectively. Update build dependencies and CI configurations accordingly.

Enhancements:

  • Improve error messages for file access permissions.
  • Refine the inotify update mechanism to handle newly created symlinks and directories more effectively.

Build:

  • Update build dependencies.

CI:

  • Update CI configurations to use GCC 12 and Ubuntu 24.04.

Tests:

  • Add event dependency to tests.

Users are confused by "Access denied".  Let's write an error message
that is more clear.

Closes #2184
All Linux distributions have at least version 4, and thus I cannot
test with older versions.
SOCK_CLOEXEC has been added to libnfs version 2, and since we require
at least version 4, we can safely remove this call.
libnfs version 6 has major API changes and MPD 0.23 has never been
adapted to these.  This additional configure-time check fixes
potential compile-time failures.
A new symlink causes `IN_CREATE`.  Usually, we catch `IN_CREATE` only with
IN_ISDIR to watch the new directory, but otherwise `IN_CREATE` is not
handled.  Regular files are "created" but they have usable content
only with `IN_CLOSE_WRITE`.  Yet symlinks have only `IN_CREATE` and
they are immediately usable.

Closes #2192
Don't zero-initialize the buffers.  This removes some useless
overhead.
This reverts commit 56c0733.  GCC 8
is no longer supported.
GCC 10 doesn't have std::make_unique_for_overwrite(), so let's drop it.
@pull pull bot added the ⤵️ pull label Jan 29, 2025
@pull pull bot merged commit ab011ad into CartoonFan:master Jan 29, 2025
2 checks passed
Copy link

sourcery-ai bot commented Jan 29, 2025

Reviewer's Guide by Sourcery

This pull request primarily focuses on updating the minimum required compiler versions, enhancing compiler warning flags, and addressing memory allocation practices. Additionally, it includes minor fixes related to file access permissions and inotify event handling.

Sequence diagram for improved file access error messages on Windows

sequenceDiagram
    participant Client
    participant FileSystem
    participant ErrorHandler

    Client->>FileSystem: Request file access
    alt Windows platform
        FileSystem->>ErrorHandler: Throw ProtocolError
        ErrorHandler-->>Client: 'Access to local files not implemented on Windows'
    else Unix platform
        alt Unauthenticated client
            FileSystem->>ErrorHandler: Throw ProtocolError
            ErrorHandler-->>Client: 'Access to local files via TCP is not allowed'
        else Insufficient permissions
            FileSystem->>ErrorHandler: Throw ProtocolError
            ErrorHandler-->>Client: 'Access denied due to file permissions'
        end
    end
Loading

Class diagram showing memory allocation changes

classDiagram
    class MemoryAllocation {
      +make_unique[]
      +make_unique_for_overwrite[]
    }
    note for MemoryAllocation "Changed from make_unique[] to make_unique_for_overwrite[] for uninitialized arrays"

    class AffectedClasses {
      +MadDecoder
      +SidplayGlobal
      +WinICU
      +Id3Load
      +FileCommands
      +ReadOperation
      +ICUUtil
      +NfsFileReader
      +Queue
      +ApeLoader
    }
    AffectedClasses --> MemoryAllocation: uses
Loading

File-Level Changes

Change Details Files
Updated minimum required compiler versions for GCC and Clang.
  • Increased the minimum required GCC version from 10 to 12.
  • Increased the minimum required Clang version from 11 to 14.
meson.build
Added a new compiler warning flag and removed a conditional flag.
  • Added the '-Wsuggest-override' flag to the test_cxxflags.
  • Removed the conditional addition of '-Wsuggest-override' based on the compiler version.
meson.build
Updated compiler versions in the build workflow.
  • Updated the g++ compiler version from 10 to 12 for the ubuntu-24.04 build job.
  • Updated the gcc compiler version from 10 to 12 for the ubuntu-24.04 build job.
.github/workflows/build.yml
Replaced std::make_unique with std::make_unique_for_overwrite for uninitialized memory allocation.
  • Replaced std::make_unique with std::make_unique_for_overwrite when allocating memory for byte arrays without initialization.
src/decoder/plugins/MadDecoderPlugin.cxx
src/decoder/plugins/SidplayDecoderPlugin.cxx
src/lib/icu/Win32.cxx
src/tag/Id3Load.cxx
src/command/FileCommands.cxx
src/io/uring/ReadOperation.cxx
src/lib/icu/Util.cxx
src/lib/nfs/FileReader.cxx
src/queue/Queue.cxx
src/tag/ApeLoader.cxx
Modified file access permission error messages.
  • Updated the error message for file access denial on Windows.
  • Updated the error message for unauthenticated client file access.
  • Updated the error message for file access denial due to file permissions.
src/client/File.cxx
Added a condition to check for file creation events in inotify.
  • Added a check for IN_CREATE events to trigger an update, specifically for symlinks and directories.
src/db/update/InotifyUpdate.cxx
Removed a workaround for a GCC bug.
  • Removed the workaround for a bogus -Wuninitialized warning in older GCC versions.
src/decoder/plugins/MadDecoderPlugin.cxx
Added event_dep to several test dependencies.
  • Added event_dep to the dependencies of zeroconf_test.
  • Added event_dep to the dependencies of neighbor_glue_test.
  • Added event_dep to the dependencies of database_test.
  • Added event_dep to the dependencies of curl_test.
test/meson.build

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants