Repository navigation
Conversation
| build --genrule_strategy=standalone | ||
| build -c opt | ||
|
|
||
| #build --spawn_strategy=standalone |
There was a problem hiding this comment.
having -c opt forces bazel to do opt builds preventing users from having debug builds. Users need to edit .bazelrc to be able to debug. AFAIK default of bazel is fastbuild which is pretty close to opt. --spawn_strategy default is sandboxed where it can and standalone if sandboxing doesn't work. is there a strong reason against sandboxing? AFAIK this was default before this file was added.
There was a problem hiding this comment.
Fastbuild is not close to opt, it disables most optimizations (builds fast, runs slow).
There was a problem hiding this comment.
You can always to --copt=-g to add the debug symbols.
This does not prevent you from having debug builds.
There was a problem hiding this comment.
@martinwicke, you are right, standing corrected. But what is going to happen if user wants to do a debug build? Isn't it better to specify this flag from the command-line?
There was a problem hiding this comment.
@gunan, can you try with removing the flag from .bazelrc? in my case it seems to default to opt. Anyway, I can add it back.
There was a problem hiding this comment.
When I remove build -c opt line from my bazelrc, this is what I see in subcommands:
/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -MD -MF ...
So I do not think it defaults to -c opt`
There was a problem hiding this comment.
@gunan,
That is interesting. That is what I see
/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/host/bin/tensorflow/cc/_objs/cc_ops/tensorflow/cc/ops/no_op.pic.d ....
The command-line you put is not for an external right? Anyway, pushed with always -c opt enabled.
There was a problem hiding this comment.
Is it possible that you have a bazelrc at your home folder, or a system level bazelrc file that changes your defaults?
There was a problem hiding this comment.
I am pretty sure that is not the case but started from scratch again. Regardless, I added the flag back.
|
@gunan I remembered we enabled sandboxing for ourselves, but did we consciously turn it off for others? It does tend to cause trouble. Is this really a mistake or do we need it to avoid having to run configure? |
|
@perfinion @meteorcloudy @angersson as they were involved in moving bazelrc from under tools to root. @martinwicke I do not think we ever successfully enabled sandboxing across the board. |
|
.bazelrc was moved in #21374 If waiting till monday doesn't work tho, this still isn't the best way to fix it. |
| # Default paths for TF_SYSTEM_LIBS | ||
| #build --define=PREFIX=/usr | ||
| #build --define=LIBDIR=$(PREFIX)/lib | ||
| #build --define=INCLUDEDIR=$(PREFIX)/include |
There was a problem hiding this comment.
Don't comment these either, they'll break system libs stuff. The ./configure script is already setup to handle overrides for these. These are needed as the default fallback for when the user chooses not to override them.
perfinion
left a comment
There was a problem hiding this comment.
I'll open a PR soon with how this bazelrc stuff should look at the end of the day once bazel-0.18.0 is out. Then we decide either to wait till monday or go via tools/bazel.rc temporarily.
| open(_TF_BAZELRC, 'w').close() | ||
| bazelrc_path = os.path.join(_TF_WORKSPACE_ROOT, '.bazelrc') | ||
|
|
||
| bazel_defaults_path = os.path.join(_TF_WORKSPACE_ROOT, 'bazel_defaults') |
There was a problem hiding this comment.
The problem is this breaks building when ./configure is not run, which we're supposed to support
There was a problem hiding this comment.
I don't understand that. You mean I can just do checkout, call bazel build //tensorflow/tools/pip_package:build_pip_package and this is expected to give a fully functional TF?
There was a problem hiding this comment.
Yeah pretty much. I don't use it that way but a lot of people do and its gotta be supported.
Bazel-0.18.0 adds a try-import option that will non-fatally try and import a file. Use this for the configure options so that .bazelrc does not need to change. ./configure rewriting .bazelrc makes using the git repo annoying because the file is changed. Also optionally import a /.bazelrc.user file that is gitignored so user-specific options can go in there. Fixes: tensorflow#22762 Fixes: tensorflow#22906 Signed-off-by: Jason Zaman <[email protected]>
This reverts commit a74a321. Bazel-0.18.0 is changing where it searches for .bazelrc files. Originally it was removing /tools/bazel.rc and only using /.bazelrc. This causes issues for gitignoring /.bazelrc and 0.18.0 has temporarily added tools/bazel.rc back to the list until 0.19. The long term solution is to use try-import but that statement is new in 0.18 and we are not going to bump TF's minimum right away. When 0.19 is out things will need to be changed back and the minimum bumped to 0.18. Fixes: tensorflow#22762 Fixes: tensorflow#22906 Signed-off-by: Jason Zaman <[email protected]>
Bazel-0.18.0 adds a try-import option that will non-fatally try and import a file. Use this for the configure options so that .bazelrc does not need to change. ./configure rewriting .bazelrc makes using the git repo annoying because the file is changed. Also optionally import a /.bazelrc.user file that is gitignored so user-specific options can go in there. Fixes: tensorflow#22762 Fixes: tensorflow#22906 Signed-off-by: Jason Zaman <[email protected]>
Bazel-0.18.0 adds a try-import option that will non-fatally try and import a file. Use this for the configure options so that .bazelrc does not need to change. ./configure rewriting .bazelrc makes using the git repo annoying because the file is changed. The allowed bazel range is now 0.18.0-0.20.0 inclusive. The env var TF_IGNORE_MAX_BAZEL_VERSION can be set to skip the max bazel version check. Also optionally import a /.bazelrc.user file that is gitignored so user-specific options can go in there. Fixes: tensorflow#22762 Fixes: tensorflow#22906 Signed-off-by: Jason Zaman <[email protected]>
Bazel-0.18.0 adds a try-import option that will non-fatally try and import a file. Use this for the configure options so that .bazelrc does not need to change. ./configure rewriting .bazelrc makes using the git repo annoying because the file is changed. The allowed bazel range is now 0.18.0-0.20.0 inclusive. The env var TF_IGNORE_MAX_BAZEL_VERSION can be set to skip the max bazel version check. Also optionally import a /.bazelrc.user file that is gitignored so user-specific options can go in there. Fixes: tensorflow#22762 Fixes: tensorflow#22906 Signed-off-by: Jason Zaman <[email protected]>
This PR removes .bazelrc from the git tree. Since it is modified during the configure, in essence it is a generated file and should not have been placed into the tree in the first place. Instead this PR adds a new file bazel_defaults and uses it to generate .bazelrc file. Also certain flags are such as -c opt and some environment variables that are not necessarily valid under all circumstances are disabled with this PR. Since these are mostly platform specific or override user command-line flags, these should be added with configuration prefixes rather than globally.
With this PR .bazelrc is created from template file and removed from git tree.