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

Fix flags typo #3327

Merged
merged 2 commits into from
Jun 26, 2023
Merged

Fix flags typo #3327

merged 2 commits into from
Jun 26, 2023

Conversation

caiocfer
Copy link
Contributor

Found typo when building cAdvisor that was preventing Perf event metrics from being available.
And tags were passed to build as "-tags=-tags=libfpm,netgo,libipmctl".

@google-cla
Copy link

google-cla bot commented Jun 14, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@k8s-ci-robot
Copy link
Collaborator

Hi @caiocfer. Thanks for your PR.

I'm waiting for a google 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/test-infra repository.

iwankgb
iwankgb previously approved these changes Jun 18, 2023
@iwankgb
Copy link
Collaborator

iwankgb commented Jun 18, 2023

/ok-to-test

@iwankgb iwankgb dismissed their stale review June 18, 2023 15:18

I want to see container being build.

@iwankgb
Copy link
Collaborator

iwankgb commented Jun 18, 2023

@caiocfer merge master to your branch, please.

@iwankgb iwankgb merged commit 95a0427 into google:master Jun 26, 2023
@bobbypage
Copy link
Collaborator

bobbypage commented Oct 31, 2023

This has broke the build (or it was broken before as well now that the typo has been fixed):

#18 [build 12/12] RUN export GO_TAGS="libpfm,netgo";     if [ "$(uname --machine)" = "x86_64" ]; then           export GO_TAGS="$GO_TAGS,libipmctl";     fi;     GO_FLAGS="-tags=$GO_TAGS" ./build/build.sh
#18 1.099 >> building cadvisor
#18 122.5 # github.com/google/cadvisor/perf
#18 122.5 ../perf/collector_libpfm.go:256:34: cannot use _Ctype_ulong(unsafe.Sizeof(unix.PerfEventAttr{})) (constant 128 of type _Ctype_ulong) as _Ctype_uint value in argument to (_Cfunc__CMalloc)
#18 122.5 ../perf/collector_libpfm.go:258:61: cannot use _Ctype_ulong(unsafe.Sizeof(unix.PerfEventAttr{})) (constant 128 of type _Ctype_ulong) as _Ctype_uint value in variable declaration
#18 122.5 ../perf/collector_libpfm.go:272:15: cannot use _Ctype_ulong(unsafe.Sizeof(event)) (constant 24 of type _Ctype_ulong) as _Ctype_uint value in assignment
#18 ERROR: process "/bin/sh -c export GO_TAGS=\"libpfm,netgo\";     if [ \"$(uname --machine)\" = \"x86_64\" ]; then           export GO_TAGS=\"$GO_TAGS,libipmctl\";     fi;     GO_FLAGS=\"-tags=$GO_TAGS\" ./build/build.sh" did not complete successfully: exit code: 1
------
 > [build 12/12] RUN export GO_TAGS="libpfm,netgo";     if [ "$(uname --machine)" = "x86_64" ]; then           export GO_TAGS="$GO_TAGS,libipmctl";     fi;     GO_FLAGS="-tags=$GO_TAGS" ./build/build.sh:
#18 1.099 >> building cadvisor
#18 122.5 # github.com/google/cadvisor/perf
#18 122.5 ../perf/collector_libpfm.go:256:34: cannot use _Ctype_ulong(unsafe.Sizeof(unix.PerfEventAttr{})) (constant 128 of type _Ctype_ulong) as _Ctype_uint value in argument to (_Cfunc__CMalloc)
#18 122.5 ../perf/collector_libpfm.go:258:61: cannot use _Ctype_ulong(unsafe.Sizeof(unix.PerfEventAttr{})) (constant 128 of type _Ctype_ulong) as _Ctype_uint value in variable declaration
#18 122.5 ../perf/collector_libpfm.go:272:15: cannot use _Ctype_ulong(unsafe.Sizeof(event)) (constant 24 of type _Ctype_ulong) as _Ctype_uint value in assignment
------
Dockerfile:43
--------------------
  42 |     # libipmctl only works on x86_64 CPUs.
  43 | >>> RUN export GO_TAGS="libpfm,netgo"; \
  44 | >>>     if [ "$(uname --machine)" = "x86_64" ]; then \
  45 | >>>           export GO_TAGS="$GO_TAGS,libipmctl"; \
  46 | >>>     fi; \
  47 | >>>     GO_FLAGS="-tags=$GO_TAGS" ./build/build.sh
  48 |
--------------------
ERROR: failed to solve: process "/bin/sh -c export GO_TAGS=\"libpfm,netgo\";     if [ \"$(uname --machine)\" = \"x86_64\" ]; then           export GO_TAGS=\"$GO_TAGS,libipmctl\";     fi;     GO_FLAGS=\"-tags=$GO_TAGS\" ./build/build.sh" did not complete successfully: exit code: 1
make: *** [Makefile:69: release] Error 1

@caiocfer
Copy link
Contributor Author

Are you on a specific branch? Just tried to build and it went fine:

 => [build  7/12] ADD go.mod go.sum ./                                                                                              0.0s  => [build  8/12] RUN go mod download                                                                                              31.8s 
 => [build  9/12] ADD cmd/go.mod cmd/go.sum ./cmd/                                                                                  0.1s 
 => [build 10/12] RUN cd cmd && go mod download                                                                                    40.5s 
 => [build 11/12] ADD . .                                                                                                           0.4s 
 => [build 12/12] RUN export GO_TAGS="libpfm,netgo";     if [ "$(uname --machine)" = "x86_64" ]; then           export GO_TAGS="$  32.0s
 => [stage-1 3/5] COPY --from=build /usr/local/lib/libpfm.so* /usr/local/lib/                                                       0.1s 
 => [stage-1 4/5] COPY --from=build /usr/local/lib/libipmctl.so* /usr/local/lib/                                                    0.1s
 => [stage-1 5/5] COPY --from=build /go/src/github.com/google/cadvisor/_output/cadvisor /usr/bin/cadvisor                           0.2s
 => exporting to image                                                                                                              0.3s
 => => exporting layers                                                                                                             0.2s
 => => writing image sha256:a465c09300cfa83556bde90ce013fe9c544aaa6f4ceccd9548be74a437e9d310                                        0.0s
 => => naming to docker.io/caio/cadvisor:beta 

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

Successfully merging this pull request may close these issues.

4 participants