public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* post-commit hook failure
@ 2021-08-25 15:27 Lewis Hyatt
  2021-08-25 15:45 ` Martin Liška
  2021-08-25 16:14 ` Joseph Myers
  0 siblings, 2 replies; 5+ messages in thread
From: Lewis Hyatt @ 2021-08-25 15:27 UTC (permalink / raw)
  To: gcc

Hello-

I wanted to note I got some errors when pushing this commit:

commit 3ac6b5cff1eca4e1748c671960ef7b4ca5e47fd2 (HEAD -> master,
origin/trunk, origin/master, origin/HEAD)
Author: Lewis Hyatt <lhyatt@gmail.com>
Date:   Tue Aug 24 19:30:44 2021 -0400

    diagnostics: Support for -finput-charset [PR93067]

The errors were:

remote: Traceback (most recent call last):
remote:   File "hooks/post_receive.py", line 118, in <module>
remote:     post_receive(refs_data, args.submitter_email)
remote:   File "hooks/post_receive.py", line 65, in post_receive
remote:     submitter_email)
remote:   File "hooks/post_receive.py", line 47, in post_receive_one
remote:     update.send_email_notifications()
remote:   File "/sourceware1/projects/src-home/git-hooks/hooks/updates/__init__.py",
line 189, in send_email_notifications
remote:     self.__email_new_commits()
remote:   File "/sourceware1/projects/src-home/git-hooks/hooks/updates/__init__.py",
line 1031, in __email_new_commits
remote:     commit, self.get_standard_commit_email(commit))
remote:   File "/sourceware1/projects/src-home/git-hooks/hooks/updates/__init__.py",
line 1011, in __send_commit_email
remote:     default_diff=email.diff)
remote:   File "/sourceware1/projects/src-home/git-hooks/hooks/updates/__init__.py",
line 946, in __maybe_get_email_custom_contents
remote:     hook_input=json.dumps(hooks_data),
remote:   File "/usr/lib64/python2.7/json/__init__.py", line 244, in dumps
remote:     return _default_encoder.encode(obj)
remote:   File "/usr/lib64/python2.7/json/encoder.py", line 207, in encode
remote:     chunks = self.iterencode(o, _one_shot=True)
remote:   File "/usr/lib64/python2.7/json/encoder.py", line 270, in iterencode
remote:     return _iterencode(o, 0)
remote: UnicodeDecodeError: 'utf8' codec can't decode byte 0xf5 in
position 14638: invalid start byte


I think the commit has pushed fine, however some expected things did
not happen such as updating Bugzilla. The error makes some sense
because this commit added tests with non-standard encodings, while
python3 wants everything it reads to be utf-8 by default. I wanted to
mention in case it breaks some other things, such as ChangeLog
updating, that need to be addressed... Please let me know if I should
have done something different here. Thanks!

-Lewis

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: post-commit hook failure
  2021-08-25 15:27 post-commit hook failure Lewis Hyatt
@ 2021-08-25 15:45 ` Martin Liška
  2021-08-25 15:56   ` Michael Matz
  2021-08-25 16:14 ` Joseph Myers
  1 sibling, 1 reply; 5+ messages in thread
From: Martin Liška @ 2021-08-25 15:45 UTC (permalink / raw)
  To: Lewis Hyatt, gcc

On 8/25/21 17:27, Lewis Hyatt via Gcc wrote:
> Hello-
> 
> I wanted to note I got some errors when pushing this commit:
> 
> commit 3ac6b5cff1eca4e1748c671960ef7b4ca5e47fd2 (HEAD -> master,
> origin/trunk, origin/master, origin/HEAD)
> Author: Lewis Hyatt <lhyatt@gmail.com>
> Date:   Tue Aug 24 19:30:44 2021 -0400
> 
>      diagnostics: Support for -finput-charset [PR93067]
> 
> The errors were:
> 
> remote: Traceback (most recent call last):
> remote:   File "hooks/post_receive.py", line 118, in <module>
> remote:     post_receive(refs_data, args.submitter_email)
> remote:   File "hooks/post_receive.py", line 65, in post_receive
> remote:     submitter_email)
> remote:   File "hooks/post_receive.py", line 47, in post_receive_one
> remote:     update.send_email_notifications()
> remote:   File "/sourceware1/projects/src-home/git-hooks/hooks/updates/__init__.py",
> line 189, in send_email_notifications
> remote:     self.__email_new_commits()
> remote:   File "/sourceware1/projects/src-home/git-hooks/hooks/updates/__init__.py",
> line 1031, in __email_new_commits
> remote:     commit, self.get_standard_commit_email(commit))
> remote:   File "/sourceware1/projects/src-home/git-hooks/hooks/updates/__init__.py",
> line 1011, in __send_commit_email
> remote:     default_diff=email.diff)
> remote:   File "/sourceware1/projects/src-home/git-hooks/hooks/updates/__init__.py",
> line 946, in __maybe_get_email_custom_contents
> remote:     hook_input=json.dumps(hooks_data),
> remote:   File "/usr/lib64/python2.7/json/__init__.py", line 244, in dumps
> remote:     return _default_encoder.encode(obj)
> remote:   File "/usr/lib64/python2.7/json/encoder.py", line 207, in encode
> remote:     chunks = self.iterencode(o, _one_shot=True)
> remote:   File "/usr/lib64/python2.7/json/encoder.py", line 270, in iterencode
> remote:     return _iterencode(o, 0)
> remote: UnicodeDecodeError: 'utf8' codec can't decode byte 0xf5 in
> position 14638: invalid start byte

Oh yeah. Well, to be honest we somehow mix Python2 and Python3 script in the server hooks.

> 
> 
> I think the commit has pushed fine, however some expected things did
> not happen such as updating Bugzilla. The error makes some sense
> because this commit added tests with non-standard encodings, while
> python3 wants everything it reads to be utf-8 by default. I wanted to
> mention in case it breaks some other things, such as ChangeLog
> updating, that need to be addressed... Please let me know if I should
> have done something different here. Thanks!

I believe ChangeLog will be updated correctly as we don't read content of the changes:

$ ./contrib/gcc-changelog/git_check_commit.py 3ac6b5cff1eca4e1748c671960ef7b4ca5e47fd2 -p
------ gcc/c-family/ChangeLog ------

2021-08-25  Lewis Hyatt  <lhyatt@gmail.com>



	PR other/93067

	* c-opts.c (c_common_input_charset_cb): New function.

	(c_common_post_options): Call new function

	diagnostic_initialize_input_context().

------ gcc/d/ChangeLog ------

2021-08-25  Lewis Hyatt  <lhyatt@gmail.com>



	PR other/93067

...

So no action is needed for now I think.

Martin

> 
> -Lewis
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: post-commit hook failure
  2021-08-25 15:45 ` Martin Liška
@ 2021-08-25 15:56   ` Michael Matz
  2021-08-26  7:45     ` Martin Liška
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Matz @ 2021-08-25 15:56 UTC (permalink / raw)
  To: Martin Liška; +Cc: Lewis Hyatt, gcc

Hello,

On Wed, 25 Aug 2021, Martin Liška wrote:

> > remote:   File "hooks/post_receive.py", line 47, in post_receive_one
> > remote:     update.send_email_notifications()
> > remote:   File
> > "/sourceware1/projects/src-home/git-hooks/hooks/updates/__init__.py",
...
> > remote: UnicodeDecodeError: 'utf8' codec can't decode byte 0xf5 in
> > position 14638: invalid start byte
...
> I believe ChangeLog will be updated correctly as we don't read content 
> of the changes:

But the email notifications (and bugzilla updating) isn't done if that 
place throws, so that should eventually be made more robust in the future.


Ciao,
Michael.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: post-commit hook failure
  2021-08-25 15:27 post-commit hook failure Lewis Hyatt
  2021-08-25 15:45 ` Martin Liška
@ 2021-08-25 16:14 ` Joseph Myers
  1 sibling, 0 replies; 5+ messages in thread
From: Joseph Myers @ 2021-08-25 16:14 UTC (permalink / raw)
  To: Lewis Hyatt; +Cc: gcc

On Wed, 25 Aug 2021, Lewis Hyatt via Gcc wrote:

> I think the commit has pushed fine, however some expected things did
> not happen such as updating Bugzilla. The error makes some sense
> because this commit added tests with non-standard encodings, while
> python3 wants everything it reads to be utf-8 by default. I wanted to
> mention in case it breaks some other things, such as ChangeLog
> updating, that need to be addressed... Please let me know if I should
> have done something different here. Thanks!

See <https://github.com/AdaCore/git-hooks/issues/19>.  Commits that aren't 
UTF-8 should be very rare, even if not just the one commit per year 
updating libcpp .po files.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: post-commit hook failure
  2021-08-25 15:56   ` Michael Matz
@ 2021-08-26  7:45     ` Martin Liška
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Liška @ 2021-08-26  7:45 UTC (permalink / raw)
  To: Michael Matz; +Cc: Lewis Hyatt, gcc, Joel Brobecker

On 8/25/21 17:56, Michael Matz wrote:
> Hello,
> 
> On Wed, 25 Aug 2021, Martin Liška wrote:
> 
>>> remote:   File "hooks/post_receive.py", line 47, in post_receive_one
>>> remote:     update.send_email_notifications()
>>> remote:   File
>>> "/sourceware1/projects/src-home/git-hooks/hooks/updates/__init__.py",
> ...
>>> remote: UnicodeDecodeError: 'utf8' codec can't decode byte 0xf5 in
>>> position 14638: invalid start byte
> ...
>> I believe ChangeLog will be updated correctly as we don't read content
>> of the changes:
> 
> But the email notifications (and bugzilla updating) isn't done if that
> place throws, so that should eventually be made more robust in the future.

Yes. I know Joel is working towards porting the https://github.com/AdaCore/git-hooks
to Python3.

I'm adding him to CC in order to notify him about the problem we've just had.

Cheers,
Martin

> 
> 
> Ciao,
> Michael.
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-26  7:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25 15:27 post-commit hook failure Lewis Hyatt
2021-08-25 15:45 ` Martin Liška
2021-08-25 15:56   ` Michael Matz
2021-08-26  7:45     ` Martin Liška
2021-08-25 16:14 ` Joseph Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).