Bug 262216 - devel/bazel 5.0.0 does not work after successful installation on freebsd 13.0
Summary: devel/bazel 5.0.0 does not work after successful installation on freebsd 13.0
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-26 23:11 UTC by Ulas SAYGIN
Modified: 2022-03-27 12:17 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (aehlig)


Attachments
bazel build file (12.62 KB, text/plain)
2022-03-05 08:38 UTC, Ulas SAYGIN
no flags Details
bazel build file testing python file (2.92 KB, text/plain)
2022-03-05 08:39 UTC, Ulas SAYGIN
no flags Details
bazel build file python file (3.24 KB, text/plain)
2022-03-05 08:40 UTC, Ulas SAYGIN
no flags Details
Patch to update devel/bazel to the not yet released version 5.1.0 (1.97 KB, patch)
2022-03-19 15:24 UTC, Klaus Aehlig
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ulas SAYGIN 2022-02-26 23:11:44 UTC
Hi ,

i installed bazel 5.0.0 version with out problem by compiling from Freebsd port tree.

when i test to bazel , i used envoy project and bazel example projects to test it is function.

it failed and gived errors.

firstly, it didnt find python3 and pip3 tool which belongs to python 3.10
and i created symlink as pyhon3 to python 3.10 and then installed pip,
then started to working but now it gives error about jdk11 but jdk is perfectly working conditions. i cant find the reason why it is not working.
are there someone who can test this? is it only related to me or port?
i also created issue on bazel github account but noone answered.

https://github.com/bazelbuild/bazel/issues/14891

you can see details about errors both for failing build attempt to envoy and example c++ projects of bazel.

errors like


for envoyproxy from https://github.com/envoyproxy/envoy
    root@fbsd_bazel:~/envoy # bazel build //:envoy --sandbox_debug --host_javabase=@local_jdk//:jdk
    WARNING: Option 'host_javabase' is deprecated
    INFO: Build option --host_javabase has changed, discarding analysis cache.
    ERROR: /root/.cache/bazel/_bazel_root/4e47b77d977b209382cf04b3ae32963e/external/bazel_tools/tools/jdk/BUILD:432:8: In rule 'proguard_whitelister_test', size 'medium' is not a valid size.
    ERROR: /root/.cache/bazel/_bazel_root/4e47b77d977b209382cf04b3ae32963e/external/bazel_tools/tools/jdk/BUILD:432:8: In rule 'proguard_whitelister_test', timeout 'illegal' is not a valid timeout.
    ERROR: Analysis of target '//:envoy' failed; build aborted: error loading package '@bazel_tools//tools/jdk': Package 'tools/jdk' contains errors
    INFO: Elapsed time: 0,372s
    INFO: 0 processes.
    FAILED: Build did NOT complete successfully (1 packages loaded, 6 targets configured)

https://docs.bazel.build/versions/main/tutorial/cpp.html

    examples/cpp-tutorial/stage1 # bazel build //main:hello-world
    WARNING: Running Bazel server needs to be killed, because the startup options are different.
    Starting local Bazel server and connecting to it...
    ... still trying to connect to local Bazel server after 10 seconds ...
    ... still trying to connect to local Bazel server after 20 seconds ...
    ... still trying to connect to local Bazel server after 30 seconds ...
    ... still trying to connect to local Bazel server after 40 seconds ...
    ERROR: /root/.cache/bazel/_bazel_root/033bfece9530ea7f1b2e1c399eea4938/external/bazel_tools/tools/jdk/BUILD:432:8: In rule 'proguard_whitelister_test', size 'medium' is not a valid size.
    ERROR: /root/.cache/bazel/_bazel_root/033bfece9530ea7f1b2e1c399eea4938/external/bazel_tools/tools/jdk/BUILD:432:8: In rule 'proguard_whitelister_test', timeout 'illegal' is not a valid timeout.
    ERROR: Analysis of target '//main:hello-world' failed; build aborted: error loading package '@bazel_tools//tools/jdk': Package 'tools/jdk' contains errors
    INFO: Elapsed time: 50,453s
    INFO: 0 processes.
Comment 1 Klaus Aehlig 2022-02-27 11:27:18 UTC
Unfortunately, I'm not able to reproduce you report (see below). I was trying on stable/12, but since the message you reported are about bazel's build-description language, I doubt that this difference is relevant. My best guess is that some outdated rc-file is pulled in (bazel 5.0.0 is a new major release, so quite a few incompatible changes happened). Using the `--announce_rc` option might clarify this. Other than that, I, unfortunately, have no idea on how to debug further.


/tmp/examples/cpp-tutorial/stage1>bazel --version
bazel 5.0.0
/tmp/examples/cpp-tutorial/stage1>bazel build //main:hello-world
Starting local Bazel server and connecting to it...
INFO: Analyzed target //main:hello-world (35 packages loaded, 147 targets configured).
INFO: Found 1 target...
Target //main:hello-world up-to-date:
  bazel-bin/main/hello-world
INFO: Elapsed time: 2.895s, Critical Path: 0.48s
INFO: 5 processes: 3 internal, 2 processwrapper-sandbox.
INFO: Build completed successfully, 5 total actions
/tmp/examples/cpp-tutorial/stage1>bazel run //main:hello-world
INFO: Analyzed target //main:hello-world (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //main:hello-world up-to-date:
  bazel-bin/main/hello-world
INFO: Elapsed time: 0.114s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
Hello world
Sun Feb 27 12:14:27 2022
/tmp/examples/cpp-tutorial/stage1>ls -l WORKSPACE 
-rw-------  1 aehlig  wheel  0 Feb 27 12:03 WORKSPACE
/tmp/examples/cpp-tutorial/stage1>cat main/BUILD 
load("@rules_cc//cc:defs.bzl", "cc_binary")

cc_binary(
    name = "hello-world",
    srcs = ["hello-world.cc"],
)
/tmp/examples/cpp-tutorial/stage1>
Comment 2 Ulas SAYGIN 2022-02-27 11:39:28 UTC
(In reply to Klaus Aehlig from comment #1)
Thank you very much for fast reply. i will try on freebsd 12.

but i didnt understand what you mean about --announce_rc issue.
how can i look what you said?

do it need to run # bazel --announce_rc command? or other thing?
can you explain this with more details?

thank you very much for your help again.
god bless you.
Comment 3 Klaus Aehlig 2022-02-27 11:46:31 UTC
(In reply to Ulas SAYGIN from comment #2)

The option --announce_rc asks bazel to report all options pulled in from the various rc files. So, invoking bazel as

  bazel build --announce_rc //main:hello-world

should show all the options actually used, including information on where they come from.
Comment 4 Ulas SAYGIN 2022-02-28 00:35:38 UTC
(In reply to Klaus Aehlig from comment #3)
wonderful! i will look into it!. thanks a lot!
Comment 5 Ulas SAYGIN 2022-02-28 07:12:23 UTC
(In reply to Klaus Aehlig from comment #3)

hi, i compiled bazel in FreeBSD 12.2 release version and
tested example with your argument but no luck. same error.

root@fbsd122:~/examples/cpp-tutorial/stage1 # bazel build --announce_rc //main:hello-world
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=237
INFO: Reading rc options for 'build' from /usr/local/etc/bazel/bazel.bazelrc:
  'build' options: --strategy=Javac=standalone --java_runtime_version=11 --tool_java_runtime_version=11 --action_env=PATH=/bin:/usr/bin/:/usr/local/bin
ERROR: /root/.cache/bazel/_bazel_root/226a657e3ffc703888af21dbab4728de/external/bazel_tools/tools/jdk/BUILD:432:8: In rule 'proguard_whitelister_test', size 'medium' is not a valid size.
ERROR: /root/.cache/bazel/_bazel_root/226a657e3ffc703888af21dbab4728de/external/bazel_tools/tools/jdk/BUILD:432:8: In rule 'proguard_whitelister_test', timeout 'illegal' is not a valid timeout.
ERROR: Analysis of target '//main:hello-world' failed; build aborted: error loading package '@bazel_tools//tools/jdk': Package 'tools/jdk' contains errors
INFO: Elapsed time: 0,278s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
Comment 6 Fernando Apesteguía freebsd_committer freebsd_triage 2022-03-01 10:04:57 UTC
For bazel, in the update to 5.0.0 I tested that games/anki and net/gitlab-agent built fine with the new version.

As far as I know they still do since there is no messege in pkg-fallout that says otherwise.
Comment 7 Klaus Aehlig 2022-03-01 20:12:10 UTC
(In reply to Ulas SAYGIN from comment #5)

The flags seem correct, however the quoted build file is not what it should be. I have no idea how this could happen, as that file is a copy of the embedded repository bazel_tools; so somehow it seems your cache directory got corrupted. Can you remove ~/.cache/bazel entirely and try again. It the problem remains, it would be helpful to also include the relevant passage of the file bazel complained about; in the quoted example that would be the lines around 432 of /root/.cache/bazel/_bazel_root/4e47b77d977b209382cf04b3ae32963e/external/bazel_tools/tools/jdk/BUILD even though the hash in that path will change if you try in a different directory.
Comment 8 Ulas SAYGIN 2022-03-05 08:38:57 UTC
Created attachment 232256 [details]
bazel build file

this is bazel build file.
Comment 9 Ulas SAYGIN 2022-03-05 08:39:38 UTC
Created attachment 232257 [details]
bazel build file testing python file

bazel build file testing python file which gives error.
Comment 10 Ulas SAYGIN 2022-03-05 08:40:22 UTC
Created attachment 232258 [details]
bazel build file python file

bazel build file python file looks something to be ready, i guess
Comment 11 Ulas SAYGIN 2022-03-05 08:41:30 UTC
(In reply to Klaus Aehlig from comment #7)
i uploaded files in cache, you may look at it.
i will clear cache and try again.
Comment 12 Ulas SAYGIN 2022-03-05 08:45:38 UTC
after i cleaned cache , than i gave error. no compilation for example project of bazel. i dont think it is cache. because when i tried first time to compile example c++ project. it was the first time to run bazel after installation.
do you want me to upload again BUILD file and python files to see and find error?

root@fbsd122:~/examples/cpp-tutorial/stage1 # bazel build --announce_rc //main:hello-world
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
... still trying to connect to local Bazel server after 10 seconds ...
... still trying to connect to local Bazel server after 20 seconds ...
... still trying to connect to local Bazel server after 30 seconds ...
... still trying to connect to local Bazel server after 40 seconds ...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=129
INFO: Reading rc options for 'build' from /usr/local/etc/bazel/bazel.bazelrc:
  'build' options: --strategy=Javac=standalone --java_runtime_version=11 --tool_java_runtime_version=11 --action_env=PATH=/bin:/usr/bin/:/usr/local/bin
ERROR: /root/.cache/bazel/_bazel_root/226a657e3ffc703888af21dbab4728de/external/bazel_tools/tools/jdk/BUILD:432:8: In rule 'proguard_whitelister_test', size 'medium' is not a valid size.
ERROR: /root/.cache/bazel/_bazel_root/226a657e3ffc703888af21dbab4728de/external/bazel_tools/tools/jdk/BUILD:432:8: In rule 'proguard_whitelister_test', timeout 'illegal' is not a valid timeout.
ERROR: Analysis of target '//main:hello-world' failed; build aborted: error loading package '@bazel_tools//tools/jdk': Package 'tools/jdk' contains errors
INFO: Elapsed time: 56,318s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (28 packages loaded, 6 targets configured)
    Fetching @local_jdk; fetching
Comment 13 Ulas SAYGIN 2022-03-05 11:14:54 UTC
I think it is related to python version of default.

now i tested with another vanilla install, this time,
i didnt use make.conf and DEFAULT_VERSIONS for python which is python 3.10 for previous installations.
now i am able to compile the example cpp stage 1 logs are below.

i think reasons can be related to python versions or charset settings.
to investigate it, i will try to install another vanilla installation.

thank you everybody trying to help me. i will let you know my findings.

root@fbsdb:~/cpp-tutorial/stage1 #  bazel build --announce_rc //main:hello-world
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
... still trying to connect to local Bazel server after 10 seconds ...
... still trying to connect to local Bazel server after 20 seconds ...
... still trying to connect to local Bazel server after 30 seconds ...
... still trying to connect to local Bazel server after 40 seconds ...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=237
INFO: Reading rc options for 'build' from /usr/local/etc/bazel/bazel.bazelrc:
  'build' options: --strategy=Javac=standalone --java_runtime_version=11 --tool_java_runtime_version=11 --action_env=PATH=/bin:/usr/bin/:/usr/local/bin
INFO: Analyzed target //main:hello-world (35 packages loaded, 147 targets configured).
INFO: Found 1 target...
Target //main:hello-world up-to-date:
  bazel-bin/main/hello-world
INFO: Elapsed time: 53.770s, Critical Path: 0.96s
INFO: 5 processes: 3 internal, 2 processwrapper-sandbox.
INFO: Build completed successfully, 5 total actions
Comment 14 Ulas SAYGIN 2022-03-05 16:31:44 UTC
I havent tried on another python version but i tried envoyproxy to compile.
is there someone who can give an idea to compile envoyproxy by using local jdk because i couldnt do it.
you can look details on github issue link below.

https://github.com/envoyproxy/envoy/issues/20229
Comment 15 Ulas SAYGIN 2022-03-16 17:15:28 UTC
Hi, i am trying to compile envoyproxy with bazel. but it seems that bazel java toolchain does not supported on FreeBSD.
is there anybody who can use bazel with java support on FreeBSD? 

from bazel github issues

https://github.com/bazelbuild/bazel/issues/14891#issuecomment-1069318215

thank you everyone.
Comment 16 Klaus Aehlig 2022-03-19 15:21:55 UTC
As I have no experience with envoyproxy, I can't help here (and this port is probably the wrong one to file issues against). I will attach a patch to update the port to the upcoming 5.1.0 release (which I'm currently using), in case you want to try.
Comment 17 Klaus Aehlig 2022-03-19 15:24:12 UTC
Created attachment 232579 [details]
Patch to update devel/bazel to the not yet released version 5.1.0

This patch would update the port to the not-yet released version 5.1.0 of bazel. So it should not be committed (yet) but can help debugging the issue on a newer version of bazel.
Comment 18 Ulas SAYGIN 2022-03-19 15:52:07 UTC
(In reply to Klaus Aehlig from comment #16)
hi @Klaus Aehlig , thank you for your help.
it will be good to try it.
i understand that you dont need envoyproxy and you didnt use it.
in fact, i didnt use it before, all i want to try the port envoy but it turns out finding bugs related to other things like bazel and openjdk.
now i know that our freebsd port tree successfully intall bazel but
it does not create openjdk tool chain for bazel and bazel community does not support freebsd jdk tool chain. in this case, even for any java projects i cant use bazel to compile it not only envoyproxy but also all projects which needs jdk tool chain. i tried every possible action to make bazel work with local jdk but no luck. lastly i tried compile bazel from source but i coulndt do it.
i created a bug report on their github issues and i also created freebsd bug report about bazel port is not functioning well.
you may see it link below.
can i ask a favor, if you bazel works with java toolchain in your environment.
can you try to compile envoyproxy?

just you need to do this,and give feed about it?

thank you for you time and help and also thank you for patch , i will try.

git clone --single-branch --branch main https://github.com/envoyproxy/envoy.git /root/envoy/


bazel build --announce_rc -c opt envoy



https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262614
Comment 19 Klaus Aehlig 2022-03-19 16:40:41 UTC
(In reply to Ulas SAYGIN from comment #18)

I get the error quoted below. One of the interesting things is the --tool_java_runtime_version=remotejdk_11 picked up from envoy's .bazelrc; that jdk is a problem anyway, as the remotejdk is defined by dispatching over the supported operating systems (not including bazel). But that doesn't seem to be the only reference that prevents building against the locally installed jdk.


/memfs/tmp/envoy>bazel build --announce_rc -c opt envoy                                       
(17:26:52) INFO: Reading 'startup' options from /memfs/tmp/envoy/.bazelrc: --host_jvm_args=-Xmx2g
(17:26:52) INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=169
(17:26:52) INFO: Reading rc options for 'build' from /memfs/tmp/envoy/.bazelrc:
  Inherited 'common' options: --experimental_allow_tags_propagation
(17:26:52) INFO: Reading rc options for 'build' from /crypto/general/aehlig/conf/.bazelrc:
  Inherited 'common' options: --experimental_ui_actions_shown 12
(17:26:52) INFO: Reading rc options for 'build' from /usr/local/etc/bazel/bazel.bazelrc:
  'build' options: --strategy=Javac=standalone --java_runtime_version=11 --tool_java_runtime_version=11 --action_env=PATH=/bin:/usr/bin/:/usr/local/bin
(17:26:52) INFO: Reading rc options for 'build' from /memfs/tmp/envoy/.bazelrc:
  'build' options: --color=yes --workspace_status_command=bash bazel/get_workspace_status --incompatible_strict_action_env --host_force_python=PY3 --java_runtime_version=remotejdk_11 --tool_java_runtime_version=remotejdk_11 --enable_platform_specific_config --define absl=1 --action_env=CC --action_env=CXX --action_env=LLVM_CONFIG --action_env=PATH --test_env=HEAPCHECK=normal --test_env=PPROF_PATH
(17:26:52) INFO: Reading rc options for 'build' from /crypto/general/aehlig/conf/.bazelrc:
  'build' options: --symlink_prefix=/ --show_progress_rate_limit=0.2 --show_timestamps --distdir=/home/aehlig/.cache/distdir
(17:26:52) INFO: Current date is 2022-03-19
(17:26:52) INFO: Build options --compilation_mode, --host_javabase, --java_runtime_version, and 1 more have changed, discarding analysis cache.
(17:26:52) ERROR: /crypto/general/aehlig/.cache/bazel/_bazel_aehlig/f8d4628c4218c908b0cf33cb4d5f53b8/external/bazel_tools/tools/jdk/BUILD:29:19: While resolving toolchains for target @bazel_tools//tools/jdk:current_java_runtime: no matching toolchains found for types @bazel_tools//tools/jdk:runtime_toolchain_type
(17:26:52) ERROR: Analysis of target '//:envoy' failed; build aborted: 
(17:26:52) INFO: Elapsed time: 0.328s
(17:26:52) INFO: 0 processes.
(17:26:52) FAILED: Build did NOT complete successfully (0 packages loaded, 8547 targets configured)
    Fetching @boringssl; fetching
/memfs/tmp/envoy>
Comment 20 Ulas SAYGIN 2022-03-20 11:46:53 UTC
(In reply to Klaus Aehlig from comment #19)
Thank you for your help. what do you think about to make bazel compile envoyproxy? 
i mean you said remotejdk_11 seems problem for compiling but you said it is not only problem. what other problems you think?
i read documentation but i really dont understand remotejdk magic.
because bazel has jdk 11 support why people dont use it for envoyproxy?
what is the problem. in this case, envoyproxy developers seem to me they dont want to use all options as they said to compatible with all cpu architectures.
because , their strong argument about to use bazel is cmake didnt provide envoy to compile for some cpu archectures. if they really care about it, compiling for freebsd shouldnt be problem :)

i also find converters from bazel to cmake but none of them seems working completely :(


i tried to change bazel.rc file by editing local_jdk but no luck.
i think envoy bazel settings are not complete.
i dont know how to overcome this, because i am not familiar with bazel and its documentation does not seem well to me.
there are a lot of things changed and discussed in github issues and people give some command prompt args but i am not able to correct envoy bazel with them.

lastly, i just want 2 things from you.
can we have port for bazel 4.2 version? seperately to test bazel?
because now i am not able to compile example java projects of bazel :)
i thougt that this bazel should have at least 4.2 version as stable and working without problem. i think this version seems ok but i know it may not have latest config changes or it may have i am not sure how bazel developers think about compability old versions of bazel. can we have port for bazel4.2? which is major version, if i am not wrong. /usr/ports/devel/bazel42 could be nice , if it is possible. or if you can provide patch for this, i can try.

second thing is ,can you able compile example java projects of bazel which gives on documentation? did you try it? if not,can you try it to be sure about java tool chain is not working? or working as expected. i think we are not sure about that, or at least i am for other peoples system.

thanks a lot for you help.
i would like to have envoyprxy for freebsd if i can achieve the bazel works without problem:) and many more other ports.
Comment 21 Ulas SAYGIN 2022-03-22 09:50:42 UTC
(In reply to Klaus Aehlig from comment #19)
yesterday i tried your patch about 5.1 version bazel and it successed to compile and install. i will share logs later.

but meanwhile i tried envoyproxy to compile with bazel 5.0 with my old installation. i changed bazel.rc file as additionaljdk and i added freebsd jdk path to WORKSPACE file as option like documentation said and i passed partially jdk problem and i reached another problem, google V8 engine which bazel needs it.

after that i understand that bazel ports needs more than openJDK compilation like,i mean bazel port only compiles jdk as required component to make bazel working but it is general state, because when you want to bazel fully working you will need full tool chains or i mean other 3rparty tools which bazel will need it while compiling and testing the project.

in this case, we need options for bazel port like,
do you want to install all dependency ports that probably need it for bazel build system in order to compile any project.

i mean for dependencies bazel look operation system and gets supported dependency like v8 for linux but there is no freebsd version on their repos.
but when i look freebsd port tree, there is V8 port which is patched and servedfor FreeBSD. V8 does not have FreeBSD support either.

as result of it, bazel port should install all other ports which is needed for bazel, and we will add WORKSPACE options like i added openJDK and we can use bazel without problem.

i found this paper,and it is about to distributions, i think we know the guy who knows everything about bazel more than me if we look this paper author ;)

my question is, can we make  bazel work fully with FreeBSD because only OPENJDK as requirement for this port is not enough. bazel needs more.

in fact, if we can find way to tell bazel in configuration files, 
like please use this port on FreeBSD port tree instead of trying to download from repo.
that can be more helpfull but i dont have knowledge about it now.

on otherhand, while i was researching bazel, i started to liking ilittle bit.
it may help also FreeBSD port tree also. bu i think bazel needs UI to show what is the configuration for the project, i didnt see it. but i learnt that bazel has graph representation for compilation. that could be nice but not full detailed to understand everything.

if we  have opportunity to improve bazel port, i need your help. i can help for testing and verification, while i am learning bazel.

do you have time for this?

thank you for your help me to understand bazel.

https://github.com/bazelbuild/bazel-website/blob/master/designs/_posts/2016-10-11-distribution-artifact.md
Comment 22 Klaus Aehlig 2022-03-26 16:21:25 UTC
(In reply to Ulas SAYGIN from comment #21)

You're right in noting that bazel is just a build tool and its runtime dependencies are just those needed to make the tool run. As with other any other build tool, just the build tool is not enough to build a project; you have additional dependencies on the tool chain (in particular, the compiler) for the language the project is written in, often additional libraries, etc.

That's perfectly normal, and I disagree with the suggestion that bazel should pull in all tools it could possibly be used with; as it is a generic build tool, that would include a compiler and libraries for every programming language ever ported to FreeBSD, which certainly is unreasonable.
Comment 23 Klaus Aehlig 2022-03-26 16:26:49 UTC
(In reply to Ulas SAYGIN from comment #20)

If there is a need we can have a port for bazel 4.2. To try if that solves your problem, you can check out that version from the port's history; it should still build cleanly of current versions of FreeBSD. If that solves your porting problem, I see no reason why not to have a separate port for every major version of bazel still supported upstream.
Comment 24 Ulas SAYGIN 2022-03-27 11:55:25 UTC
(In reply to Klaus Aehlig from comment #22)

"You're right in noting that bazel is just a build tool and its runtime dependencies are just those needed to make the tool run. As with other any other build tool, just the build tool is not enough to build a project; you have additional dependencies on the tool chain (in particular, the compiler) for the language the project is written in, often additional libraries, etc."

i am totally i aggree with you no any opposite idea.

"That's perfectly normal, and I disagree with the suggestion that bazel should pull in all tools it could possibly be used with; as it is a generic build tool, that would include a compiler and libraries for every programming language ever ported to FreeBSD, which certainly is unreasonable."

yes i am aggre with you but i just said that because we may have options to install ports that is already patched for FreeBSD OS by Wonderful People.
i tried to said, we may have option that selects all needed ports at one click. just easy option select all for User experience i asked that, but normally, all tools etc. should be selected by one by one. it is ideal. i mean you are right about saying "unreasonable" i also remember postgreSQL port which requires LLVM13 to compile for JIT code to compile in postgresql queries if needed but it seems it is not mandotory for postgresql unless you want to use JIT code to use for your postgresql project. in this case, if i am not wrong, postgresql has "unreasonable option" which takes postgresql compilation more than 5 hours...

i am totaly i aggre your perspective. but i couldnt express myself in the post,
i was focusing on solving all dependency issues to make everyone use bazel and may help for their projects and it will help people.
Comment 25 Ulas SAYGIN 2022-03-27 12:17:15 UTC
(In reply to Klaus Aehlig from comment #23)

"If there is a need we can have a port for bazel 4.2. To try if that solves your problem, you can check out that version from the port's history; it should still build cleanly of current versions of FreeBSD. If that solves your porting problem, I see no reason why not to have a separate port for every major version of bazel still supported upstream."

thank you for your kindness,i am glad to hear to make port version 4.2 if it solves my problem. but i suggested that because maybe it may help other people,
who will firstly start bazel, and maybe somehow , they will find project to compile which they will need 4.2 version because the options selected in bazel configuration for project can be best fit for 4.2 version.
I need to say, i dont know bazel very well and i am not sure anyone will need previous version of bazel to compile some projects. because of this, i mentioned that to learn it from you.

thank you for kind response again.

now i understand i need to be able to use bazel tool chains or other dependencies as locally. make bazel to work with local version of the tools and any needs
which FreeBSD port system has patched and ready to use.

in this case, i need your help if you can,
can you help me about, how i can list the dependecies and tools needed by bazel project and, how i may make bazel config to look locally that dependency is exist and use it.

i may create program later, when i learn it to make those changes manually,
the program will read bazel configuration of project and replaces configuration to make bazel use every dependency as local one, not remote one.

i am not talking about installing ports. just configuration changes for bazel project.

i may also create blog post etc for bazel tool chains and dependency installation from FreeBSD port tree to inform people, and maybe i may ask bazel team to make FreeBSD section,they may put in their documentation or github wiki wherever they want to put to inform people about FreeBSD usage of bazel.
they are not against it. just they dont have resources about it.

why i want this , because it is not only for my need, people will also need and this will create demand for any system or project usage on freebsd and maybe we can have other projects like envoyproxy supporting FreeBSD and other people can patch and make FreeBSD community use the other projects on FreeBSD.

That is what is in my mind.i am not only thinking my need. because i started to like the bazel and i will learn it but if you give tips or things that will help me, i will be happy. 

for now, i have family member in intensive care and i may not able to respond on time and i may not have time to test things but i want to make use bazel to compile any project like other supported system if it is possible.

any idea and your help is appreciated.

thanks a lot for you time.