From 3ac2c6b6edb70052685be38e63b15c061c49bd05 Mon Sep 17 00:00:00 2001 From: floatlesss <117862164+floatlesss@users.noreply.github.com> Date: Tue, 2 Dec 2025 13:39:36 +0000 Subject: [PATCH] fix: upgrade TagLib in devcontainer (#4750) * Signed-off-by: floatlesss <117862164+floatlesss@users.noreply.github.com> fix(vscodedevcontainer): fix-taglib-build-issues - #4749 * Apply Gemini suggested changes Signed-off-by: floatlesss <117862164+floatlesss@users.noreply.github.com> * chore: install TagLib in devcontainer Dockerfile Move TagLib installation from postCreateCommand script into the devcontainer Dockerfile to leverage Docker layer caching and simplify setup.\n\nChanges:\n- Install cross-taglib v2.1.1-1 directly in Dockerfile using TARGETARCH for multi-arch support (amd64/arm64).\n- Remove redundant libtag1-dev apt dependency; keep ffmpeg only.\n- Add CROSS_TAGLIB_VERSION as a build arg for consistency with CI/Makefile.\n- Remove postCreateCommand from devcontainer.json and delete install-taglib.sh script.\n\nWhy:\n- Avoid re-downloading TagLib on each container create; benefit from cached image layers.\n- Reduce redundancy and potential version mismatch between apt libtag and cross-taglib.\n- Keep devcontainer aligned with production build approach and CI settings. --------- Signed-off-by: floatlesss <117862164+floatlesss@users.noreply.github.com> Co-authored-by: Deluan --- .devcontainer/Dockerfile | 15 +++++++++++---- .devcontainer/devcontainer.json | 7 +++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 4fc7a5b73..6cf7a5e4e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -9,12 +9,19 @@ ARG INSTALL_NODE="true" ARG NODE_VERSION="lts/*" RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "source /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi -# [Optional] Uncomment this section to install additional OS packages. +# Install additional OS packages RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install --no-install-recommends libtag1-dev ffmpeg + && apt-get -y install --no-install-recommends ffmpeg -# [Optional] Uncomment the next line to use go get to install anything else you need -# RUN go get -x +# Install TagLib from cross-taglib releases +ARG CROSS_TAGLIB_VERSION="2.1.1-1" +ARG TARGETARCH +RUN DOWNLOAD_ARCH="linux-${TARGETARCH}" \ + && wget -q "https://github.com/navidrome/cross-taglib/releases/download/v${CROSS_TAGLIB_VERSION}/taglib-${DOWNLOAD_ARCH}.tar.gz" -O /tmp/cross-taglib.tar.gz \ + && tar -xzf /tmp/cross-taglib.tar.gz -C /usr --strip-components=1 \ + && mv /usr/include/taglib/* /usr/include/ \ + && rmdir /usr/include/taglib \ + && rm /tmp/cross-taglib.tar.gz /usr/provenance.json # [Optional] Uncomment this line to install global node packages. # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ff58994db..0519f25fc 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,8 @@ "VARIANT": "1.25", // Options "INSTALL_NODE": "true", - "NODE_VERSION": "v24" + "NODE_VERSION": "v24", + "CROSS_TAGLIB_VERSION": "2.1.1-1" } }, "workspaceMount": "", @@ -54,12 +55,10 @@ 4533, 4633 ], - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "make setup-dev", // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode", "remoteEnv": { "ND_MUSICFOLDER": "./music", "ND_DATAFOLDER": "./data" } -} +} \ No newline at end of file