func icon indicating copy to clipboard operation
func copied to clipboard

Fix: Resolve s2i linux/amd64 build failure by pinning source-to-image v1.5.1

Open suhas-developer07 opened this issue 1 month ago • 18 comments

This PR fixes cross-platform build errors when deploying Go functions from macOS to Linux using the S2I builder. The issue occurred due to environment inconsistencies (timestamps and GOOS/GOARCH mismatch) causing runtime crashes like "lfstack.push invalid packing".

This PR fixes the func deploy -b=s2i --platform linux/amd64 build failure that caused runtime crashes like runtime: lfstack.push invalid packing.

The issue was due to an invalid or missing version reference for github.com/openshift/source-to-image. replace github.com/openshift/source-to-image => github.com/openshift/source-to-image v1.5.1

suhas-developer07 avatar Oct 24 '25 05:10 suhas-developer07

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: suhas-developer07 / name: suhas (564dcc86991ca29317d915d40f0f905d55b43444, a13b4600af05d438f2d81f60ace9e66fe34b408c, c7a5ea1afc2bd70543ee66639f0cfc13bc9af8b8)

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: suhas-developer07 Once this PR has been reviewed and has the lgtm label, please assign jrangelramos for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

knative-prow[bot] avatar Oct 24 '25 05:10 knative-prow[bot]

Welcome @suhas-developer07! It looks like this is your first PR to knative/func 🎉

knative-prow[bot] avatar Oct 24 '25 05:10 knative-prow[bot]

Hi @suhas-developer07. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

knative-prow[bot] avatar Oct 24 '25 05:10 knative-prow[bot]

Verified the fix locally — the s2i linux/amd64 build now completes successfully after adding replace github.com/openshift/source-to-image => github.com/openshift/source-to-image v1.5.1 to go.mod.

This resolves the lfstack.push invalid packing runtime crash reported in issue #3140.

suhas-developer07 avatar Oct 24 '25 05:10 suhas-developer07

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: suhas-developer07 Once this PR has been reviewed and has the lgtm label, please assign jrangelramos for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here. Needs approval from an approver in each of these files:

* **[OWNERS](https://github.com/knative/func/blob/main/OWNERS)**

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

Hi @jrangelramos,

This PR fixes the s2i linux/amd64 build failure by pinning source-to-image to v1.5.1. Could you please review and /approve if it looks good?

Thanks!

suhas-developer07 avatar Oct 24 '25 06:10 suhas-developer07

Hi, you deleted the func-yaml schema, accidentally I assume. also you will need to verify the easyCLA. Thanks for the contribution!

gauron99 avatar Oct 24 '25 07:10 gauron99

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 51.82%. Comparing base (b2b8009) to head (564dcc8). :warning: Report is 37 commits behind head on main.

:exclamation: There is a different number of reports uploaded between BASE (b2b8009) and HEAD (564dcc8). Click for more details.

HEAD has 7 uploads less than BASE
Flag BASE (b2b8009) HEAD (564dcc8)
1 0
unit-tests 3 0
e2e-tests 2 0
integration-tests 1 0
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3144      +/-   ##
==========================================
- Coverage   59.39%   51.82%   -7.57%     
==========================================
  Files         134      162      +28     
  Lines       13500    19134    +5634     
==========================================
+ Hits         8018     9916    +1898     
- Misses       4539     8241    +3702     
- Partials      943      977      +34     
Flag Coverage Δ
e2e-tests ?
integration 17.90% <ø> (?)
integration-tests ?
unit macos-14 44.37% <ø> (?)
unit macos-latest 44.37% <ø> (?)
unit ubuntu-24.04-arm 44.56% <ø> (?)
unit ubuntu-latest 45.31% <ø> (?)
unit windows-latest 44.39% <ø> (?)
unit-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Oct 24 '25 07:10 codecov[bot]

@linux-foundation-easycla recheck

suhas-developer07 avatar Oct 24 '25 10:10 suhas-developer07

Hi @gauron99, thanks for pointing that out! I’ve restored the func-yaml schema and also completed the EasyCLA verification. Please let me know if any other changes are needed.

suhas-developer07 avatar Oct 24 '25 15:10 suhas-developer07

/ok-to-test

gauron99 avatar Oct 26 '25 13:10 gauron99

please remove the test data from pkg. Theres some absoluteLinks and empty credsStore. These are generated via the tests but not removed yet

gauron99 avatar Oct 29 '25 09:10 gauron99

please remove the test data from pkg. Theres some absoluteLinks and empty credsStore. These are generated via the tests but not removed yet

Thanks for the review! I've removed the test data (including the absolute links) and the empty creditStore. The latest commit includes these changes. Please take another look when you have a moment.

suhas-developer07 avatar Oct 30 '25 13:10 suhas-developer07

ohh shit!! sorry for the previous contribution i thought that full folder needs to delete. in my latest commit i have reclaimed all the files and deleted what extra added to that. Please take another look when you have a moment.

suhas-developer07 avatar Oct 31 '25 04:10 suhas-developer07

Hey @suhas-developer07 just a little suggestion from my side u can use git rebase main ... approach instead of merging (git merge ) while updating your branch it's a good practice and helps maintain a clean , linear commit history !

RayyanSeliya avatar Nov 01 '25 11:11 RayyanSeliya

Hey @suhas-developer07 just a little suggestion from my side u can use git rebase main ... approach instead of merging (git merge ) while updating your branch it's a good practice and helps maintain a clean , linear commit history !

Thanks for the suggestion! Got it — I’ll rebase my branch with main instead of merging going forward to keep the commit history clean.

suhas-developer07 avatar Nov 03 '25 16:11 suhas-developer07

Would it be possible to add a test for this? I know its a bit of a unstandard case

gauron99 avatar Nov 03 '25 17:11 gauron99

Hey @suhas-developer07 just a small suggestion I guess you have created a pr from main it’s not recommended to create a PR directly from your main branch. It’s better to create a separate feature or fix branch for your changes (for example, fix/s2i-build-issue). That way your main stays clean and consistent with the upstream main, making future updates and rebases much smoother ! I see you were facing some issues .. from the comments I have read in this chat no worries take care from now onwards .. ... ! Thx for the contribution !

RayyanSeliya avatar Nov 04 '25 09:11 RayyanSeliya

Almost there? This needs to have ./hack/update-codegen.sh run such that the go.mod is cleaned up.

lkingland avatar Nov 21 '25 03:11 lkingland

Hey @suhas-developer07 just a small suggestion I guess you have created a pr from main it’s not recommended to create a PR directly from your main branch. It’s better to create a separate feature or fix branch for your changes (for example, fix/s2i-build-issue). That way your main stays clean and consistent with the upstream main, making future updates and rebases much smoother ! I see you were facing some issues .. from the comments I have read in this chat no worries take care from now onwards .. ... ! Thx for the contribution !

Thanks for the suggestion @RayyanSeliya! You're right — using a separate feature/fix branch makes things much cleaner. I’ll follow that approach in all future PRs. Appreciate the guidance and support!

suhas-developer07 avatar Nov 22 '25 16:11 suhas-developer07

Almost there? This needs to have ./hack/update-codegen.sh run such that the go.mod is cleaned up.

Thanks @lkingland! I’ve run ./hack/update-codegen.sh and pushed the updated changes. Please let me know if anything else needs to be adjusted.

suhas-developer07 avatar Nov 22 '25 16:11 suhas-developer07