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

Upgrade base to 17.1.1 and resolve problems with building librespot 0.6.0 #281

Merged
merged 3 commits into from
Feb 7, 2025

Conversation

ImJustToNy
Copy link
Contributor

@ImJustToNy ImJustToNy commented Jan 19, 2025

Proposed Changes

Hi, foremost, thanks for this add-on :)
I believe this PR should fix build issues by addressing dependency problems.
It's my first time contributing to hassio-addons, so please forgive me if I made any issues.

Wish you a good day!

Summary by CodeRabbit

  • Dependency Updates
    • Upgraded base image to version 17.1.0
    • Updated multiple system packages including cargo, git, protobuf-dev, and pulseaudio-dev
    • Added new dependencies: cmake and clang19-libclang
    • Updated build configurations for multiple architectures (aarch64, amd64, armv7)

Copy link

coderabbitai bot commented Jan 19, 2025

Warning

Rate limit exceeded

@frenck has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 12 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7f08209 and 1f51c6a.

📒 Files selected for processing (2)
  • spotify/Dockerfile (2 hunks)
  • spotify/build.yaml (1 hunks)

Walkthrough

This pull request focuses on upgrading the Spotify add-on's build environment by updating the base image and multiple system dependencies. The changes primarily involve moving from version 14.3.3 to 17.1.0 of the base image across different architectures. Several packages have been updated, including Rust's cargo, Git, protobuf, PulseAudio, and new dependencies like CMake and Clang have been introduced. Additionally, the installation process for bindgen-cli has been modified.

Changes

File Changes
spotify/Dockerfile - Base image upgraded from 14.3.3 to 17.1.0
- Updated packages: cargo, git, protobuf-dev, pulseaudio, pulseaudio-dev
- Added new packages: cmake, clang19-libclang
- Added bindgen-cli installation step
spotify/build.yaml - Base image version updated to 17.1.0 for aarch64, amd64, and armv7 architectures

Poem

🐰 Upgrade dance, dependencies prance,
From fourteen to seventeen, a version's advance!
Cargo, Git, and PulseAudio stride,
CMake and Clang now by our side.
A build environment fresh and bright,
Spotify's code takes playful flight! 🎵


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d992cb and cda2ad3.

📒 Files selected for processing (2)
  • spotify/Dockerfile (3 hunks)
  • spotify/build.yaml (1 hunks)
🔇 Additional comments (4)
spotify/build.yaml (1)

3-5: Verify the base image version upgrade.

The upgrade from version 14.3.3 to 17.1.0 is a significant jump that might introduce breaking changes.

Let's verify the base image version and its changelog:

✅ Verification successful

Base image upgrade to v17.1.0 appears safe to proceed

The upgrade primarily contains routine updates to Alpine Linux (v3.21.2) and home-assistant/tempio. No breaking changes are documented in the release notes for v17.0.0 through v17.1.0, and all versions are stable releases.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify base image version and changelog
# Check if the image exists for all architectures
for arch in aarch64 amd64 armv7; do
  echo "Checking $arch..."
  gh api \
    -H "Accept: application/vnd.oci.image.index.v1+json" \
    "/v2/hassio-addons/base/manifests/17.1.0" || echo "Image not found"
done

# Get the latest releases to verify if 17.1.0 is the latest stable version
gh release list --repo hassio-addons/addon-base --limit 5

Length of output: 1843


Script:

#!/bin/bash
# Get release notes for v17.1.0
gh release view v17.1.0 --repo hassio-addons/addon-base

# Also check if there's a changelog file in the repository
fd -t f -e md -e txt changelog -i

Length of output: 479


Script:

#!/bin/bash
# Get release notes for v17.0.0 to check for breaking changes
gh release view v17.0.0 --repo hassio-addons/addon-base

Length of output: 559

spotify/Dockerfile (3)

1-1: Overall changes look good!

The dependency updates and build process changes appear well-structured and appropriate for supporting librespot 0.6.0. The cleanup process is properly maintained to keep the image size minimal.


22-22: Verify pulseaudio runtime version compatibility.

The runtime pulseaudio package has been updated to match the dev package version.

Let's check for any breaking changes in PulseAudio 17.0:

✅ Verification successful

PulseAudio 17.0 runtime version is compatible

The version update primarily includes feature additions and improvements with no breaking changes that would affect runtime compatibility.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check PulseAudio changelog for breaking changes
echo "Checking PulseAudio changelog..."
curl -s "https://www.freedesktop.org/wiki/Software/PulseAudio/Notes/17.0/" || echo "Changelog not found"

Length of output: 17794


Line range hint 24-36: Review bindgen-cli installation process.

The addition of bindgen-cli installation and subsequent removal is a new build step. This appears to be related to resolving build issues with librespot 0.6.0.

Let's verify if this is a required dependency for librespot 0.6.0:

Comment on lines +14 to +19
cargo=1.83.0-r0 \
git=2.47.2-r0 \
protobuf-dev=24.4-r4 \
pulseaudio-dev=17.0-r4 \
cmake=3.31.1-r0 \
clang19-libclang=19.1.4-r0 \
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

⚠️ Package versions appear to be incompatible with Alpine Linux repositories

The specified package versions appear to be incorrect or unavailable:

  • git=2.47.2-r0 - Version number is too high (latest is 2.43.x)
  • cmake=3.31.1-r0 - Version number is too high (latest is 3.27.x)
  • Other package versions were not found in any Alpine repository (main, community, or testing)

Please verify the correct package versions available in Alpine Linux repositories and update accordingly.

🔗 Analysis chain

Verify package version compatibility.

The PR updates multiple build dependencies to newer versions and adds new ones (cmake, clang19-libclang). Let's verify these versions are available in the Alpine package repository for the base image's Alpine version.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify package versions in Alpine repository
# Extract Alpine version from base image
echo "Checking Alpine version..."
gh api \
  -H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
  "/v2/hassio-addons/base/manifests/17.1.0" | jq -r '.config.digest' | xargs -I {} \
  gh api \
  -H "Accept: application/vnd.docker.container.image.v1+json" \
  "/v2/hassio-addons/base/blobs/{}" | jq -r '.config.Labels["org.opencontainers.image.version"]'

# Check if packages exist with specified versions
packages=(
  "cargo=1.83.0-r0"
  "git=2.47.2-r0"
  "protobuf-dev=24.4-r4"
  "pulseaudio-dev=17.0-r4"
  "cmake=3.31.1-r0"
  "clang19-libclang=19.1.4-r0"
)

for pkg in "${packages[@]}"; do
  echo "Checking $pkg..."
  # Use curl to check Alpine package repository
  # Note: This is a simplified check, actual repository URL should match Alpine version
  curl -s "https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz" | tar -xz -O | grep -A1 "${pkg%%=*}"
done

Length of output: 2306


Script:

#!/bin/bash
# Get Alpine version from Dockerfile
echo "Base image version:"
grep "FROM ghcr.io/hassio-addons/base" spotify/Dockerfile

# Function to check package in repository
check_package() {
    local pkg=$1
    local ver=$2
    local repo=$3
    echo "Checking $pkg=$ver in $repo..."
    curl -s "https://dl-cdn.alpinelinux.org/alpine/v3.19/$repo/x86_64/APKINDEX.tar.gz" | tar -xz -O | awk -v pkg="$pkg" -v ver="$ver" '
        $1 == "P:" && $2 == pkg { p=1; next }
        p && $1 == "V:" { if ($2 == ver) print "✓ Found exact version"; else print "× Version mismatch, found: "$2; p=0 }
    '
}

# Check each package in main, community, and testing
packages=(
    "cargo:1.83.0-r0"
    "git:2.47.2-r0"
    "protobuf-dev:24.4-r4"
    "pulseaudio-dev:17.0-r4"
    "cmake:3.31.1-r0"
    "clang19-libclang:19.1.4-r0"
)

for pkg_info in "${packages[@]}"; do
    pkg=${pkg_info%:*}
    ver=${pkg_info#*:}
    for repo in main community testing; do
        check_package "$pkg" "$ver" "$repo"
    done
    echo "---"
done

Length of output: 11284


Script:

#!/bin/bash
# Get base image version
echo "Base image version:"
head -n1 spotify/Dockerfile

# Function to check package in repository
check_package() {
    local pkg=$1
    local ver=$2
    local branch=$3
    local repo=$4
    echo "Checking $pkg=$ver in $branch/$repo..."
    curl -sf "https://dl-cdn.alpinelinux.org/alpine/$branch/$repo/x86_64/APKINDEX.tar.gz" | tar -xz -O 2>/dev/null | awk -v pkg="$pkg" -v ver="$ver" '
        $1 == "P:" && $2 == pkg { p=1; next }
        p && $1 == "V:" { if ($2 == ver) print "✓ Found exact version"; else print "× Version mismatch, found: "$2; p=0 }
    '
}

# Check each package in edge repositories
packages=(
    "cargo:1.83.0-r0"
    "git:2.47.2-r0"
    "protobuf-dev:24.4-r4"
    "pulseaudio-dev:17.0-r4"
    "cmake:3.31.1-r0"
    "clang19-libclang:19.1.4-r0"
)

for pkg_info in "${packages[@]}"; do
    pkg=${pkg_info%:*}
    ver=${pkg_info#*:}
    echo "Package: $pkg"
    # Check in edge repositories
    for repo in main community testing; do
        check_package "$pkg" "$ver" "edge" "$repo"
    done
    echo "---"
done

Length of output: 11587

@frenck
Copy link
Member

frenck commented Jan 22, 2025

This PR is mostly a duplicate of #253, and shows the same issue.

armv7 & aarch64 not passing.

@ImJustToNy
Copy link
Contributor Author

This PR is mostly a duplicate of #253, and shows the same issue.

armv7 & aarch64 not passing.

I'm not 100% certain, however, I think that is the issue of building images, on emulated environment. Will try to build it on arm-native machine.

@ImJustToNy
Copy link
Contributor Author

This PR is mostly a duplicate of #253, and shows the same issue.

armv7 & aarch64 not passing.

image
can confirm that image builds on aarch64

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Thanks, @ImJustToNy 🥇

../Frenck

@frenck frenck added major This PR causes a major version bump in the version number. dependencies Upgrade or downgrade of project dependencies. labels Jan 23, 2025
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, the CI is still failing.

@ImJustToNy
Copy link
Contributor Author

Unfortunately, the CI is still failing.

Since image builds successfully on arm based systems, we can conclude that it isn't necessarily a code error. I think the issue cannot be fixed without switching to either:

@frenck frenck changed the title Upgrade base to 17.1.0 and resolve problems with building librespot 0.6.0 Upgrade base to 17.1.1 and resolve problems with building librespot 0.6.0 Feb 7, 2025
@frenck
Copy link
Member

frenck commented Feb 7, 2025

That one was on my todolist for quite some time now, this was the final push for doing that :)

All add-on workflows now use the arm runners for all arm arch add-ons.

Builds passes :)

../Frenck

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @ImJustToNy 🙏

../Frenck

@frenck frenck merged commit 937b5a2 into hassio-addons:main Feb 7, 2025
11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Upgrade or downgrade of project dependencies. major This PR causes a major version bump in the version number.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants