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

Support XDG_CACHE_HOME and make npm_config_tmp work #232

Merged
merged 1 commit into from
Oct 28, 2019
Merged

Support XDG_CACHE_HOME and make npm_config_tmp work #232

merged 1 commit into from
Oct 28, 2019

Conversation

Krinkle
Copy link
Contributor

@Krinkle Krinkle commented Oct 6, 2019

Ref #72.

  • For npm_config_tmp to work as (optional) override for the default
    temporary directory, it has to be checked first, not last
    in the chain of default-operator checks.

  • Add support for XDG_CACHE_HOME which some XDG-compliant environments
    will set to a directory that is persisted between CI runs and such.

    The XDG Cache home concept is ideal for this purpose because
    node-chromedriver takes care to clean up after itself and uses a
    deterministic filename. As such, it won't grow out of control and can
    be safely cached and persisted when XDG is provided.

    This way, downstream users of node-chromedriver are not required to
    set npm_config_tmp to a persisted directory, which can be undesirable
    due to the inherit nature and expectation of a temp directory.
    E.g. software tends to place files with random files name here, or
    leave behind large files, a directory with files that would grow
    rapidly if persisted between subsequent CI runs.

  • Remove the redundant manual handling of TMPDIR, TMP and "/tmp".
    These predate the addition of os.tmpdir() by 60c4706, which
    handles all these already. This code appears to be inspired by
    https://github.com/Medium/phantomjs/blob/v2.1.8/install.js#L107,
    which also does not have these additional checks.

Ref #72.

* For npm_config_tmp to work as (optional) override for the default
  temporary directory, it has to be checked first, not last
  in the chain of default-operator checks.

* Add support for XDG_CACHE_HOME which some XDG-compliant environments
  will set to a directory that is persisted between CI runs and such.

  The XDG Cache home concept is ideal for this purpose because
  node-chromedriver takes care to clean up after itself and uses a
  deterministic filename. As such, it won't grow out of control and can
  be safely cached and persisted when XDG is provided.

  This way, downstream users of node-chromedriver are not required to
  set npm_config_tmp to a persisted directory, which can be undesirable
  due to the inherit nature and expectation of a temp directory.
  E.g. software tends to place files with random files name here, or
  leave behind large files, a directory with files that would grow
  rapidly if persisted between subsequent CI runs.

* Remove the redundant manual handling of TMPDIR, TMP and "/tmp".
  These predate the addition of os.tmpdir() by 60c4706, which
  handles all these already. This code appears to be inspired by
  <https://github.com/Medium/phantomjs/blob/v2.1.8/install.js#L107>,
  which also does not have these additional checks.
@giggio giggio merged commit f331bbe into giggio:master Oct 28, 2019
@giggio
Copy link
Owner

giggio commented Oct 28, 2019

Tks! Published as 78.0.1.

@Krinkle Krinkle deleted the xdg-cache branch October 28, 2019 16:00
@lock
Copy link

lock bot commented Nov 4, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants