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 — tools: use `is None` consistently in Python by Trott · Pull Request #36606 · nodejs/node

Conversation

@Trott

@Trott Trott commented Dec 22, 2020

Copy link
Copy Markdown
Member

We use is None instead of == None everywhere (which mostly just
means test.py) except in one place in genv8constants.py. Switch to is None in genv8constants.py. This is slightly more efficient, although I
can't imagine that makes a measurable difference here.

Related Issues

Fixes: https://github.com/nodejs/node/issues/<issue_number>

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

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

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nodejs-github-bot nodejs-github-bot added the build Issues and PRs related to Node.js builds or CI infrastructure. label Dec 22, 2020
@Trott

Trott commented Dec 22, 2020

Copy link
Copy Markdown
Member Author

I added two more minor changes: An explicit file close at the end of the script, and correcting the usage message.

All reactions

Sorry, something went wrong.

Uh oh!

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

@Trott Trott added the python PRs and issues that require attention from people who are familiar with Python. label Dec 22, 2020
@Trott

Trott commented Dec 22, 2020

Copy link
Copy Markdown
Member Author

I'm trying to test to make sure the script still works. Does it require a debug build? Do we not use this anymore and the right thing to do is delete it?

All reactions

Sorry, something went wrong.

Uh oh!

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

@richardlau

richardlau commented Dec 22, 2020

Copy link
Copy Markdown
Member

I'm trying to test to make sure the script still works. Does it require a debug build? Do we not use this anymore and the right thing to do is delete it?

It's used in

node/node.gyp

Lines 1160 to 1178 in 5bd1eec

'target_name': 'node_dtrace_ustack',
'type': 'none',
'conditions': [
[ 'node_use_dtrace=="true" and OS!="mac" and OS!="linux"', {
'actions': [
{
'action_name': 'node_dtrace_ustack_constants',
'inputs': [
'<(obj_dir)/tools/v8_gypfiles/<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)'
],
'outputs': [
'<(SHARED_INTERMEDIATE_DIR)/v8constants.h'
],
'action': [
'tools/genv8constants.py',
'<@(_outputs)',
'<@(_inputs)'
]
},
which requires dtrace to be enabled via configure. This looks to be the default for macOS and smartOS (according to configure):

node/configure.py

Line 514 in 083abe2

help='build with DTrace (default is true on sunos and darwin)')

Trott reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@Trott

Trott commented Dec 22, 2020 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

This looks to be the default for macOS and smartOS

And because line 1163 excludes Mac and Linux unconditionally, this is probably only used on SmartOS?

node/node.gyp

Line 1163 in 5bd1eec

[ 'node_use_dtrace=="true" and OS!="mac" and OS!="linux"', {

richardlau reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

aduh95
aduh95 approved these changes Dec 22, 2020
View reviewed changes
lpinca
lpinca approved these changes Dec 22, 2020
View reviewed changes
@Trott Trott added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 24, 2020
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 24, 2020
@nodejs-github-bot

nodejs-github-bot commented Dec 24, 2020

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/35057/

All reactions

Sorry, something went wrong.

Uh oh!

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

Trott added 3 commits December 25, 2020 04:28
@Trott
tools: use is None consistently in Python
36c17e2
We use `is None` instead of `== None` everywhere (which mostly just
means test.py) except in one place in genv8constants.py. Switch to `is
None` in genv8constants.py. This is slightly more efficient, although I
can't imagine that makes a measurable difference here.

PR-URL: nodejs#36606
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@Trott
tools: call close() explicitly in genv8constants.py
18fc50f
PR-URL: nodejs#36606
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@Trott
tools: correct usage message for genv8constants.py
e068eec
PR-URL: nodejs#36606
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@Trott
Trott force-pushed the is-none branch from 2f51840 to e068eec Compare December 25, 2020 12:29
@Trott

Trott commented Dec 25, 2020

Copy link
Copy Markdown
Member Author

Landed in 73a21e4...e068eec

All reactions

Sorry, something went wrong.

Uh oh!

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

@Trott
Trott merged commit e068eec into nodejs:master Dec 25, 2020
@Trott
Trott deleted the is-none branch December 25, 2020 12:29
danielleadams pushed a commit that referenced this pull request Jan 12, 2021
@Trott @danielleadams
tools: use is None consistently in Python
7664f36
We use `is None` instead of `== None` everywhere (which mostly just
means test.py) except in one place in genv8constants.py. Switch to `is
None` in genv8constants.py. This is slightly more efficient, although I
can't imagine that makes a measurable difference here.

PR-URL: #36606
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
danielleadams pushed a commit that referenced this pull request Jan 12, 2021
@Trott @danielleadams
tools: call close() explicitly in genv8constants.py
37b39a2
PR-URL: #36606
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
danielleadams pushed a commit that referenced this pull request Jan 12, 2021
@Trott @danielleadams
tools: correct usage message for genv8constants.py
10f1c89
PR-URL: #36606
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@danielleadams danielleadams mentioned this pull request Jan 12, 2021
v15.6.0 proposal #36889
Merged
targos pushed a commit that referenced this pull request May 1, 2021
@Trott @targos
tools: use is None consistently in Python
26d5965
We use `is None` instead of `== None` everywhere (which mostly just
means test.py) except in one place in genv8constants.py. Switch to `is
None` in genv8constants.py. This is slightly more efficient, although I
can't imagine that makes a measurable difference here.

PR-URL: #36606
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
targos pushed a commit that referenced this pull request May 1, 2021
@Trott @targos
tools: call close() explicitly in genv8constants.py
9990ec7
PR-URL: #36606
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
targos pushed a commit that referenced this pull request May 1, 2021
@Trott @targos
tools: correct usage message for genv8constants.py
d85ea61
PR-URL: #36606
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
@danielleadams danielleadams mentioned this pull request May 3, 2021
v14.17.0 proposal #38507
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lpinca lpinca lpinca approved these changes
@aduh95 aduh95 aduh95 approved these changes

Uh oh!

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

Assignees

No one assigned

Labels

build Issues and PRs related to Node.js builds or CI infrastructure. python PRs and issues that require attention from people who are familiar with 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.

5 participants

@Trott @richardlau @nodejs-github-bot @lpinca @aduh95
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 01402503 — 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.