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

Allow a $HOME variable in .bazelrc #247

Closed
pgr0ss opened this issue Jun 15, 2015 · 9 comments
Closed

Allow a $HOME variable in .bazelrc #247

pgr0ss opened this issue Jun 15, 2015 · 9 comments
Labels
category: misc > misc P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) type: feature request

Comments

@pgr0ss
Copy link
Contributor

pgr0ss commented Jun 15, 2015

I'd like to share my .bazelrc file between machines and even different developeres (and put it in source control). It would be nice if the paths could be relative to the home directory. Something like:

build --package_path %workspace%:%home%/bazel/base_workspace

Right now, it seems the best I can do is:

build --package_path %workspace%:%workspace%/../../bazel/base_workspace

But this relies on everyone cloning the repo in the same directory.

Thanks,
Paul

@damienmg
Copy link
Contributor

Although as said on IRC I think that's a good idea but for your precise use case: could you have a globally installed directory (always at the same path on the machine)? Also for the bazelrc you can put it under tools/bazel.rc for sharing it on the depot. I think you still needs to have the bazel installed at the same place for every user.

@pgr0ss
Copy link
Contributor Author

pgr0ss commented Jun 17, 2015

Yeah, for now I think we'll try use the same paths on every machine.

@damienmg damienmg added the P3 We're not considering working on this, but happy to review a PR. (No assignee) label Jun 17, 2015
@hanwen
Copy link
Contributor

hanwen commented Jan 20, 2016

you can now use %workspace% in bazelrc, does that help?

See e3681d1

@pgr0ss
Copy link
Contributor Author

pgr0ss commented Jan 22, 2016

That looks interesting. I'll have to check it out.

@damienmg damienmg added P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) category: misc > misc and removed P3 We're not considering working on this, but happy to review a PR. (No assignee) labels Jun 14, 2016
@damienmg
Copy link
Contributor

Downgrading to P4 as there is an acceptable workaround. Contributions welcomed :)

@helenaut
Copy link

helenaut commented Jul 11, 2016

I am not sure %workspace% works for things outside of imports? I am trying to use it like:

test --run_under=%workspace%/path/to/bash/file.sh

@kchodorow
Copy link
Contributor

Unfortunately, %workspace% is specially interpreted by --package_path, other options don't know how understand it.

@helenaut
Copy link

Thanks Kristina.

@ulfjack
Copy link
Contributor

ulfjack commented Feb 15, 2017

The tools used by the built-in rules are now bundled into Bazel, so --package_path should be unnecessary in the vast majority of use cases. I'm closing this. Let me know if there's still something to be done here.

@ulfjack ulfjack closed this as completed Feb 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: misc > misc P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) type: feature request
Projects
None yet
Development

No branches or pull requests

6 participants