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

ollama/0.5.4 package update #37372

Merged
merged 3 commits into from
Jan 9, 2025

Conversation

octo-sts[bot]
Copy link
Contributor

@octo-sts octo-sts bot commented Dec 18, 2024

Signed-off-by: wolfi-bot <121097084+wolfi-bot@users.noreply.github.com>
@octo-sts octo-sts bot added request-version-update request for a newer version of a package automated pr labels Dec 18, 2024
@octo-sts octo-sts bot mentioned this pull request Dec 18, 2024
Copy link
Contributor Author

octo-sts bot commented Dec 18, 2024

Gen AI suggestions to solve the build error:

• Detected Error:

make: *** No targets specified and no makefile found.  Stop.
llama/llama.go:3: running "make": exit status 2

• Error Category: Build Configuration

• Failure Point: During go generate ./... step, specifically when trying to generate code for llama/llama.go

• Root Cause Analysis: The error suggests that go generate is trying to run make command for code generation, but there's no Makefile present in the expected location. This likely relates to CGO dependencies or generated code requirements for the llama package.

• Suggested Fix:

  1. Modify the pipeline section to include the required build steps:
pipeline:
  - uses: git-checkout
    with:
      repository: https://github.com/ollama/ollama
      tag: v${{package.version}}
      expected-commit: 2ddc32d5c5386b28062a46ac6cfea5160cd9f600

  - uses: go/bump
    with:
      deps: golang.org/x/crypto@v0.31.0

  - runs: |
      # Ensure we're in the correct directory
      cd ${{targets.destdir}}
      
      # Skip generate step as it's not required
      CGO_ENABLED=1 go build -tags netgo -ldflags '-w -s -linkmode external -extldflags "-static"' .
      
      mkdir -p ${{targets.destdir}}/usr/bin
      mv ollama ${{targets.destdir}}/usr/bin/

• Explanation:
The original error occurs because go generate is trying to run make commands that aren't necessary for the actual build. The fix removes the generate step and focuses on the direct build process with proper CGO flags. The static linking flags ensure proper binary compilation.

• Additional Notes:

  • The package uses CGO which requires special handling for static compilation
  • The go generate step might not be necessary for the actual build
  • Consider adding additional build dependencies if needed
  • The netgo tag ensures proper DNS resolution in static builds

• References:

Signed-off-by: hbh7 <hunter.harris@chainguard.dev>
Copy link
Contributor Author

octo-sts bot commented Jan 7, 2025

⚠️ EXPERIMENTAL

Please use 👍 or 👎 on this comment to indicate if you agree or disagree with the recommendation.

To provide more detailed feedback please comment on the recommendation prefixed with /ai-verify:

e.g. /ai-verify partially helpful but I also adde bash to the build environment

Gen AI suggestions to solve the build error:

• Detected Error:

make: *** No targets specified and no makefile found.  Stop.
llama/llama.go:3: running "make": exit status 2

• Error Category: Build Configuration

• Failure Point: Go generate step failing during the build pipeline when trying to run make command as part of code generation

• Root Cause Analysis: The error occurs during go generate which is trying to execute a make command, but no Makefile is found. This typically happens when required build files are missing or not properly set up in the source directory.

• Suggested Fix:

  1. Modify the pipeline step to include the required build dependency:
  - runs: |
      cd llama
      go generate -x ./... # Add -x flag to see what commands are being run
      cd ..
      CGO_ENABLED=1 go build -ldflags '-linkmode external -extldflags "-static"' .
      mkdir -p ${{targets.destdir}}/usr/bin
      mv ollama ${{targets.destdir}}/usr/bin

Or alternatively, skip the generate step if it's not critical:

  - runs: |
      CGO_ENABLED=1 go build -ldflags '-linkmode external -extldflags "-static"' .
      mkdir -p ${{targets.destdir}}/usr/bin
      mv ollama ${{targets.destdir}}/usr/bin

• Explanation: The error suggests that go generate is trying to run a make command but can't find the Makefile. This could be because either:

  1. The generate directives are incorrectly configured
  2. The build environment is missing required files
  3. The generate step might not be necessary for the actual build

• Additional Notes:

  • The go generate command is typically used for code generation before the build
  • The -x flag can help debug what commands go generate is trying to run
  • If the generate step isn't required for the build, it can be skipped
  • Check if upstream has any special build requirements for code generation

• References:

@debasishbsws debasishbsws self-assigned this Jan 9, 2025
Signed-off-by: debasishbsws <debasishbsws.dev@gmail.com>
@octo-sts octo-sts bot added the bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. label Jan 9, 2025
@debasishbsws debasishbsws requested a review from a team January 9, 2025 11:16
@kbsteere kbsteere merged commit fcc2bd1 into main Jan 9, 2025
21 checks passed
@kbsteere kbsteere deleted the wolfictl-44a24d5c-78ec-472e-8fe6-a0e074768f8c branch January 9, 2025 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automated pr bincapz/pass bincapz/pass Bincapz (aka. malcontent) scan didn't detect any CRITICALs on the scanned packages. request-version-update request for a newer version of a package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants