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

Respect XDG directory settings on macOS #25167

Open
aaronsky opened this issue Feb 1, 2025 · 6 comments · May be fixed by #25205
Open

Respect XDG directory settings on macOS #25167

aaronsky opened this issue Feb 1, 2025 · 6 comments · May be fixed by #25205
Labels
help wanted Someone outside the Bazel team could own this P3 We're not considering working on this, but happy to review a PR. (No assignee) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: feature request

Comments

@aaronsky
Copy link

aaronsky commented Feb 1, 2025

Description of the feature request:

Per #16937, while the XDG Base Directory spec is more commonly adopted on Linux, there's little I'm aware of in the way of supporting it on macOS for those users who set the environment variables. Is this something that can be added as a secondary option for that platform, or is there something special about /private/var/tmp as an output root?

Which category does this issue belong to?

Core

What underlying problem are you trying to solve with this feature?

A similar issue as interrogated with #16937, but for macOS instead of just Linux.

Which operating system are you running Bazel on?

macOS 15.3

What is the output of bazel info release?

release 8.0.1

@sgowroji sgowroji added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Feb 1, 2025
@meteorcloudy
Copy link
Member

/cc @tetromino any idea on this one?

@meteorcloudy meteorcloudy added P2 We'll consider working on this in future. (Assignee optional) help wanted Someone outside the Bazel team could own this and removed untriaged labels Feb 4, 2025
@aaronsky
Copy link
Author

aaronsky commented Feb 4, 2025

Following up on one of the questions up top about whether there's anything special about /private/var/tmp for Bazel on macOS, I noticed that updating the OS causes this location to be blown away. I would understand if this location was chosen with this or a related fact in mind. If this is a coincidence or unimportant, I'd love to have this option on macOS (particularly because environment variables are not interpolated in .bazelrc as far as I'm aware, so I have to hardcode the path in the absence of this).

@meteorcloudy
Copy link
Member

See https://chatgpt.com/share/67a33ebf-0508-8013-ac91-478bb2ca0563

Have you tried --output_base and --output_user_root to set Bazel's output paths? See also https://bazel.build/remote/output-directories#layout

@meteorcloudy meteorcloudy added P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) and removed P2 We'll consider working on this in future. (Assignee optional) labels Feb 5, 2025
@aaronsky
Copy link
Author

aaronsky commented Feb 5, 2025

Yes, but as I said, I can't set startup --output_user_root=${XDG_CACHE_DIR}/bazel in my $HOME/.bazelrc because environment variables are not interpolated in bazelrc. I have to hardcode it to a known fixed value, in this case startup --output_user_root=~/.cache/bazel. It would be nice for macOS to get the same environment-respecting feature that Linux has, if the environment variable is set – even if XDG adoption isn't as widespread on macOS as it is Linux, it's both valid to do so and not uncommon.

@meteorcloudy
Copy link
Member

OK, I cannot think of any reason to forbidden this, are you willing to contribute a PR to Bazel to add this support?

@meteorcloudy meteorcloudy added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) labels Feb 5, 2025
@aaronsky
Copy link
Author

aaronsky commented Feb 5, 2025

Yeah, I'm willing to try! I was actually just in the middle of standing up a dev environment for #25165, which is the higher priority at the $dayjob.

@aaronsky aaronsky linked a pull request Feb 5, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Someone outside the Bazel team could own this P3 We're not considering working on this, but happy to review a PR. (No assignee) team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants