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

Revert "Don’t change the working directory on Windows" #409

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading