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

Protobufs recompiles when switching between Intellij & CLI #1169

Closed
KaoruDev opened this issue Sep 14, 2019 · 4 comments
Closed

Protobufs recompiles when switching between Intellij & CLI #1169

KaoruDev opened this issue Sep 14, 2019 · 4 comments

Comments

@KaoruDev
Copy link

KaoruDev commented Sep 14, 2019

Observation

Whenever I switch between running commands on the shell and syncing on Intellij I see logs pertaining to compiling protobufs. It only happens on the first command run or sync. Thereafter, I can only assume Bazel is using a cache.

26 / 245] Compiling external/com_google_protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc [for host]; 1s darwin-sandbox ... (4 actions, 3 running)
[32 / 245] Compiling external/com_google_protobuf/src/google/protobuf/generated_message_util.cc [for host]; 4s darwin-sandbox ... (4 actions, 3 running)
[41 / 245] Compiling external/com_google_protobuf/src/google/protobuf/generated_message_util.cc [for host]; 7s darwin-sandbox ... (4 actions, 3 running)
[45 / 245] Compiling external/com_google_protobuf/src/google/protobuf/compiler/cpp/cpp_enum_field.cc [for host]; 3s darwin-sandbox ... (4 actions running)
[49 / 245] Compiling external/com_google_protobuf/src/google/protobuf/compiler/python/python_generator.cc [for host]; 7s darwin-sandbox ... (4 actions, 3 running)
[53 / 245] Compiling external/com_google_protobuf/src/google/protobuf/repeated_field.cc [for host]; 6s darwin-sandbox ... (4 actions, 3 running)
[64 / 245] Compiling external/com_google_protobuf/src/google/protobuf/generated_message_table_driven_lite.cc [for host]; 4s darwin-sandbox ... (4 actions, 3 running)
[73 / 245] Compiling external/com_google_protobuf/src/google/protobuf/compiler/cpp/cpp_message_field.cc [for host]; 3s darwin-sandbox ... (4 actions, 3 running)
[81 / 245] Compiling external/com_google_protobuf/src/google/protobuf/compiler/cpp/cpp_message.cc [for host]; 8s darwin-sandbox ... (4 actions, 3 running)
[91 / 245] Compiling external/com_google_protobuf/src/google/protobuf/compiler/java/java_helpers.cc [for host]; 2s darwin-sandbox ... (4 actions, 3 running)
[101 / 245] Compiling external/com_google_protobuf/src/google/protobuf/compiler/js/js_generator.cc [for host]; 5s darwin-sandbox ... (4 actions, 3 running)
[110 / 245] Compiling external/com_google_protobuf/src/google/protobuf/compiler/plugin.cc [for host]; 2s darwin-sandbox ... (4 actions running)
[125 / 245] Compiling external/com_google_protobuf/src/google/protobuf/compiler/java/java_map_field_lite.cc [for host]; 2s darwin-sandbox ... (4 actions running)
[136 / 245] Compiling external/com_google_protobuf/src/google/protobuf/compiler/cpp/cpp_primitive_field.cc [for host]; 8s darwin-sandbox ... (4 actions running)
[140 / 245] Compiling external/com_google_protobuf/src/google/protobuf/compiler/cpp/cpp_string_field.cc [for host]; 6s darwin-sandbox ... (4 actions running)
[153 / 245] Compiling external/com_google_protobuf/src/google/protobuf/compiler/cpp/cpp_file.cc [for host]; 11s darwin-sandbox ... (4 actions running)
[172 / 245] Compiling external/com_google_protobuf/src/google/protobuf/descriptor.pb.cc [for host]; 13s darwin-sandbox ... (4 actions running)
[250 / 352] Compiling external/com_google_protobuf/src/google/protobuf/util/internal/default_value_objectwriter.cc [for host]; 4s darwin-sandbox ... (4 actions, 3 running)

Expectation

I'd expect Bazel to not have to re-compile protobufs every time.

Reproduce

  1. Click on the Bazel icon on the top right-hand corner.
  2. Switch to CLI and run any bazel command in the same WORKSPACE, see re-compile.

Env

Bazel version:

Build label: 0.29.0
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Aug 28 14:37:40 2019 (1567003060)
Build timestamp: 1567003060
Build timestamp as int: 1567003060

Plugin version: 2019.08.19.0.5

@jin
Copy link
Member

jin commented Sep 15, 2019

This could be due to a different PATH between IJ and the CLI shell.

See bazelbuild/bazel#7095

Try adding --incompatible_strict_action_env into your .bazelrc, and see if that'll work.

@KaoruDev
Copy link
Author

my .bazelrc file in my project looks like this:

test --test_output=all
--incompatible_strict_action_env

alas, the problem persists

@asv
Copy link

asv commented Sep 17, 2019

@KaoruDev try add this lines in your project .bazelrc:

build --incompatible_strict_action_env
run --incompatible_strict_action_env

@KaoruDev
Copy link
Author

@asv yep, that did it! thanks!

lolski pushed a commit to typedb/typedb that referenced this issue Mar 17, 2020
## What is the goal of this PR?

Previously, when switching between IDE and terminal builds, build cache would be fully invalidated. due to changed $PATH which defeats the sole purpose of caching. As per suggestion in [this](bazelbuild/intellij#1169) thread, we're enabling strict environment for actions (which sets PATH alongside with other variables to minimally viable preconfigured values). 

## What are the changes implemented in this PR?

Specify `--incompatible_strict_action_env` for `build`/`test`/`run`
vmax added a commit to typedb/typedb-driver-python that referenced this issue Mar 17, 2020
## What is the goal of this PR?

Previously, when switching between IDE and terminal builds, build cache would be fully invalidated. due to changed $PATH which defeats the sole purpose of caching. As per suggestion in [this](bazelbuild/intellij#1169) thread, we're enabling strict environment for actions (which sets PATH alongside with other variables to minimally viable preconfigured values). 

## What are the changes implemented in this PR?

Specify `--incompatible_strict_action_env` for `build`/`test`/`run`
haikalpribadi pushed a commit to typedb/typedb-driver that referenced this issue Mar 18, 2020
## What is the goal of this PR?

Previously, when switching between IDE and terminal builds, build cache would be fully invalidated. due to changed $PATH which defeats the sole purpose of caching. As per suggestion in [this](bazelbuild/intellij#1169) thread, we're enabling strict environment for actions (which sets PATH alongside with other variables to minimally viable preconfigured values). 

## What are the changes implemented in this PR?

Specify `--incompatible_strict_action_env` for `build`/`test`/`run`
vmax added a commit to typedb/typedb-dependencies that referenced this issue Mar 18, 2020
## What is the goal of this PR?

Previously, when switching between IDE and terminal builds, build cache would be fully invalidated. due to changed $PATH which defeats the sole purpose of caching. As per suggestion in [this](bazelbuild/intellij#1169) thread, we're enabling strict environment for actions (which sets PATH alongside with other variables to minimally viable preconfigured values). 

## What are the changes implemented in this PR?

Specify `--incompatible_strict_action_env` for `build`/`test`/`run`
vmax added a commit to typedb/typedb-docs that referenced this issue Mar 18, 2020
## What is the goal of this PR?

Previously, when switching between IDE and terminal builds, build cache would be fully invalidated. due to changed $PATH which defeats the sole purpose of caching. As per suggestion in [this](bazelbuild/intellij#1169) thread, we're enabling strict environment for actions (which sets PATH alongside with other variables to minimally viable preconfigured values). 

## What are the changes implemented in this PR?

Specify `--incompatible_strict_action_env` for `build`/`test`/`run`
haikalpribadi pushed a commit to typedb/typedb-common that referenced this issue Mar 18, 2020
## What is the goal of this PR?

Previously, when switching between IDE and terminal builds, build cache would be fully invalidated. due to changed $PATH which defeats the sole purpose of caching. As per suggestion in [this](bazelbuild/intellij#1169) thread, we're enabling strict environment for actions (which sets PATH alongside with other variables to minimally viable preconfigured values). 

## What are the changes implemented in this PR?

Specify `--incompatible_strict_action_env` for `build`/`test`/`run`
vmax added a commit to typedb/typedb-driver-nodejs that referenced this issue Apr 14, 2020
## What is the goal of this PR?

Previously, when switching between IDE and terminal builds, build cache would be fully invalidated. due to changed $PATH which defeats the sole purpose of caching. As per suggestion in [this](bazelbuild/intellij#1169) thread, we're enabling strict environment for actions (which sets PATH alongside with other variables to minimally viable preconfigured values). 

## What are the changes implemented in this PR?

Specify `--incompatible_strict_action_env` for `build`/`test`/`run`
flyingsilverfin pushed a commit to typedb/typedb-console that referenced this issue Jun 17, 2020
## What is the goal of this PR?

Previously, when switching between IDE and terminal builds, build cache would be fully invalidated. due to changed $PATH which defeats the sole purpose of caching. As per suggestion in [this](bazelbuild/intellij#1169) thread, we're enabling strict environment for actions (which sets PATH alongside with other variables to minimally viable preconfigured values). 

## What are the changes implemented in this PR?

Specify `--incompatible_strict_action_env` for `build`/`test`/`run`
irfansharif added a commit to irfansharif/cockroach that referenced this issue Oct 22, 2021
Fixes cockroachdb#71835. When switching between using `dev` and `bazel` raw, I kept
seeing our C++ protobuf dependency getting recompiled (slowly).
It appears that the bazel build for protobuf has a dependency on $PATH
(see bazelbuild/intellij#1169 and bazelbuild/bazel#7095). Specifying
`--incompatible_strict_action_env` pins PATH and avoids the build cache
thrashing we were seeing before.

Release note: None
irfansharif added a commit to irfansharif/cockroach that referenced this issue Oct 22, 2021
Fixes cockroachdb#71835. When switching between using `dev` and `bazel` raw, I kept
seeing our C++ protobuf dependency getting recompiled (slowly).
It appears that the bazel build for protobuf has a dependency on $PATH
(see bazelbuild/intellij#1169 and bazelbuild/bazel#7095). Specifying
`--incompatible_strict_action_env` pins PATH and avoids the build cache
thrashing we were seeing before.

Release note: None
craig bot pushed a commit to cockroachdb/cockroach that referenced this issue Oct 22, 2021
71632: sql: make sure pgwire bind always happens in a transaction r=otan a=rafiss

fixes #70378
and maybe #64140

The approach of using a transaction matches what we do for pgwire Parse
messages already. This is important to make sure that user-defined types
are leased correctly.

This also updated the SQL EXECUTE command to resolve user-defined types
so that it gets the latest changes.

Release note (bug fix): Adding new values to a user-defined enum type
will previously would cause a prepared statement using that type to not
work. This now works as expected.

71836: clusterversion: introduce 22.1 development versions r=celiala a=celiala

Fix: #69828

Looking at past Version values for `Start{XX_X}`, I think the `Version` value for `Key: Start22_1` should instead be `Major: 21, Minor: 2, ...`.


Start21_1 (from #70268):
```
// v21.1 versions. Internal versions defined here-on-forth must be even.
{
  Key:     Start21_1,
  Version: roachpb.Version{Major: 20, Minor: 2, Internal: 2},
},
```

Start 21_2:
```
{
  Key:     Start21_2,
  Version: roachpb.Version{Major: 21, Minor: 1, Internal: 1102},
},
```

Release justification: Non-production code change.
Release note: None

71856: bazel: skip recompilation when using dev+bazel r=irfansharif a=irfansharif

Fixes #71835. When switching between using `dev` and `bazel` raw, I kept
seeing our C++ protobuf dependency getting recompiled (slowly).
It appears that the bazel build for protobuf has a dependency on $PATH
(see bazelbuild/intellij#1169 and bazelbuild/bazel#7095). Specifying
[`--incompatible_strict_action_env`](https://docs.bazel.build/versions/main/command-line-reference.html#flag--incompatible_strict_action_env) pins PATH and avoids the build cache
thrashing we were seeing before.

Release note: None

Co-authored-by: Rafi Shamim <[email protected]>
Co-authored-by: Celia La <[email protected]>
Co-authored-by: irfan sharif <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants