bazel icon indicating copy to clipboard operation
bazel copied to clipboard

[Feature request] Bazel should cache already downloaded repositories and dependencies

Open manjunaths opened this issue 10 years ago • 10 comments

I am trying to build tensorflow and I struggling with issues like setting proxy and such. I have to restart my build several times. Each time I execute a bazel build it goes and downloads all the dependencies again fresh. Is there a way to make it cache the downloaded repositories ? So that it doesn't redownload the already downloaded repos ?

manjunaths avatar Mar 16 '16 11:03 manjunaths

Is it actually failing to cache fully downloaded repositories, or is it stopping partway through when one fails and then restarting all of them the next time?

bsilver8192 avatar Mar 17 '16 04:03 bsilver8192

@kchodorow thoughts?

dslomov avatar Mar 18 '16 13:03 dslomov

Feel free to comment if this is still an issue (fully downloaded repositories should be cached).

kchodorow avatar Jun 15 '16 19:06 kchodorow

Still have this problem when building Tensorflow. Something (but not all) are downloaded once and once again. I am not familiar with bazel and don't know what details I should provide, so feel free to ask me for more information if you need.

zsrkmyn avatar Mar 11 '17 13:03 zsrkmyn

Stephen, When you open a new ticket you can see a template of all common etails that help the team when handling a ticket. You can open a new ticket (without creating it) to see the template. On Sat, 11 Mar 2017 at 15:24 Stephen [email protected] wrote:

Still have this problem when building Tensorflow. Something (but not all) are downloaded once and once again. I am not familiar with bazel and don't know what details I should provide, so feel free to ask me for more information if you need.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bazelbuild/bazel/issues/1050#issuecomment-285866462, or mute the thread https://github.com/notifications/unsubscribe-auth/ABUIF1VKYpkGISHQz7zs68qnwgHHG_DQks5rkqCdgaJpZM4Hx4df .

ittaiz avatar Mar 11 '17 14:03 ittaiz

@ittaiz Thanks for the great template! So the details are:

Description of the problem / feature request / question:

When building Tensorflow more than one time, something are downloaded even they have been downloaded before. I took a look at the `~/.cache/bazel/_bazel_stephen/', finding that there are five things in total:

~$ ll ~/.cache/bazel/_bazel_stephen/
total 20K
drwxr-xr-x 5 stephen stephen 4.0K Mar 11 20:33 4f375d324ffe530e1b3eda764fb2e27e/
drwxr-xr-x 5 stephen stephen 4.0K Mar 12 01:07 7800d4e597bb062e39f880da29704dc5/
drwxr-xr-x 6 stephen stephen 4.0K Mar 11 18:04 7c03caeeb0b7a5dca77e483d47cfe58e/
drwxr-xr-x 3 stephen stephen 4.0K Mar 11 21:56 d41d8cd98f00b204e9800998ecf8427e/
drwxr-xr-x 3 stephen stephen 4.0K Mar 11 17:32 install/

And I also noticed that only things in 7800d4e597bb062e39f880da29704dc5 were downloaded repeatly. Things in the other three folders (with hashtag name) would NOT be downloaded if they've existed.

If possible, provide a minimal example to reproduce the problem:

In tensorflow's source dir, ./configure && bazel build //tensorflow/tools/pip_package:build_pip_package

I am sorry it's not a minimal example, but I am too busy recently to find out how to produce one. For more building details, refer here, please. The configuration environment variables are set in prepare() and then build() function will be executed. I built it with cuda and cudnn support.

Environment info

  • Operating System: Arch Linux with 4.9.11 kernel

  • Bazel version (output of bazel info release): release 0.4.4- (@non-git)

  • If bazel info release returns "development version" or "(@non-git)", please tell us what source tree you compiled Bazel from; git commit hash is appreciated (git rev-parse HEAD): this one downloaded from here

Have you found anything relevant by searching the web? (e.g. GitHub issues, email threads in the [email protected] archive)

Yes, may this issue be.

Anything else, information or logs or outputs that would be helpful?

(If they are large, please upload as attachment or provide link).

Probably no, I don't know how to find downloading logs... There are so many log files in 7800d4e597bb062e39f880da29704dc5 but I find no one about downloading packages.

zsrkmyn avatar Mar 12 '17 07:03 zsrkmyn

If the bazel developers have their internet connections to be tethered via a 2g phone for a week. This issue will get fixed in a few hours. It is physically painful.

manjunaths avatar Mar 16 '17 14:03 manjunaths

this is definitely still a issue for me. Behind a firewall and its impossible to get working...

ackbar03 avatar Aug 16 '18 14:08 ackbar03

@ackbar03 The --repository_cache flag is enabled by default so all external dependencies should be cached and working. There's also a new bazel sync flag that predownloads all declared external dependencies in your WORKSPACE. If you have a situation that these aren't addressing, please open a new issue with details on your setup.

jin avatar Aug 16 '18 16:08 jin

this is definitely still a issue for me. Behind a firewall and its impossible to get working...

Yes, especially in China. You know ~ We will STRONGLY appreciate that if the feature is implemented.

xingxinghuo1000 avatar Mar 17 '20 05:03 xingxinghuo1000