forked from facebook/rocksdb
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up variables for temporary directory (facebook#9961)
Summary: Having all of TMPD, TMPDIR and TEST_TMPDIR as configuration parameters is confusing. This change simplifies a number of things by standardizing on TEST_TMPDIR, while still recognizing the old names also. In detail: * crash_test.mk also needs to use TEST_TMPDIR for crash test, so put in shared common.mk (an upgrade of python.mk) * Always exporting TEST_TMPDIR eliminates the need to propagate TMPD or export TEST_TMPDIR in selective places. * Use --tmpdir option to gnu_parallel so that it doesn't need TMPDIR environment variable * Remove obsolete parloop and parallel_check Makefile targets * Remove undefined, unused function ResetTmpDirForDirectIO() Pull Request resolved: facebook#9961 Test Plan: manual + CI Reviewed By: riversand963 Differential Revision: D36212178 Pulled By: pdillinger fbshipit-source-id: b76c1876c4f4d38b37789c2779eaa7c3026824dd
- Loading branch information
1 parent
00889cf
commit e03d958
Showing
5 changed files
with
43 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
ifndef PYTHON | ||
|
||
# Default to python3. Some distros like CentOS 8 do not have `python`. | ||
ifeq ($(origin PYTHON), undefined) | ||
PYTHON := $(shell which python3 || which python || echo python3) | ||
endif | ||
export PYTHON | ||
|
||
endif | ||
|
||
# To setup tmp directory, first recognize some old variables for setting | ||
# test tmp directory or base tmp directory. TEST_TMPDIR is usually read | ||
# by RocksDB tools though Env/FileSystem::GetTestDirectory. | ||
ifeq ($(TEST_TMPDIR),) | ||
TEST_TMPDIR := $(TMPD) | ||
endif | ||
ifeq ($(TEST_TMPDIR),) | ||
ifeq ($(BASE_TMPDIR),) | ||
BASE_TMPDIR :=$(TMPDIR) | ||
endif | ||
ifeq ($(BASE_TMPDIR),) | ||
BASE_TMPDIR :=/tmp | ||
endif | ||
# Use /dev/shm if it has the sticky bit set (otherwise, /tmp or other | ||
# base dir), and create a randomly-named rocksdb.XXXX directory therein. | ||
TEST_TMPDIR := $(shell f=/dev/shm; test -k $$f || f=$(BASE_TMPDIR); \ | ||
perl -le 'use File::Temp "tempdir";' \ | ||
-e 'print tempdir("'$$f'/rocksdb.XXXX", CLEANUP => 0)') | ||
endif | ||
export TEST_TMPDIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters