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

Cannot build for Go: Unable to load package for //private_set_intersection/python:requirements.txt #188

Closed
petrkamnev opened this issue Jan 15, 2024 · 3 comments
Labels
Type: Question ❔ Question about implementation or some technical aspect

Comments

@petrkamnev
Copy link

Question

During bazel build an error occurs that BUILD file is not found in /private_set_intersection/python

Further Information

  1. I edited my WORKSPACE and BUILD files according to the instructions
  2. I run "bazel build //..."
  3. An error occurs:
INFO: Repository pip_deps instantiated at:
  /Users/a1/git_repos/repo_name/WORKSPACE:46:9: in <toplevel>
  /private/var/tmp/_bazel_a1/dfe3157b64ac0d90774c2ee53fc75141/external/org_openmined_psi/private_set_intersection/deps.bzl:111:14: in psi_deps
  /private/var/tmp/_bazel_a1/dfe3157b64ac0d90774c2ee53fc75141/external/rules_python/python/pip.bzl:160:19: in pip_parse
Repository rule pip_repository defined at:
 /private/var/tmp/_bazel_a1/dfe3157b64ac0d90774c2ee53fc75141/external/rules_python/python/pip_install/pip_repository.bzl:474:33: in <toplevel>
ERROR: An error occurred during the fetch of repository 'pip_deps':
   Traceback (most recent call last):
        File "/private/var/tmp/_bazel_a1/dfe3157b64ac0d90774c2ee53fc75141/external/rules_python/python/pip_install/pip_repository.bzl", line 308, column 18, in _pip_repository_impl
                rctx.path(requirements_txt),
Error in path: Unable to load package for //private_set_intersection/python:requirements.txt: BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - /Users/a1/git_repos/repo_name/private_set_intersection/python

I even tried to add this folder locally, but after that I began receiving other errors. I'm not sure if it's a bug or I'm doing something incorrectly.

My WOKRSPACE:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")


http_archive(
    name = "io_bazel_rules_go",
    integrity = "sha256-fHbWI2so/2laoozzX5XeMXqUcv0fsUrHl8m/aE8Js3w=",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.44.2/rules_go-v0.44.2.zip",
        "https://github.com/bazelbuild/rules_go/releases/download/v0.44.2/rules_go-v0.44.2.zip",
    ],
)

http_archive(
    name = "bazel_gazelle",
    integrity = "sha256-MpOL2hbmcABjA1R5Bj2dJMYO2o15/Uc5Vj9Q0zHLMgk=",
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.35.0/bazel-gazelle-v0.35.0.tar.gz",
        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.35.0/bazel-gazelle-v0.35.0.tar.gz",
    ],
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
load("//:deps.bzl", "go_dependencies")

# gazelle:repository_macro deps.bzl%go_dependencies
go_dependencies()

go_rules_dependencies()

gazelle_dependencies(go_repository_default_config = "//:WORKSPACE.bazel")

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
   name = "org_openmined_psi",
   remote = "https://github.com/OpenMined/PSI",
   branch = "master",
)

load("@org_openmined_psi//private_set_intersection:preload.bzl", "psi_preload")

psi_preload()

load("@org_openmined_psi//private_set_intersection:deps.bzl", "psi_deps")

psi_deps()

load("@pip_deps//:requirements.bzl", "install_deps")

install_deps()

load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "npm_install")

node_repositories()

npm_install(
    name = "npm",
    package_json = "//:package.json",
    package_lock_json = "//:package-lock.json",
)

load("@emsdk//:emscripten_deps.bzl", emsdk_emscripten_deps = "emscripten_deps")

emsdk_emscripten_deps()

System Information

  • OS: MacOS
  • OS Version: 13.6 (22G120)
  • Language Version: bazel 6.4.0-homebrew, go 1.21.6.

Additional Context

Tried on Win10 with WSL, the result is the same.

@petrkamnev petrkamnev added the Type: Question ❔ Question about implementation or some technical aspect label Jan 15, 2024
@s0l0ist s0l0ist mentioned this issue Jan 16, 2024
4 tasks
@s0l0ist
Copy link
Contributor

s0l0ist commented Jan 17, 2024

This is a bug in the WORKFLOW file/instructions.

I have a PR (#190) that I'm testing to see if it will resolve.

Regarding windows, it may not work - we don't test/support building the PSI library on that platform.

@s0l0ist
Copy link
Contributor

s0l0ist commented Jan 17, 2024

@petrkamnev I've merged a fix (I hope). Please follow the new workspace instructions in the README and try again.

You may need to have python 3.10 installed and available in your shell when running the bazel commands.

@petrkamnev
Copy link
Author

Yes, it worked for me. Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question ❔ Question about implementation or some technical aspect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants