stratum icon indicating copy to clipboard operation
stratum copied to clipboard

Building the stratum_bmv2 package fails at bazel build

Open hkgb77 opened this issue 2 years ago • 4 comments

Following steps were followed (as per https://github.com/stratum/stratum/blob/main/stratum/hal/bin/bmv2/README.md) : setup_dev_env.sh # You're inside the Docker container now bazel build //stratum/hal/bin/bmv2:stratum_bmv2_deb

It fails with the following error: ubuntu@4ac47be886bc:/stratum$ bazel build //stratum/hal/bin/bmv2:stratum_bmv2_deb DEBUG: Rule 'com_github_nelhage_rules_boost' indicated that a canonical reproducible form can be obtained by modifying arguments shallow_since = "1576879360 -0800" DEBUG: Repository com_github_nelhage_rules_boost instantiated at: /stratum/WORKSPACE:39:13: in /stratum/bazel/deps.bzl:222:23: in stratum_deps Repository rule git_repository defined at: /home/ubuntu/.cache/bazel/_bazel_ubuntu/1b07b1db06ec9ee22c71eac6f0bd4549/external/bazel_tools/tools/build_defs/repo/git.bzl:199:33: in ERROR: /stratum/stratum/hal/bin/bmv2/BUILD:65:20: in genrule rule //stratum/hal/bin/bmv2:license_file_stratum_bmv2_legal: target '//:NOTICE' is not visible from target '//stratum/hal/bin/bmv2:license_file_stratum_bmv2_legal'. Check the visibility declaration of the former target if you think the dependency is legitimate. To set the visibility of that source file target, use the exports_files() function ERROR: Analysis of target '//stratum/hal/bin/bmv2:stratum_bmv2_deb' failed; build aborted: Analysis of target '//stratum/hal/bin/bmv2:license_file_stratum_bmv2_legal' failed INFO: Elapsed time: 0.376s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured) currently loading: @bazel_tools//tools/jdk Fetching @rules_java; fetching

Bazelisk version: v1.8.0 Build label: 4.2.3 Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar Build time: Wed Oct 19 08:27:37 2022 (1666168057) Build timestamp: 1666168057 Build timestamp as int: 1666168057

ubuntu@4ac47be886bc:/stratum$ uname -a Linux 4ac47be886bc 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 GNU/Linux

hkgb77 avatar Jul 14 '23 07:07 hkgb77

Hi @hkgb77 ,

coul you specify a bit more your problem? I don't know if it can helps but you can dowload from this link the .deb file https://github.com/stratum/stratum/releases/tag/2022-06-30

Dscano avatar Jul 14 '23 07:07 Dscano

Thanks for the response. Following is what i wish to acheive.

I want to run stratum with bmv2 s/w switch and integrate that with a custom P4 pipeline fed by a proprietary controller.

For that I was willing to compile and run this without mininet and hence started following the link: https://github.com/stratum/stratum/blob/main/stratum/hal/bin/bmv2/README.md

hkgb77 avatar Jul 14 '23 08:07 hkgb77

I think that https://github.com/stratum/stratum/releases/tag/2022-06-30 is a single istance of bmv2+stratum

Dscano avatar Jul 14 '23 09:07 Dscano

I'm not able to reproduce your issue:

/stratum$ bazel build //stratum/hal/bin/bmv2:license_file_stratum_bmv2_legal
INFO: Analyzed target //stratum/hal/bin/bmv2:license_file_stratum_bmv2_legal (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //stratum/hal/bin/bmv2:license_file_stratum_bmv2_legal up-to-date:
  bazel-bin/stratum/hal/bin/bmv2/stratum_bmv2_legal/LICENSE
INFO: Elapsed time: 8.423s, Critical Path: 7.57s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action

But, I would focus your attention on this line:

ERROR: /stratum/stratum/hal/bin/bmv2/BUILD:65:20: 
  in genrule rule //stratum/hal/bin/bmv2:license_file_stratum_bmv2_legal: 
  target '//:NOTICE' is not visible from target '//stratum/hal/bin/bmv2:license_file_stratum_bmv2_legal'. 
Check the visibility declaration of the former target if you think the dependency 
is legitimate. To set the visibility of that source file target, use the exports_files() function

Have you made local changes to the BUILD or NOTICE files in the top level directory?

bocon13 avatar Nov 16 '23 23:11 bocon13