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

ERROR: build ratelimit failed #3

Closed
VoxT opened this issue Jun 12, 2018 · 2 comments
Closed

ERROR: build ratelimit failed #3

VoxT opened this issue Jun 12, 2018 · 2 comments

Comments

@VoxT
Copy link

VoxT commented Jun 12, 2018

Hi,

I build like Setup section but have an error like this.

.
.
.
INFO: SHA256 (https://github.com/google/protobuf/archive/v3.4.1.tar.gz) = 8e0236242106e680b4f9f576cc44b8cd711e948b20a9fc07769b0a20ceab9cc4

INFO: SHA256 (https://github.com/civetweb/civetweb/archive/85424a4.tar.gz) = 00295dda3b6cd8c87f068b7f58464fa9fc35d26c846162b73a01fa895bd42525

ERROR: ...ratelimit/smyte-db/third_party/workspace.bzl:66:5: no such package '@civetweb_git//': Prefix civetweb-85424a4 was given, but not found in the archive and referenced by '//external:civetweb'

ERROR: Analysis of target '//ratelimit:ratelimit' failed; build aborted: Loading failed

Can anyone help me ?

@VoxT
Copy link
Author

VoxT commented Jun 12, 2018

Well,
I just change /smyte-db/third_party/workspace.bzl

# civetweb
    native.new_git_repository(
        name = "civetweb_git",
        remote = "https://github.com/civetweb/civetweb.git",
        commit = "85424a",
        build_file = workspace_name + "//third_party:civetweb.BUILD"
    )

to full commit id

# civetweb
    native.new_git_repository(
        name = "civetweb_git",
        remote = "https://github.com/civetweb/civetweb.git",
        commit = "85424a4ad51eadc7e0b5942cadff2869a3ea1d84",
        build_file = workspace_name + "//third_party:civetweb.BUILD"
    )

and it's work. BUT another Error :(

INFO: Found 1 target...
ERROR: /home/lap11612-local/.cache/bazel/_bazel_lap11612-local/68d74f66ddd61171560d4315e637150a/external/rocksdb_git/BUILD.bazel:3:1: Executing genrule @rocksdb_git//:build_version failed (Exit 1)
cat: external/rocksdb_git/.git/HEAD: No such file or directory
Target //ratelimit:ratelimit failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 516.546s, Critical Path: 21.36s
INFO: 953 processes: 949 linux-sandbox, 4 local.
FAILED: Build did NOT complete successfully

Still working on it .....

@VoxT
Copy link
Author

VoxT commented Jun 12, 2018

well well,

figure out that the reason is bazel download rocksdb_git v5.7.3.tar.gz from git and extract it, so it does not has the .git folder.

/third_party/rocksdb.BUILD required .git

genrule(
    name = "build_version",
    srcs = glob([".git/**/*"]) + [
        "util/build_version.cc.in",
    ],
    outs = [
        "util/build_version.cc",
    ],
    # `git rev-parse HEAD` returns the SHA, but it does not work in all the environments
    # when combined with bazel sandboxing
    cmd = "GIT_DIR=external/rocksdb_git/.git; " +
        "GIT_SHA=$$(cat $$GIT_DIR/HEAD | cut -d \" \" -f 2 | xargs -I {} cat $$GIT_DIR/{}); " +
        "sed -e s/@@GIT_SHA@@/$$GIT_SHA/ -e s/@@GIT_DATE_TIME@@/$$(date +%F)/ " +
        "external/rocksdb_git/util/build_version.cc.in >> $(@)",
)

I have to move to .cache/bazel/_bazel_lap11612-local/68d74f66ddd61171560d4315e637150a/external/rocksdb_git

Then git init and check out v5.7.3.

Now it's build successfully.

Thanks the sun

@VoxT VoxT closed this as completed Jun 12, 2018
danielcompton added a commit to danielcompton/smyte-db that referenced this issue Jul 9, 2018
Without the full commit SHA you get an error like:

Prefix civetweb-85424a4 was given, but not found in the archive

Relates to smyte#3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant