doc: mention case-insensitive env on windows#9166
doc: mention case-insensitive env on windows#9166oliversalzburg wants to merge 2 commits intonodejs:masterfrom oliversalzburg:feature/env-case
Conversation
|
Building Node fails on my system, so I'm currently unable to run the tests :( This is the output I get during the build: https://gist.github.com/oliversalzburg/592885b45dbf0a561147faef519b0b05 |
addaleax
left a comment
There was a problem hiding this comment.
Building Node fails on my system, so I'm currently unable to run the tests :(
You can just use your system node to run this particular test, like node test/parallel/test-process-env.js.
test/parallel/test-process-env.js
Outdated
There was a problem hiding this comment.
I think our linter doesn’t like files that don’t end in newlines
test/parallel/test-process-env.js
Outdated
There was a problem hiding this comment.
I think you’ll need to change require('../common'); to const common = require('../common'); for this to work
|
@addaleax My system node says it's fine: $ node test/parallel/test-process-env.js; echo $?
0…unless I'm not doing it right. |
test/parallel/test-process-env.js
Outdated
There was a problem hiding this comment.
Can you please capitalize and punctuate the comments.
There was a problem hiding this comment.
Gladly, I just wanted to conform with other comments in the file. Is there some guideline regarding capitalization here?
test/parallel/test-process-env.js
Outdated
There was a problem hiding this comment.
Can you replace this with two separate assertions:
assert.strictEqual(process.env.TEST, 'test');
assert.strictEqual(process.env.teST, 'test');
test/parallel/test-process-env.js
Outdated
There was a problem hiding this comment.
Instead of checking the typeof, can you just directly compare against undefined.
test/parallel/test-process-env.js
Outdated
There was a problem hiding this comment.
Actually, you can move the test for process.env.TEST out of the if.
There was a problem hiding this comment.
I updated the assertions. Please let me know if that's in line with what you had in mind.
Yeah that seems like something for @nodejs/platform-windows to look at |
Since it doesn't pertain to the PR, I suggest moving this discussion to #node-dev. |
|
Tested master, it compiles fine. I would suggest |
test/parallel/test-process-env.js
Outdated
There was a problem hiding this comment.
Nit: can you please swap the arguments? The first one is actual and second one expected.
There was a problem hiding this comment.
Good call! Done.
doc/api/process.md
Outdated
There was a problem hiding this comment.
Minor nit: Remove the Note that, and just make it On Windows, environment variables are case-insensitive.
There was a problem hiding this comment.
Should be fixed now. Thanks
On Windows OS, environment variables are case-insensitive and are treated likewise in NodeJS. This can be confusing and can lead to hard-to-debug problems when moving code from one environment to another. Fixes: #9157
Environment variables should be treated case-insensitive on Windows platforms and case-sensitive on UNIX platforms
|
https://ci.nodejs.org/job/node-test-pull-request/4658/ If no one objects I'll land this if green. |
|
On Windows OS, environment variables are case-insensitive and are treated likewise in NodeJS. This can be confusing and can lead to hard-to-debug problems when moving code from one environment to another. Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> PR-URL: #9166 Fixes: #9157
Environment variables should be treated case-insensitive on Windows platforms and case-sensitive on UNIX platforms. This commit ensures this behavior persists. Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> PR-URL: #9166 Fixes: #9157
On Windows OS, environment variables are case-insensitive and are treated likewise in NodeJS. This can be confusing and can lead to hard-to-debug problems when moving code from one environment to another. Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> PR-URL: #9166 Fixes: #9157
Environment variables should be treated case-insensitive on Windows platforms and case-sensitive on UNIX platforms. This commit ensures this behavior persists. Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> PR-URL: #9166 Fixes: #9157
Environment variables should be treated case-insensitive on Windows platforms and case-sensitive on UNIX platforms. This commit ensures this behavior persists. Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> PR-URL: #9166 Fixes: #9157
On Windows OS, environment variables are case-insensitive and are treated likewise in NodeJS. This can be confusing and can lead to hard-to-debug problems when moving code from one environment to another. Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> PR-URL: #9166 Fixes: #9157
Environment variables should be treated case-insensitive on Windows platforms and case-sensitive on UNIX platforms. This commit ensures this behavior persists. Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> PR-URL: #9166 Fixes: #9157
On Windows OS, environment variables are case-insensitive and are treated likewise in NodeJS. This can be confusing and can lead to hard-to-debug problems when moving code from one environment to another. Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> PR-URL: #9166 Fixes: #9157
Checklist
make -j8 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
doc
Description of change
On Windows OS, environment variables are case-insensitive and are treated likewise in NodeJS. This can be confusing and can lead to hard-to-debug problems when moving code from one environment to another.
Closes #9157