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

Excessive re-building triggered by commit 27c983b (#2534) #2552

Closed
jrajahalme opened this issue Feb 8, 2018 · 5 comments
Closed

Excessive re-building triggered by commit 27c983b (#2534) #2552

jrajahalme opened this issue Feb 8, 2018 · 5 comments
Assignees
Milestone

Comments

@jrajahalme
Copy link
Contributor

Title: Excessive re-building triggered by commit 27c983b (#2534)

Description:
commit 27c983b (PR #2534) seemingly works as intended as long as the bazel server is running. If the bazel server is restarted, however, some, if not most, dependencies are re-built, taking about 10 minutes CPU time.

This issue is easy to see with the bazel --batch option, as it does not leave the server running in the background.

Repro steps:

$ time bazel build //source/exe:envoy-static
... long build if nothing in cache ...
$ time bazel build //source/exe:envoy-static
... fast build, everything cached ...
$ bazel shutdown
$ time bazel build //source/exe:envoy-static
... long build, as if nothing is cached ...

Note that this behavior is not observed on previous commits, there bazel caching works also across bazel server restarts and in batch mode.

@jrajahalme jrajahalme changed the title Excessive re-building triggered by commit 27c983b5d0c5c9bf788fc3a34b2df4c7202f8097 (#2534) Excessive re-building triggered by commit 27c983b (#2534) Feb 8, 2018
jrajahalme referenced this issue Feb 8, 2018
This was a longstanding problem with external deps that manifested in
google/oss-fuzz#1130.

Signed-off-by: Harvey Tuch <htuch@google.com>
@jrajahalme
Copy link
Contributor Author

Should add that none of the related environment variables are defined (CC CXX CFLAGS CXXFLAGS LD_LIBRARY_PATH). I have not tested with any of them defined.

@htuch
Copy link
Member

htuch commented Feb 8, 2018

I'll take an AI to look into this. Would be helpful if you could set them to "" and see if it still does this as a data point.

@jrajahalme
Copy link
Contributor Author

Do you know if setting these env variables to "" is safe? Would that not override some defaults with nothing?

@jrajahalme
Copy link
Contributor Author

Retested with export CFLAGS="" and export CXXFLAGS="", still the same problem: rebuilds after each bazel server restart. Makes incremental docker builds practically impossible.

@mattklein123
Copy link
Member

@htuch FYI I just tried it locally and this is also broken for me with our external build script outside of bazel:

#!/bin/bash

set -e

DEPS=$(python <(cat envoy/bazel/target_recipes.bzl; \
  echo "print ' '.join(\"${THIRDPARTY_DEPS}/%s.dep\" % r for r in set(TARGET_RECIPES.values()))"))
echo "Building deps ${DEPS}"

envoy/ci/build_container/build_and_install_deps.sh ${DEPS}

ln -sf `pwd`/generated/thirdparty envoy/ci/prebuilt/thirdparty
ln -sf `pwd`/generated/thirdparty_build envoy/ci/prebuilt/thirdparty_build

Rebuilds for me every time. It used to detect no changes.

htuch added a commit to htuch/envoy that referenced this issue Feb 8, 2018
Fixes envoyproxy#2552.

Signed-off-by: Harvey Tuch <htuch@google.com>
htuch added a commit that referenced this issue Feb 8, 2018
Fixes #2552.

Signed-off-by: Harvey Tuch <htuch@google.com>
jpsim pushed a commit that referenced this issue Nov 28, 2022
Description: Replace an old link that does not work anymore (404) with a new one.
Risk Level: Low
Testing:
Checked that I can open the page
Docs Changes:
fix link url
Release Notes: N/A

Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this issue Nov 29, 2022
Description: Replace an old link that does not work anymore (404) with a new one.
Risk Level: Low
Testing:
Checked that I can open the page
Docs Changes:
fix link url
Release Notes: N/A

Signed-off-by: JP Simard <jp@jpsim.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants