question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Switching back and forth from terminal to IDE requires rebuilds

See original GitHub issue

Whenever I run a bazel build in the terminal and then switch to intellij and resync the project, it does a full rebuild. It says the options have changed so it’s discarding the cache.

Looking at the options it sets, --tool_tag stands out as an obvious one that is in the affects_output section of the Bazel CLI docs, so could that be causing it? There are others as well.

How necessary are these and are there any workarounds or improvements that could be made to make switching back and forth a little easier/faster?

If it sounds like I’m talking crazy talk because this isn’t happening for you, I can give more details about the project, if you point me in the right direction to start.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:15
  • Comments:37

github_iconTop GitHub Comments

2reactions
prestonvanlooncommented, Oct 4, 2019

Ah! Thanks for the pointer. I was able to resolve my original issue by adding this to my bazelrc.

build --incompatible_strict_action_env
2reactions
chaorencommented, Oct 3, 2019

Isn’t there some way to get deterministic builds with bazel?

The build is deterministic, given that the PATH and its contents stays the same. Do you mean hermetic build? I agree depending on the PATH is really not hermetic.

bazel calls out to some executables on your path for binaries that it doesn’t bundle (I think things like cp, mv for genrules). It’s just a possibility that it might affect build output, most of the time it doesn’t. bazel is just overly eager in assuming a rebuild is necessary. You can even add an empty directory to your PATH and it’ll trigger a rebuild (e.g., PATH=$PATH:/bogus/bin bazel build). It really should be something the bazel team should fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Shortcut to switch between editor and terminal?
Possible solution: disable "Override IDE Shortcuts" option in "Settings/Preferences | Tools | Terminal" (https://youtrack.jetbrains.com/issue/ ...
Read more >
c# - Visual Studio 2017 - How to configure command terminal ...
You can make a "Visual Studio Command Prompt" window (a CMD instance) that is set to some version of "the current folder" by...
Read more >
Switch Windows 10 from RAID/IDE to AHCI
There is in fact a way to switch operation from either IDE / RAID to AHCI within Windows 10 without having to reinstall....
Read more >
Developing inside a Container - Visual Studio Code
Developing inside a Container. The Visual Studio Code Dev Containers extension lets you use a Docker container as a full-featured development environment.
Read more >
Devenv command line switches - Visual Studio (Windows)
Learn about devenv command-line switches and how to use them to set IDE options, and also build, debug, and deploy projects, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found