How to contribute this?

356 views
Skip to first unread message

FAMASoon ch

unread,
Nov 24, 2023, 7:32:25 PM11/24/23
to WebP Discussion
Hello,
I fixed some security issue with static code analytics.
And I would like to create a pull request for this change.
https://chromium.googlesource.com/webm/libwebp/+/HEAD/CONTRIBUTING.md
However, I could not get it to work by trying this method.

````
❯ git push https://chromium-review.googlesource.com/webm/libwebp HEAD:refs/for/main

remote: INVALID_ARGUMENT: Request contains an invalid argument
remote: [type.googleapis.com/google.rpc.LocalizedMessage]
remote: locale: "en-US"
remote: message: "Invalid authentication credentials. Please generate a new identifier: https://chromium.googlesource.com/new-password"
remote: [type.googlego.rpc.LocalizedMessage
remote: [type.googleapis.com/google.rpc.RequestInfo]
remote: request_id: "7b852bc9f125425cadb1b82511e98287"
fatal: unable to access 'https://chromium-review.googlesource.com/webm/libwebp/': The requested URL returned error: 400
````

How can I create a pull request?

FAMASoon ch

unread,
Nov 25, 2023, 2:24:45 AM11/25/23
to WebP Discussion, FAMASoon ch
I get password, and push success, I resolve it.
Sorry, Thanks
Regards

2023年11月25日土曜日 9:32:25 UTC+9 FAMASoon ch:

FAMASoon ch

unread,
Nov 25, 2023, 4:29:39 PM11/25/23
to WebP Discussion, FAMASoon ch
I open PR, https://chromium-review.googlesource.com/c/webm/libwebp/+/5060108/1
Hownever, that build is failed.
I saw the error message, but I'm not sure why the error is happening.
How can we solve this error?

```
Started by upstream project "libwebp__commit_trigger
" build number 6849 originally caused by: Triggered by Gerrit: https://chromium-review.googlesource.com/#/c/5060108/ Running as SYSTEM Building remotely on node-009 (fuzz) in workspace /var/jenkins/workspace/libwebp__patch_check The recommended git tool is: NONE No credentials specified > git rev-parse --resolve-git-dir /var/jenkins/workspace/libwebp__patch_check/.git # timeout=10 ERROR: Workspace has a .git repository, but it appears to be corrupt. hudson.plugins.git.GitException: Command "git rev-parse --resolve-git-dir /var/jenkins/workspace/libwebp__patch_check/.git" returned status code 128: stdout: stderr: fatal: not a gitdir '/var/jenkins/workspace/libwebp__patch_check/.git' at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2842) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2762) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2757) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:2051) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:2063) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.hasGitRepo(CliGitAPIImpl.java:405) at hudson.plugins.git.GitAPI.hasGitRepo(GitAPI.java:281) at jdk.internal.reflect.GeneratedMethodAccessor102.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:924) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:902) at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:853) at hudson.remoting.UserRequest.perform(UserRequest.java:211) at hudson.remoting.UserRequest.perform(UserRequest.java:54) at hudson.remoting.Request$2.run(Request.java:377) at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Cloning the remote Git repository Honoring refspec on initial clone Cloning repository /var/jenkins/git/libwebp.git > git init /var/jenkins/workspace/libwebp__patch_check # timeout=10 Fetching upstream changes from /var/jenkins/git/libwebp.git > git --version # timeout=10 > git --version # 'git version 2.30.2' > git fetch --tags --force --progress -- /var/jenkins/git/libwebp.git refs/changes/08/5060108/1 # timeout=10 > git config remote.origin.url /var/jenkins/git/libwebp.git # timeout=10 > git config --add remote.origin.fetch refs/changes/08/5060108/1 # timeout=10 Avoid second fetch > git rev-parse FETCH_HEAD^{commit} # timeout=10 Checking out Revision f6c350a6f10d2993c6d2da7184eca96ce450251c (main) > git config core.sparsecheckout # timeout=10 > git checkout -f f6c350a6f10d2993c6d2da7184eca96ce450251c # timeout=10 Commit message: "Multiplication result converted to larger type" > git rev-parse FETCH_HEAD^{commit} # timeout=10 > git rev-list --no-walk 89c5b917463c07bfb5b6390b81d258c49d5fe8c6 # timeout=10 [libwebp__patch_check] $ /bin/bash /var/jenkins/tmp/jenkins16735456818987998674.sh ANDROID_HOME=/opt/android-sdk ANDROID_NDK_DIR=/opt/android-sdk/ndk/25.0.8775105 BUILD_DISPLAY_NAME=#3201 BUILD_ID=3201 BUILD_NUMBER=3201 BUILD_TAG=jenkins-libwebp__patch_check-3201 BUILD_URL=https://build.webmproject.org/jenkins/job/libwebp__patch_check/3201/ CI=true DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/999/bus EXECUTOR_NUMBER=2 GERRIT_BRANCH=main GERRIT_CHANGE_ID=I7579362162bcbb322d39228b53c16b9729eb41fe GERRIT_CHANGE_NUMBER=5060108 GERRIT_CHANGE_PRIVATE_STATE=false GERRIT_CHANGE_SUBJECT=Multiplication result converted to larger type GERRIT_CHANGE_URL=https://chromium-review.googlesource.com/#/c/5060108/ GERRIT_CHANGE_WIP_STATE=false GERRIT_EVENT_HASH=-783670369 GERRIT_EVENT_TYPE=patchset-created GERRIT_HOST=jenkins GERRIT_NAME=chromium-review.googlesource GERRIT_PATCHSET_NUMBER=1 GERRIT_PATCHSET_REVISION=f6c350a6f10d2993c6d2da7184eca96ce450251c GERRIT_PORT=29418 GERRIT_PROJECT=webm/libwebp GERRIT_REFSPEC=refs/changes/08/5060108/1 GERRIT_SCHEME=ssh GERRIT_VERSION=2.5.4 GIT_AUTHOR_EMAIL=jen...@webmproject.org GIT_AUTHOR_NAME=Jenkins GIT_BRANCH=main GIT_COMMIT=f6c350a6f10d2993c6d2da7184eca96ce450251c GIT_COMMITTER_EMAIL=jen...@webmproject.org GIT_COMMITTER_NAME=Jenkins GIT_PREVIOUS_COMMIT=95c622addec5041c1ac2f5fd869dee44e92b441c GIT_PREVIOUS_SUCCESSFUL_COMMIT=95c622addec5041c1ac2f5fd869dee44e92b441c GIT_URL=/var/jenkins/git/libwebp.git GRADLE_OPTS=-Dgradle.user.home=/var/jenkins/home/.gradle -Dhttps.proxyHost=bastion -Dhttps.proxyPort=3128 HOME=/var/jenkins HUDSON_HOME=/var/jenkins/home HUDSON_URL=https://build.webmproject.org/jenkins/ JENKINS_HOME=/var/jenkins/home JENKINS_URL=https://build.webmproject.org/jenkins/ JOB_BASE_NAME=libwebp__patch_check JOB_DISPLAY_URL=https://build.webmproject.org/jenkins/job/libwebp__patch_check/display/redirect JOB_NAME=libwebp__patch_check JOB_URL=https://build.webmproject.org/jenkins/job/libwebp__patch_check/ LANG=C.UTF-8 LOGNAME=jenkins MOTD_SHOWN=pam NODE_LABELS=node-009 fuzz NODE_NAME=node-009 OLDPWD=/var/jenkins PATH=/usr/local/bin:/usr/bin:/bin:/usr/games PWD=/var/jenkins/workspace/libwebp__patch_check RUN_ARTIFACTS_DISPLAY_URL=https://build.webmproject.org/jenkins/job/libwebp__patch_check/3201/display/redirect?page=artifacts RUN_CHANGES_DISPLAY_URL=https://build.webmproject.org/jenkins/job/libwebp__patch_check/3201/display/redirect?page=changes RUN_DISPLAY_URL=https://build.webmproject.org/jenkins/job/libwebp__patch_check/3201/display/redirect RUN_TESTS_DISPLAY_URL=https://build.webmproject.org/jenkins/job/libwebp__patch_check/3201/display/redirect?page=tests SHELL=/bin/sh SHLVL=0 SSH_CLIENT=10.240.0.103 58634 22 SSH_CONNECTION=10.240.0.103 58634 10.240.0.142 22 UNIQUE_ID=jenkins-libwebp__commit_trigger-6849 USER=jenkins WORKSPACE=/var/jenkins/workspace/libwebp__patch_check WORKSPACE_TMP=/var/jenkins/workspace/libwebp__patch_check@tmp XDG_RUNTIME_DIR=/run/user/999 XDG_SESSION_CLASS=user XDG_SESSION_ID=11951 XDG_SESSION_TYPE=tty _=/usr/bin/env https_proxy=http://bastion:3128 commit f6c350a6f10d2993c6d2da7184eca96ce450251c Author: FAMASoon <fama...@gmail.com> Date: Sat Nov 25 16:19:45 2023 +0900 Multiplication result converted to larger type Change-Id: I7579362162bcbb322d39228b53c16b9729eb41fe 668e1dd44f7594610b805f8ef8b7d7964777d3e2 Source files with lines longer than 80 characters, split them and post a new patch: examples/cwebp.c(135): (uint8_t*)WebPMalloc((unsigned long) mb_w * mb_h * sizeof(*pic->extra_info)); extras/get_disto.c(168): uint8_t* const plane1 = (uint8_t*)malloc((unsigned long) 2 * w * h * sizeof(*plane1)); imageio/pnmdec.c(243): memcpy(tmp_rgb, in, (unsigned long) info.depth * info.width * sizeof(*in)); imageio/webpdec.c(196): output_buffer->u.RGBA.size = (size_t) output_buffer->u.RGBA.stride * pic->height; imageio/webpdec.c(208): output_buffer->u.YUVA.u_size = (size_t) (pic->height + 1) / 2 * pic->uv_stride; imageio/webpdec.c(209): output_buffer->u.YUVA.v_size = (size_t) (pic->height + 1) / 2 * pic->uv_stride; sharpyuv/sharpyuv.c(322): fixed_y_t* const tmp_buffer = SAFE_ALLOC((uint64_t) w * 3, 2, fixed_y_t); // scratch sharpyuv/sharpyuv.c(327): fixed_t* const target_uv_base = SAFE_ALLOC((uint64_t) uv_w * 3, uv_h, fixed_t); src/dec/frame_dec.c(691): (unsigned long) mb_w * (dec->mt_method_ > 0 ? 2 : 1) * sizeof(VP8FInfo) src/dec/frame_dec.c(695): (unsigned long) (dec->mt_method_ == 2 ? 2 : 1) * mb_w * sizeof(*dec->mb_data_); src/enc/vp8l_enc.c(1882): memset(picture->extra_info, 0, (unsigned long) mb_w * (unsigned long) mb_h * sizeof(*picture->extra_info)); src/enc/webp_enc.c(153): const size_t preds_size = (unsigned long) preds_w * (unsigned long) preds_h * sizeof(*enc->preds_); src/enc/webp_enc.c(156): const size_t info_size = (unsigned long) mb_w * (unsigned long) mb_h * sizeof(*enc->mb_info_); src/mux/anim_encode.c(1447): config.output.u.RGBA.size = (size_t) config.output.u.RGBA.stride * (size_t) sub_image.height; src/utils/palette.c(310): (uint32_t*)WebPSafeCalloc((uint64_t) num_colors * num_colors, sizeof(*cooccurrence)); src/utils/quant_levels_dec_utils.c(220): const size_t size_scratch_m = ((unsigned int) R + 1) * width * sizeof(*p->start_); Build step 'Execute shell' marked build as failure [WS-CLEANUP] Deleting project workspace... [WS-CLEANUP] Deferred wipeout is disabled by the node property... [WS-CLEANUP] done Finished: FAILURE
```

2023年11月25日土曜日 16:24:45 UTC+9 FAMASoon ch:

Yannis Guyon

unread,
Nov 26, 2023, 11:48:33 AM11/26/23
to WebP Discussion, fama...@gmail.com
Thank you for contribution.
The Jenkins output you pasted contains the failure reason:
"Source files with lines longer than 80 characters, split them and post a new patch"
Lines in libwebp files contain at most 80 characters, so just split any changed line that is longer than this threshold for consistency.

FAMASoon ch

unread,
Nov 26, 2023, 8:36:30 PM11/26/23
to WebP Discussion, Yannis Guyon, fama...@gmail.com
Thank you for your confirmation.
I found that more than 80 characters is not good.
So I thought I would format it in Google style.
Unfortunately, I am not familiar with clang-format and cannot make the style consistent.

````
find . / -iname *.c | xargs clang-format --style=Google -i
zsh: no matches found: *.c
error: cannot use -i when reading from stdin.
```

How can I solve this problem? (or style format someone help me)

2023年11月27日月曜日 1:48:33 UTC+9 Yannis Guyon:

Yannis Guyon

unread,
Nov 27, 2023, 3:55:19 AM11/27/23
to WebP Discussion, fama...@gmail.com, Yannis Guyon
libwebp changes are historically formatted manually.
I never used it myself but you may try git clang-format to format only the lines you changed (to avoid introducing unrelated formatting changes to libwebp in your proposal).

Corentin Le Molgat

unread,
Nov 27, 2023, 4:06:55 AM11/27/23
to WebP Discussion, FAMASoon ch, Yannis Guyon
did you try:
```sh
find . / -iname *.c -print0 | xargs -0 clang-format --style=Google -i
```

From man xargs:
OPTIONS
       -0, --null
              Input  items  are  terminated by a null character instead of by whitespace, and the quotes and backslash are not special (every character is taken literally).  Disables the end of file string, which is treated like any other argument.
              Useful when input items might contain white space, quote marks, or backslashes.  The GNU find -print0 option produces input suitable for this mode.

FAMASoon ch

unread,
Nov 27, 2023, 5:03:07 AM11/27/23
to WebP Discussion, Corentin Le Molgat, FAMASoon ch, Yannis Guyon
Thank you all.
I now understand how to format it.
I will try it!
Thank you so much.
2023年11月27日月曜日 18:06:55 UTC+9 Corentin Le Molgat:
Reply all
Reply to author
Forward
0 new messages