Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repl: fix /dev/null history file regression #12762

Merged
merged 1 commit into from May 2, 2017

Conversation

@mscdex
Copy link
Contributor

commented Apr 30, 2017

This fixes a regression from bb041ea where ftruncate() fails on a file symlinked to /dev/null.

/cc @bzoz @jasnell

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

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)
  • repl

@mscdex mscdex added the repl label Apr 30, 2017

@Fishrock123
Copy link
Member

left a comment

lgtm I suppose

test/parallel/test-repl-persistent-history.js Outdated
@@ -178,6 +179,21 @@ const tests = [
test: [UP],
expected: [prompt]
},
{
before: function before() {
if (!common.isWindows) {

This comment has been minimized.

Copy link
@Fishrock123

Fishrock123 Apr 30, 2017

Member

This test case passes on Windows?

This comment has been minimized.

Copy link
@mscdex

mscdex Apr 30, 2017

Author Contributor

Yes, because like the test case before it, it will just act like an empty file on other platforms.

test/parallel/test-repl-persistent-history.js Outdated
}
}
},
env: { NODE_REPL_HISTORY: devNullHistoryPath },

This comment has been minimized.

Copy link
@Fishrock123

Fishrock123 Apr 30, 2017

Member

Wait, you can't just set this to /dev/null?

This comment has been minimized.

Copy link
@mscdex

mscdex Apr 30, 2017

Author Contributor

No, because I believe Windows would then fail since /dev/null does not exists there and currently there is no way to conditionally skip a test from running, you can only make it fall back to the empty history file scenario.

This comment has been minimized.

Copy link
@Fishrock123

Fishrock123 Apr 30, 2017

Member

Ah, makes sense.

@mscdex mscdex force-pushed the mscdex:repl-history-regression branch 2 times, most recently May 2, 2017

@mscdex

This comment has been minimized.

Copy link
Contributor Author

commented May 2, 2017

I've made a slight tweak to the test so that it creates the symlink in a more appropriate place now (the temp dir. instead of fixtures).

CI once again: https://ci.nodejs.org/job/node-test-pull-request/7791/

@bzoz
bzoz approved these changes May 2, 2017
@jasnell
jasnell approved these changes May 2, 2017
Copy link
Member

left a comment

Ugh. Ok. Thanks for including the test.

repl: fix /dev/null history file regression
This fixes a regression from 83887f3 where ftruncate() fails on
a file symlinked to /dev/null.

PR-URL: #12762
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

@mscdex mscdex force-pushed the mscdex:repl-history-regression branch to c20e87a May 2, 2017

@mscdex mscdex merged commit c20e87a into nodejs:master May 2, 2017

@mscdex mscdex deleted the mscdex:repl-history-regression branch May 2, 2017

anchnk pushed a commit to anchnk/node that referenced this pull request May 6, 2017
repl: fix /dev/null history file regression
This fixes a regression from 83887f3 where ftruncate() fails on
a file symlinked to /dev/null.

PR-URL: nodejs#12762
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell jasnell referenced this pull request May 11, 2017
@mscdex

This comment has been minimized.

Copy link
Contributor Author

commented May 26, 2017

I just noticed that the problematic commit made its way into v7.x without this fix :-(, so I've updated the tags accordingly to match that of the PR for that commit.

@mscdex mscdex referenced this pull request May 26, 2017
3 of 3 tasks complete
@gibfahn gibfahn referenced this pull request Jun 15, 2017
2 of 3 tasks complete

@gibfahn gibfahn added land-on-v6.x and removed lts-watch-v6.x labels Jun 18, 2017

gibfahn added a commit that referenced this pull request Jun 18, 2017
repl: fix /dev/null history file regression
This fixes a regression from 83887f3 where ftruncate() fails on
a file symlinked to /dev/null.

PR-URL: #12762
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
gibfahn added a commit that referenced this pull request Jun 20, 2017
repl: fix /dev/null history file regression
This fixes a regression from 83887f3 where ftruncate() fails on
a file symlinked to /dev/null.

PR-URL: #12762
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins added a commit that referenced this pull request Jul 11, 2017
repl: fix /dev/null history file regression
This fixes a regression from 83887f3 where ftruncate() fails on
a file symlinked to /dev/null.

PR-URL: #12762
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins referenced this pull request Jul 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.