Skip to content

Commit e115d14

Browse files
committed
Revert "Don’t change the working directory on Windows"
This reverts commit 3af60ba. This might no longer be needed.
1 parent 1768d84 commit e115d14

File tree

4 files changed

+2
-18
lines changed

4 files changed

+2
-18
lines changed

elisp/process.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,12 +451,8 @@ absl::StatusOr<int> Run(const std::string_view binary,
451451
final_args.insert(final_args.end(), runfiles_args.begin(),
452452
runfiles_args.end());
453453
final_args.insert(final_args.end(), args.begin(), args.end());
454-
absl::StatusOr<Environment> orig_env = CopyEnv();
454+
const absl::StatusOr<Environment> orig_env = CopyEnv();
455455
if (!orig_env.ok()) return orig_env.status();
456-
// We don’t want the Python launcher to change the current working directory,
457-
// otherwise relative filenames will be all messed up. See
458-
// https://github.com/bazelbuild/bazel/issues/7190.
459-
orig_env->erase(RULES_ELISP_NATIVE_LITERAL("RUN_UNDER_RUNFILES"));
460456
map->insert(orig_env->begin(), orig_env->end());
461457
std::vector<NativeString> final_env;
462458
for (const auto& [key, value] : *map) {

elisp/run_binary.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ def main() -> None:
5353
parser.add_argument('argv', nargs='+')
5454
opts = parser.parse_args()
5555
env: dict[str, str] = dict(os.environ)
56-
# We don’t want the Python launcher to change the current working directory,
57-
# otherwise relative filenames will be all messed up. See
58-
# https://github.com/bazelbuild/bazel/issues/7190.
59-
env.pop('RUN_UNDER_RUNFILES', None)
6056
run_files = runfiles.Runfiles(dict(opts.runfiles_env))
6157
emacs = run_files.resolve(opts.wrapper)
6258
args: list[str] = [str(emacs)]

elisp/run_emacs.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2021, 2022, 2023 Google LLC
1+
# Copyright 2021, 2022, 2023, 2024 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -55,10 +55,6 @@ def main() -> None:
5555
EMACSDOC=str(etc),
5656
EMACSLOADPATH=str(shared / 'lisp'),
5757
EMACSPATH=str(libexec))
58-
# We don’t want the Python launcher to change the current working
59-
# directory, otherwise relative filenames will be all messed up. See
60-
# https://github.com/bazelbuild/bazel/issues/7190.
61-
env.pop('RUN_UNDER_RUNFILES', None)
6258
env.update(opts.env)
6359
env.update(run_files.environment())
6460
if os.name == 'nt':

elisp/run_test.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ def main() -> None:
6262
logging.basicConfig(level=logging.INFO,
6363
format='%(asctime)s %(levelname)s %(name)s %(message)s')
6464
env: dict[str, str] = dict(os.environ)
65-
# We don’t want the Python launcher to change the current working directory,
66-
# otherwise relative filenames will be all messed up. See
67-
# https://github.com/bazelbuild/bazel/issues/7190.
68-
env.pop('RUN_UNDER_RUNFILES', None)
6965
run_files = runfiles.Runfiles(dict(opts.runfiles_env))
7066
emacs = run_files.resolve(opts.wrapper)
7167
args: list[str] = [str(emacs)]

0 commit comments

Comments
 (0)