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

gcc: error: unrecognized command-line option '-m64' #2623

Open
alanreynosov opened this issue Dec 18, 2024 · 6 comments
Open

gcc: error: unrecognized command-line option '-m64' #2623

alanreynosov opened this issue Dec 18, 2024 · 6 comments
Assignees

Comments

@alanreynosov
Copy link

alanreynosov commented Dec 18, 2024

latest update for pack builder introduced this error

gcc: error: unrecognized command-line option '-m64'

whole output

Building function image
Pulling image ghcr.io/knative/builder-jammy-tiny:latest
latest: Pulling from knative/builder-jammy-tiny
Digest: sha256:5faa3990416231b26e34c67d6b581991d17c2571c8a3fc279f889429aabdb1e9
Status: Image is up to date for ghcr.io/knative/builder-jammy-tiny:latest
CheckReadAccess succeeded for the run image index.docker.io/paketobuildpacks/run-jammy-tiny:latest
Selected run image index.docker.io/paketobuildpacks/run-jammy-tiny:latest
Pulling image index.docker.io/paketobuildpacks/run-jammy-tiny:latest with platform linux/arm64
latest: Pulling from paketobuildpacks/run-jammy-tiny
Digest: sha256:0c5ac79d549c4b077a7d857631f817f8b573f5da2c109a51f320ee584d44d3f2
Status: Image is up to date for paketobuildpacks/run-jammy-tiny:latest
Creating builder with the following buildpacks:
-> paketo-community/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-community/[email protected]
-> paketo-community/[email protected]
-> paketo-community/[email protected]
-> [email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
-> paketo-buildpacks/[email protected]
Using build cache volume pack-cache-simple-func_latest-e80eea923597.build
Running the creator on OS linux from image pack.local/builder/6e706766706a7a746367:latest with:
Container Settings:
  Args: /cnb/lifecycle/creator -daemon -launch-cache /launch-cache -log-level debug -app /workspace -cache-dir /cache -run-image index.docker.io/paketobuildpacks/run-jammy-tiny:latest -gid 0 -uid 0 trow-areynososw20.dev.gcp.shipwire.com/simple-func:latest
  System Envs: CNB_PLATFORM_API=0.13
  Image: pack.local/builder/6e706766706a7a746367:latest
  User: root
  Labels: map[author:pack]
Host Settings:
  Binds: pack-cache-simple-func_latest-e80eea923597.build:/cache /var/run/docker.sock:/var/run/docker.sock pack-cache-simple-func_latest-e80eea923597.launch:/launch-cache pack-layers-wlsnnyvmrb:/layers pack-app-vbswavzqib:/workspace
  Network Mode: 
Starting creator...
Parsing inputs...
Ensuring privileges...
Executing command...
===> ANALYZING
Timer: Analyzer started at 2024-12-18T16:57:16Z
Found image with identifier "791cb36716fedac1aea16ef59f5299b38bf243dbd7307c08070e97130f420091"
Restoring data for SBOM from previous image
Retrieving previous image SBOM layer for "sha256:31abd3749d049f9eb5d3b6baa2c89ce9cc9b7f53ab6b8bf96c47b46acf58529a"
Found image with identifier "7702ee573a36ee2f2f4199e08bf384c4ca0ae2691c2ca1c2809f6ec06096e34b"
Timer: Analyzer ran for 946.459µs and ended at 2024-12-18T16:57:16Z
Run image info in analyzed metadata is: 
{"Reference":"7702ee573a36ee2f2f4199e08bf384c4ca0ae2691c2ca1c2809f6ec06096e34b","Image":"index.docker.io/paketobuildpacks/run-jammy-tiny:latest","Extend":false,"target":{"os":"linux","arch":"arm64"}}
===> DETECTING
Timer: Detector started at 2024-12-18T16:57:16Z
Checking for match against descriptor: {linux amd64  []}
target distro name/version labels not found, reading /etc/os-release file
Checking for match against descriptor: {linux arm64  []}
Checking for match against descriptor: {linux amd64  []}
Checking for match against descriptor: {linux arm64  []}
Checking for match against descriptor: {linux amd64  []}
Checking for match against descriptor: {linux arm64  []}
Checking for match against descriptor: {linux amd64  []}
Checking for match against descriptor: {linux arm64  []}
Checking for match against descriptor: {linux amd64  []}
Checking for match against descriptor: {linux arm64  []}
Checking for match against descriptor: {   []}
Checking for match against descriptor: {linux   []}
======== Output: paketo-buildpacks/[email protected] ========
SKIPPED: No procfile found from either source path or binding.
======== Results ========
pass: paketo-community/[email protected]
pass: paketo-community/[email protected]
pass: paketo-buildpacks/[email protected]
fail: paketo-community/[email protected]
skip: paketo-buildpacks/[email protected]
======== Results ========
pass: paketo-buildpacks/[email protected]
pass: [email protected]
Resolving plan... (try #1)
paketo-buildpacks/go-dist 2.6.9
dev.knative-extensions.go 0.0.6
Timer: Detector ran for 83.031333ms and ended at 2024-12-18T16:57:16Z
===> RESTORING
Timer: Restorer started at 2024-12-18T16:57:16Z
Restoring Layer Metadata
Reading buildpack directory: /layers/paketo-buildpacks_go-dist
Restoring metadata for "paketo-buildpacks/go-dist:go" from cache
Writing layer metadata for "paketo-buildpacks/go-dist:go"
Reading buildpack directory: /layers/dev.knative-extensions.go
Restoring metadata for "dev.knative-extensions.go:app" from app image
Writing layer metadata for "dev.knative-extensions.go:app"
Reading Buildpack Layers directory /layers
Reading buildpack directory: /layers/paketo-buildpacks_go-dist
Reading buildpack directory item: go.toml
Restoring data for "paketo-buildpacks/go-dist:go" from cache
Reading Buildpack Layers directory /layers
Reading buildpack directory: /layers/dev.knative-extensions.go
Reading buildpack directory item: app.toml
Retrieving data for "sha256:22e7a63a54126295192413b852e36cc5be38bedb9ee4554d85f10d681a29e510"
Restoring data for SBOM from cache
Retrieving SBOM layer data for "sha256:563c93da342376dfdba09dd7db76c14c466096e60149d700a624a0fa280e5d58"
Timer: Restorer ran for 350.030792ms and ended at 2024-12-18T16:57:16Z
===> BUILDING
Timer: Builder started at 2024-12-18T16:57:16Z
target distro name/version labels not found, reading /etc/os-release file
Running build for buildpack paketo-buildpacks/[email protected]
Looking up buildpack
Finding plan
Creating plan directory
Preparing paths
Running build command
Paketo Buildpack for Go Distribution 2.6.9
  Resolving Go version
    Candidate version sources (in priority order):
      <unknown> -> ""

    Selected Go version (using <unknown>): 1.22.10

  Reusing cached layer /layers/paketo-buildpacks_go-dist/go

Processing layers
Updating environment
Reading output files
Updating buildpack processes
Updating process list
Finished running build for buildpack paketo-buildpacks/[email protected]
Running build for buildpack [email protected]
Looking up buildpack
Finding plan
Creating plan directory
Preparing paths
Running build command
> Knative Functions Go Buildpack
  Fetching framework dependencies
go: downloading github.com/cloudevents/sdk-go v1.2.0
go: downloading github.com/cloudevents/sdk-go/v2 v2.15.2
go: downloading github.com/go-chi/chi/v5 v5.2.0
go: downloading github.com/go-chi/chi v1.5.5
go: downloading go.uber.org/zap v1.10.0
go: downloading github.com/google/uuid v1.1.1
go: downloading github.com/json-iterator/go v1.1.10
go: downloading github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
go: downloading github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421
go: downloading go.uber.org/multierr v1.1.0
go: downloading go.uber.org/atomic v1.4.0
go: added github.com/cloudevents/sdk-go/v2 v2.15.2
go: added github.com/go-chi/chi/v5 v5.2.0
go: added github.com/google/uuid v1.1.1
go: added github.com/json-iterator/go v1.1.10
go: added github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421
go: added github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
go: added go.uber.org/atomic v1.4.0
go: added go.uber.org/multierr v1.1.0
go: added go.uber.org/zap v1.10.0
  Executing: go build -o /workspace/bin/faas /workspace/faas
# runtime/cgo
gcc: error: unrecognized command-line option '-m64'
Timer: Builder ran for 15.638939091s and ended at 2024-12-18T16:57:32Z
ERROR: failed to build: exit status 1


Error: failed to build the function: executing lifecycle: failed with status code: 51```

OS: macOS
@alanreynosov
Copy link
Author

workaroud was to specify builderImages pointing to previous image builder ghcr.io/knative/builder-jammy-tiny:0.0.307 in func.yaml

@matejvasek
Copy link
Contributor

@alanreynosov recently I added mult-arch tiny builders so there are two images actually behind it: one for amd64 and one for arm64.

@matejvasek
Copy link
Contributor

One possible workaround:
set CGO_ENABLED=0 that should avoid calls to gcc.

@matejvasek
Copy link
Contributor

I added mult-arch tiny builders so there are two images actually behind it: one for amd64 and one for arm64.

There is one more batch of changes required to fix Go. But I did not mage do it before holidays. Sorry.
But at least Java should work.

@matejvasek matejvasek self-assigned this Dec 23, 2024
@matejvasek
Copy link
Contributor

Related to: #2617

@alanreynosov
Copy link
Author

Hi @matejvasek thanks for following up this,

I've added CGO_ENABLED like this to func.yaml, but not working,

buildEnvs:

  • name: CGO_ENABLED
    value: 0

it looks I am missing something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants