does node actually use process.config.variables?

150 views
Skip to first unread message

Andreas Marschke

unread,
Nov 11, 2014, 9:45:42 AM11/11/14
to nod...@googlegroups.com
Hi! 

I've looked at process.config which is like this in my environment: 

{ target_defaults:
   { cflags: [],
     default_configuration: 'Release',
     defines: [],
     include_dirs: [],
     libraries:
      [ '-lz',
        '-lcares',
        '-lv8',
        '-lssl',
        '-lcrypto' ] },
  variables:
   { clang: 0,
     gcc_version: 49,
     host_arch: 'x64',
     node_install_npm: false,
     node_prefix: '/usr',
     node_shared_cares: true,
     node_shared_http_parser: false,
     node_shared_libuv: false,
     node_shared_openssl: true,
     node_shared_v8: true,
     node_shared_zlib: true,
     node_tag: '',
     node_unsafe_optimizations: 0,
     node_use_dtrace: false,
     node_use_etw: false,
     node_use_openssl: true,
     node_use_perfctr: false,
     node_use_systemtap: false,
     python: '/usr/bin/python',
     target_arch: 'x64',
     v8_enable_gdbjit: 0,
     v8_no_strict_aliasing: 1,
     v8_use_snapshot: false } }

And looking at this I wondered: Does node (during runtime!) acknowledge that you've change something there? Such as adding the key and value:

    process.conf.variables.node_use_idle_notification = false

Does node care about changes like this? Are there viable reasons to NOT do this?

Thanks in advance!

Cheers,

Andreas Marschke.

Ryan Schmidt

unread,
Nov 11, 2014, 7:10:47 PM11/11/14
to nod...@googlegroups.com
The documentation says this is "An Object containing the JavaScript representation of the configure options that were used to compile the current node executable"

http://nodejs.org/api/process.html#process_process_config

As such I would assume it is treated as read-only, or that if you are able to make any changes to it, it would be pointless and confusing to do so since it would have no effect.


Ben Noordhuis

unread,
Nov 11, 2014, 7:11:02 PM11/11/14
to nod...@googlegroups.com
process.config is a copy of config.gypi, baked into the binary at
compile time. That file is created by ./configure and contains build
time flags. As such, mutating process.config does absolutely nothing.

Andreas Marschke

unread,
Nov 12, 2014, 4:40:54 AM11/12/14
to nod...@googlegroups.com
Ah too bad. Is there another way to modify the runtime env during runtime? Another I could imagine 
would be adding to process.env but (not having looked at the code at all) node will only check for 
that during runtime initialization.

I can see good reason why and why not to do this but just wether or not thats possible at all is the 
question

Thanks!

Sam Roberts

unread,
Nov 14, 2014, 4:37:22 PM11/14/14
to nod...@googlegroups.com
On Wed, Nov 12, 2014 at 1:40 AM, Andreas Marschke
<andreas....@gmail.com> wrote:
> Ah too bad. Is there another way to modify the runtime env during runtime?

What do you mean by runtime env? What do you want to modify? Most
things in process.config (all?) are immutable: you can't change the
gcc version node was compiled with.

Andreas Marschke

unread,
Nov 14, 2014, 4:49:48 PM11/14/14
to nod...@googlegroups.com
I was wondering if setting flags such as --nouse-idle-notification and v8 
options that you can set from the commandline was possible from inside
the node process.

Ben Noordhuis

unread,
Nov 14, 2014, 5:53:01 PM11/14/14
to nod...@googlegroups.com
On Fri, Nov 14, 2014 at 10:49 PM, Andreas Marschke
<andreas....@gmail.com> wrote:
> I was wondering if setting flags such as --nouse-idle-notification and v8
> options that you can set from the commandline was possible from inside
> the node process.

--nouse_idle_notification is a no-op in v0.10 and newer. That said,
the ability to change V8 settings on the fly has merit:
https://github.com/node-forward/node/pull/62

Andreas Marschke

unread,
Nov 14, 2014, 9:46:37 PM11/14/14
to nod...@googlegroups.com
Hi Ben!

The node repo for node-forward doesn't exist for me I'm not a contributor (yet -- maybe soon). So I can't see if you have a private repo in the Organisation or anythin.

If you have I'd be interested though ;)

Cheers, 

Andreas Marschke.

Ben Noordhuis

unread,
Nov 15, 2014, 5:39:52 PM11/15/14
to nod...@googlegroups.com
On Sat, Nov 15, 2014 at 3:46 AM, Andreas Marschke
<andreas....@gmail.com> wrote:
> Hi Ben!
>
> The node repo for node-forward doesn't exist for me I'm not a contributor
> (yet -- maybe soon). So I can't see if you have a private repo in the
> Organisation or anythin.
>
> If you have I'd be interested though ;)
>
> Cheers,
>
> Andreas Marschke.

What's your GitHub nick, Andreas? The repository is private for now
but I can add you if you want.

Andreas Marschke

unread,
Nov 15, 2014, 6:20:08 PM11/15/14
to nod...@googlegroups.com
That'd  be `andreas-marschke`


Thanks!

Ben Noordhuis

unread,
Nov 16, 2014, 11:14:16 AM11/16/14
to nod...@googlegroups.com
On Sun, Nov 16, 2014 at 12:20 AM, Andreas Marschke
<andreas....@gmail.com> wrote:
> That'd be `andreas-marschke`
>
> See also: https://github.com/andreas-marschke
>
> Thanks!

Invite's in your inbox, Andreas.
Reply all
Reply to author
Forward
0 new messages