GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Bug fix/fix error handling by dothebart · Pull Request #1925 · nodejs/node-gyp

Conversation

@dothebart

@dothebart dothebart commented Oct 16, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

these 3 changes seem to be related to the python 3 migration, the parameter types aren't compatible.

sys.stderr.write(p_stderr) will throw with: TypeError: write() argument must be str, not bytes ; the followup comment references python 2.5, raising the error gives the correct behaviour.

I ran into this error by a gyp line spawning a process exiting errnously.

The None as a parameter to eval __builtins__ leads to the exception Exception: 'NoneType' object is not subscriptable.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jjrice2233 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
dothebart added 3 commits October 16, 2019 16:29
@dothebart
sys.stderr.write(p_stderr) with python 3 errors out with: `TypeError:…
439a8e8
… write() argument must be str, not bytes`.

It seems to me that its unneccesary, and it should simply throw the exception instead.
@dothebart
It seems python 3 doesn't linke None as a parameter here, it will t…
25c6a69
…hrow: `Exception: 'NoneType' object is not subscriptable`.
@dothebart
properly encode strings before handing them over to hashlib.sha
19012c8
@dothebart

dothebart commented Oct 16, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author
    cmddigest = hashlib.sha1(command if command else self.target).hexdigest()
TypeError: Unicode-objects must be encoded before hashing

fixed by the 3rd commit.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cclauss
cclauss reviewed Oct 16, 2019
View reviewed changes
Comment thread gyp/pylib/gyp/generator/make.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

dothebart added 2 commits October 17, 2019 10:39
@dothebart
fix encoding as sugested by @cclaus
34dcfad
@dothebart
as seen in GYP3 this seems to be the solution here too
b695898
@dothebart dothebart mentioned this pull request Oct 17, 2019
fix error handling refack/GYP3#57
Open
@cclauss

cclauss commented Oct 17, 2019

Copy link
Copy Markdown
Contributor

I am +1 if we are sure these changes are compatible with both Py2 and Py3.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dothebart

dothebart commented Oct 17, 2019

Copy link
Copy Markdown
Contributor Author

doesn't error out with python 2 on debian testing.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rvagg

rvagg commented Oct 17, 2019

Copy link
Copy Markdown
Member

@dothebart what's the situation that's causing this error to be experienced? how could we go about reproducing it?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dothebart

dothebart commented Oct 18, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@rvagg I was putting in the complete directory as V8_ROOT from the outside in, and it seems as if gyp can only handle relative paths for source files - at least with the makefile generator. I reverted to relative paths, and this is working now.

But if its not supported to have absolute paths on filenames, gyp should rather error out; If I get it correctly it needs them relative to the location of the gyp-file - so 'stat' ing files, and ruling out absolute paths could keep people from running into misery.

[edit - wrong issue, will create an issue for this one]

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dothebart

dothebart commented Oct 18, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

one of these issues was caused by a sub process erroring out - here due to non-python3-ness:

'<!<(PYTHON_EXECUTABLE) -c "import sys; print sys.byteorder ")',

so probably invoking /bin/false could reproduce it?

the other one was caused by this section in features.gypi for me:

      [ 'component and "library" in component',
         {
        'is_component_build': 1,
      }, {
        'is_component_build': 0,
      }],

in this context:
https://github.com/arangodb/arangodb/blob/feature/upgrade-v8/3rdParty/V8/v7.1.302.28/gypfiles/features.gypi

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rvagg

rvagg commented Oct 20, 2019

Copy link
Copy Markdown
Member

sounds reasonable, @cclauss over to you I think

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cclauss
cclauss requested changes Oct 22, 2019
View reviewed changes
Comment thread gyp/pylib/gyp/input.py
@@ -911,9 +911,7 @@ def ExpandVariables(input, phase, variables, build_file):
p_stdout, p_stderr = p.communicate('')

@cclauss cclauss Oct 22, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, my preference would be the solution we use elsewhere:

if bytes != str:  # Python 3
    p_stdout = p_stdout.decode('utf-8')
    p_stderr = p_stderr.decode('utf-8')

And then revert the change to line 914.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@cclauss cclauss Oct 24, 2019

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1937

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rvagg

rvagg commented Oct 30, 2019

Copy link
Copy Markdown
Member

@cclauss if you think this is important enough please take over the PR, submit a new one or whatever needs to be done so we can progress and get 6.0.1 out. If it's not that important then we'll just hold off on it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dothebart

dothebart commented Oct 30, 2019

Copy link
Copy Markdown
Contributor Author

Sorry bit under stress @cclauss sent you an invite to my fork so you can make yourselves home ;)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

cclauss added 2 commits October 30, 2019 15:27
@cclauss
Revert the addition of a blank line
15a0ded
@cclauss
Revert stderr.decode("utf-8") that was landed in nodejs#1937
cea42a4
nodejs#1937
cclauss
cclauss approved these changes Oct 30, 2019
View reviewed changes

@cclauss cclauss left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made two reverts to this PR and now I fully support the remaining modifications. Thanks @dothebart for your patience and persistence.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dothebart

dothebart commented Oct 30, 2019

Copy link
Copy Markdown
Contributor Author

thanks for finishing where I left it ;)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cclauss

cclauss commented Oct 30, 2019

Copy link
Copy Markdown
Contributor

@rvagg Can you please rerun the one Travis CI job that timed out?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

richardlau
richardlau approved these changes Oct 30, 2019
View reviewed changes
@richardlau

richardlau commented Oct 30, 2019

Copy link
Copy Markdown
Member

@rvagg Can you please rerun the one Travis CI job that timed out?

I've restarted it.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

rvagg pushed a commit that referenced this pull request Oct 31, 2019
@dothebart @rvagg
gyp: python3 fixes: utf8 decode, use of 'None' in eval
1b11be6
PR-URL: #1925
Reviewed-By: Christian Clauss <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
@rvagg

rvagg commented Oct 31, 2019

Copy link
Copy Markdown
Member

landed in 1b11be6. I hope the commit msg is reasonable: gyp: python3 fixes: utf8 decode, use of 'None' in eval

dothebart reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rvagg rvagg closed this Oct 31, 2019
@rvagg rvagg mentioned this pull request Oct 31, 2019
Release proposal: [email protected] #1935
Closed
@dothebart

dothebart commented Oct 31, 2019

Copy link
Copy Markdown
Contributor Author

thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cclauss cclauss added the Python label Nov 7, 2019
rvagg pushed a commit that referenced this pull request Nov 18, 2019
@dothebart @rvagg
gyp: python3 fixes: utf8 decode, use of 'None' in eval
8ea47ce
PR-URL: #1925
Reviewed-By: Christian Clauss <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
@rvagg rvagg mentioned this pull request Nov 18, 2019
Release proposal: [email protected] #1972
Closed
@cclauss cclauss mentioned this pull request Mar 10, 2020
gyp rebuild fails during npm install (python3.7). #2064
Closed
@sam-github sam-github mentioned this pull request Mar 11, 2020
TypeError: Unicode-objects must be encoded before hashing on node-gyp (Python 3.6.7) Blizzard/node-rdkafka#743
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cclauss cclauss cclauss approved these changes
@richardlau richardlau richardlau approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Python

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@dothebart @cclauss @rvagg @richardlau
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.