Skip to content

Commit

Permalink
Revert "Don’t change the working directory on Windows"
Browse files Browse the repository at this point in the history
This reverts commit 3af60ba.

This might no longer be needed.
  • Loading branch information
phst committed Feb 16, 2024
1 parent 1768d84 commit a6559db
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
6 changes: 1 addition & 5 deletions elisp/process.cc
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,8 @@ absl::StatusOr<int> Run(const std::string_view binary,
final_args.insert(final_args.end(), runfiles_args.begin(),
runfiles_args.end());
final_args.insert(final_args.end(), args.begin(), args.end());
absl::StatusOr<Environment> orig_env = CopyEnv();
const absl::StatusOr<Environment> orig_env = CopyEnv();
if (!orig_env.ok()) return orig_env.status();
// We don’t want the Python launcher to change the current working directory,
// otherwise relative filenames will be all messed up. See
// https://github.com/bazelbuild/bazel/issues/7190.
orig_env->erase(RULES_ELISP_NATIVE_LITERAL("RUN_UNDER_RUNFILES"));
map->insert(orig_env->begin(), orig_env->end());
std::vector<NativeString> final_env;
for (const auto& [key, value] : *map) {
Expand Down
4 changes: 0 additions & 4 deletions elisp/run_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ def main() -> None:
parser.add_argument('argv', nargs='+')
opts = parser.parse_args()
env: dict[str, str] = dict(os.environ)
# We don’t want the Python launcher to change the current working directory,
# otherwise relative filenames will be all messed up. See
# https://github.com/bazelbuild/bazel/issues/7190.
env.pop('RUN_UNDER_RUNFILES', None)
run_files = runfiles.Runfiles(dict(opts.runfiles_env))
emacs = run_files.resolve(opts.wrapper)
args: list[str] = [str(emacs)]
Expand Down
6 changes: 1 addition & 5 deletions elisp/run_emacs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021, 2022, 2023 Google LLC
# Copyright 2021, 2022, 2023, 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -55,10 +55,6 @@ def main() -> None:
EMACSDOC=str(etc),
EMACSLOADPATH=str(shared / 'lisp'),
EMACSPATH=str(libexec))
# We don’t want the Python launcher to change the current working
# directory, otherwise relative filenames will be all messed up. See
# https://github.com/bazelbuild/bazel/issues/7190.
env.pop('RUN_UNDER_RUNFILES', None)
env.update(opts.env)
env.update(run_files.environment())
if os.name == 'nt':
Expand Down
4 changes: 0 additions & 4 deletions elisp/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ def main() -> None:
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(levelname)s %(name)s %(message)s')
env: dict[str, str] = dict(os.environ)
# We don’t want the Python launcher to change the current working directory,
# otherwise relative filenames will be all messed up. See
# https://github.com/bazelbuild/bazel/issues/7190.
env.pop('RUN_UNDER_RUNFILES', None)
run_files = runfiles.Runfiles(dict(opts.runfiles_env))
emacs = run_files.resolve(opts.wrapper)
args: list[str] = [str(emacs)]
Expand Down

0 comments on commit a6559db

Please sign in to comment.