leomeinel opened a new issue, #1420:
URL: https://github.com/apache/answer/issues/1420

   ## Describe the bug
   
   I am trying to build the latest `1.7.0`/`1.6.0` with the quick-links plugin. 
It seems like either this default plugin or the logic in rebuild is not 
building/executing correctly. Maybe it is due to conflicts with other plugins?
   
   When rebuilding this is my command:
   
   ```
   /usr/bin/answer build --output /usr/bin/new_answer --with 
github.com/apache/answer-plugins/cache-redis@latest --with 
github.com/apache/answer-plugins/captcha-basic@latest --with 
github.com/apache/answer-plugins/connector-basic@latest --with 
github.com/apache/answer-plugins/editor-chart@latest --with 
github.com/apache/answer-plugins/editor-formula@latest --with 
github.com/apache/answer-plugins/embed-basic@latest --with 
github.com/apache/answer-plugins/quick-links@latest --with 
github.com/apache/answer-plugins/render-markdown-codehighlight@latest --with 
github.com/apache/answer-plugins/reviewer-basic@latest
   ```
   
   This is the error:
   
   ```
   #15 965.2 try to merge i18n files
   #15 965.2 i18n dir:  
/go/answer_build1160446482/vendor/github.com/apache/answer-plugins/cache-redis/i18n
   #15 965.2 i18n dir:  
/go/answer_build1160446482/vendor/github.com/apache/answer-plugins/captcha-basic/i18n
   #15 965.2 i18n dir:  
/go/answer_build1160446482/vendor/github.com/apache/answer-plugins/connector-basic/i18n
   #15 965.2 i18n dir:  
/go/answer_build1160446482/vendor/github.com/apache/answer-plugins/editor-chart/i18n
   #15 965.2 i18n dir:  
/go/answer_build1160446482/vendor/github.com/apache/answer-plugins/editor-formula/i18n
   #15 965.2 i18n dir:  
/go/answer_build1160446482/vendor/github.com/apache/answer-plugins/embed-basic/i18n
   #15 965.2 i18n dir:  
/go/answer_build1160446482/vendor/github.com/apache/answer-plugins/quick-links/i18n
   #15 965.2 i18n dir:  
/go/answer_build1160446482/vendor/github.com/apache/answer-plugins/render-markdown-codehighlight/i18n
   #15 965.2 i18n dir:  
/go/answer_build1160446482/vendor/github.com/apache/answer-plugins/reviewer-basic/i18n
   #15 965.2 [go build -ldflags -X github.com/apache/answer/cmd.Version=1.7.0 
-X github.com/apache/answer/cmd.Revision=20cd4d7 -X 
github.com/apache/answer/cmd.Time=1762307412 -o /usr/bin/new_answer .]
   #15 977.4 # github.com/apache/answer-plugins/quick-links
   #15 977.4 
vendor/github.com/apache/answer-plugins/quick-links/basic.go:36:17: undefined: 
plugin.SidebarConfig
   #15 977.4 
vendor/github.com/apache/answer-plugins/quick-links/basic.go:41:19: undefined: 
plugin.SidebarConfig
   #15 977.4 
vendor/github.com/apache/answer-plugins/quick-links/basic.go:63:24: undefined: 
plugin.ConfigTypeTagSelector
   #15 977.4 
vendor/github.com/apache/answer-plugins/quick-links/basic.go:83:15: undefined: 
plugin.SidebarConfig
   #15 977.4 
vendor/github.com/apache/answer-plugins/quick-links/basic.go:90:64: undefined: 
plugin.SidebarConfig
   #15 985.6 build failed exit status 1
   #15 ERROR: process "/bin/bash -c /scripts/build.sh" did not complete 
successfully: exit code: 1
   ------
    > [golang-builder 6/6] RUN ["/bin/bash","-c","/scripts/build.sh"]:
   965.2 i18n dir:  
/go/answer_build1160446482/vendor/github.com/apache/answer-plugins/render-markdown-codehighlight/i18n
   965.2 i18n dir:  
/go/answer_build1160446482/vendor/github.com/apache/answer-plugins/reviewer-basic/i18n
   965.2 [go build -ldflags -X github.com/apache/answer/cmd.Version=1.7.0 -X 
github.com/apache/answer/cmd.Revision=20cd4d7 -X 
github.com/apache/answer/cmd.Time=1762307412 -o /usr/bin/new_answer .]
   977.4 # github.com/apache/answer-plugins/quick-links
   977.4 vendor/github.com/apache/answer-plugins/quick-links/basic.go:36:17: 
undefined: plugin.SidebarConfig
   977.4 vendor/github.com/apache/answer-plugins/quick-links/basic.go:41:19: 
undefined: plugin.SidebarConfig
   977.4 vendor/github.com/apache/answer-plugins/quick-links/basic.go:63:24: 
undefined: plugin.ConfigTypeTagSelector
   977.4 vendor/github.com/apache/answer-plugins/quick-links/basic.go:83:15: 
undefined: plugin.SidebarConfig
   977.4 vendor/github.com/apache/answer-plugins/quick-links/basic.go:90:64: 
undefined: plugin.SidebarConfig
   985.6 build failed exit status 1
   ------
   Dockerfile:28
   --------------------
     26 |     COPY scripts/ /scripts
     27 |     RUN chmod 755 /scripts/*.sh
     28 | >>> RUN ["/bin/bash","-c","/scripts/build.sh"]
     29 |     
     30 |     # Defaults from 
https://github.com/apache/answer/blob/main/Dockerfile
   --------------------
   ERROR: failed to solve: process "/bin/bash -c /scripts/build.sh" did not 
complete successfully: exit code: 1
   ```
   
   If I remove the quick-links@latest, it works flawlessly.
   
   ## To Reproduce
   
   Steps to reproduce the behavior:
   
   1. Use above command to rebuild binary
   2. See error
   
   ## Expected behavior
   
   I expected apache answer to rebuild correctly, with or without 
quick-links@latest
   
   ## Dockerfile
   
   ```docker
   ###
   # File: Dockerfile
   # Author: Leopold Meinel ([email protected])
   # -----
   # Copyright (c) 2025 Leopold Meinel & contributors
   # SPDX ID: MIT
   # URL: https://opensource.org/licenses/MIT
   # -----
   ###
   
   # Initialize /usr/bin/answer
   # INFO: Replace VERSION
   FROM docker.io/apache/answer:1.7.0 AS answer-builder
   # INFO: Replace VERSION
   FROM code.forgejo.org/oci/golang:1.25-alpine3.22 AS golang-builder
   COPY --from=answer-builder /usr/bin/answer /usr/bin/answer
   
   # Install dependencies
   # INFO: Replace VERSION
   ENV PNPM_VERSION="10.20.0"
   RUN apk --no-cache add \
       build-base git bash nodejs npm go && \
       npm install -g pnpm@${PNPM_VERSION}
   
   # Build /usr/bin/new_answer
   COPY scripts/ /scripts
   RUN chmod 755 /scripts/*.sh
   RUN ["/bin/bash","-c","/scripts/build.sh"]
   
   # Defaults from https://github.com/apache/answer/blob/main/Dockerfile
   # INFO: Replace VERSION
   FROM code.forgejo.org/oci/alpine:latest
   LABEL maintainer="[email protected]"
   
   ARG TIMEZONE
   ENV TIMEZONE=${TIMEZONE:-"Asia/Shanghai"}
   
   RUN apk update \
       && apk --no-cache add \
           bash \
           ca-certificates \
           curl \
           dumb-init \
           gettext \
           openssh \
           sqlite \
           gnupg \
           tzdata \
       && ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
       && echo "${TIMEZONE}" > /etc/timezone
   
   # Defaults from 
https://answer.apache.org/docs/plugins/#build-with-plugin-from-answer-base-image
   COPY --from=golang-builder /usr/bin/new_answer /usr/bin/answer
   COPY --from=answer-builder /data /data
   COPY --from=answer-builder /entrypoint.sh /entrypoint.sh
   RUN chmod 755 /entrypoint.sh
   
   VOLUME /data
   ENTRYPOINT ["/entrypoint.sh"]
   ```
   
   ### build.sh
   
   ```sh
   #!/usr/bin/env bash
   ###
   # File: build.sh
   # Author: Leopold Meinel ([email protected])
   # -----
   # Copyright (c) 2025 Leopold Meinel & contributors
   # SPDX ID: MIT
   # URL: https://opensource.org/licenses/MIT
   # -----
   ###
   
   # Fail on error
   set -e
   
   # Set ${SCRIPT_DIR}
   SCRIPT_DIR="$(dirname -- "$(readlink -f -- "${0}")")"
   
   # Check if ${PLUGIN_FILE} exists
   PLUGIN_FILE=${SCRIPT_DIR}/plugins.txt
   if [[ ! -f ${PLUGIN_FILE} ]]; then
       echo "ERROR: 'PLUGIN_FILE' does not exist."
       exit 1
   fi
   
   # APPEND COMMAND with repositories from ${PLUGIN_FILE}
   OUTPUT=/usr/bin/new_answer
   COMMAND="/usr/bin/answer build --output ${OUTPUT}"
   while IFS= read -r repo; do
       COMMAND+=" --with ${repo}"
   done < <(grep -v '^ *#' "${PLUGIN_FILE}")
   
   # Execute ${COMMAND}
   echo "COMMAND is: '${COMMAND}'"
   ${COMMAND}
   
   # Check ${OUTPUT}
   if [[ ! -f ${OUTPUT} ]]; then
       echo "ERROR: '${OUTPUT}' does not exist. The build was unsuccessful."
       exit 1
   fi
   ```
   
   ### plugins.txt
   
   ```
   github.com/apache/answer-plugins/cache-redis@latest
   github.com/apache/answer-plugins/captcha-basic@latest
   github.com/apache/answer-plugins/connector-basic@latest
   github.com/apache/answer-plugins/editor-chart@latest
   github.com/apache/answer-plugins/editor-formula@latest
   github.com/apache/answer-plugins/embed-basic@latest
   github.com/apache/answer-plugins/render-markdown-codehighlight@latest
   github.com/apache/answer-plugins/reviewer-basic@latest
   ```
   
   ## Platform
   
   - Device: forgejo-runner using DIND
   - OS: NixOS 25.05 - Linux cyan 6.12.50-hardened1 #1-NixOS SMP 
PREEMPT_DYNAMIC Thu Oct  2 11:44:15 UTC 2025 x86_64 GNU/Linux
   - Version: v1.7.0/v1.6.0
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to