bazelbuild / rules_cc

C++ Rules for Bazel
https://bazel.build
Apache License 2.0
182 stars 90 forks source link

rules_cc is being used by rules_go, and needs a published release archive #68

Closed mescanne closed 8 months ago

mescanne commented 4 years ago

Description of the problem / feature request:

rules_cc is being relied upon by rules_go, but there is published release archive yet of rules_cc. This makes building offline much more difficult due to using git_archive.

Background:

Feature requests: what underlying problem are you trying to solve with this feature?

Using distdir requires using http_archive.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Replace this line with your answer.

What operating system are you running Bazel on?

N/A

What's the output of bazel info release?

N/A

If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.

N/A

What version of rules_cc do you use? Can you paste the workspace rule used to fetch rules_cc? What other relevant dependencies does your project have?

See rules_go reference. The desire is to use a published version.

What Bazel options do you use to trigger the issue? What C++ toolchain do you use?

N/A

Have you found anything relevant by searching the web?

N/A

Any other information, logs, or outputs that you want to share?

N/A

jakemcc commented 4 years ago

@mescanne Mentioning this in case you were unaware and it helps you get unblocked, you can use http_archive with git repos hosted on github. Example from a WORKSPACE I manage.

http_archive(
    name = "rules_cc",
    sha256 = "5233d5a14c23c2a9c1df0e76deba0100090f973b15e5460b596283b569823c8c",
    strip_prefix = "rules_cc-4de26b53a6ad892b605e747fbafe256e48d5b56e",
    urls = ["https://github.com/bazelbuild/rules_cc/archive/4de26b53a6ad892b605e747fbafe256e48d5b56e.zip"],
)
jayconrod commented 4 years ago

@jakemcc This isn't safe unless the .zip file is mirrored somewhere else, too.

.zip files from that endpoint are prepared on demand. The SHA-256 sum can change over time, since it depends on GitHub's system software, compression settings, file order, and so on. This has broken builds multiple times in the past. That's why rules_go uses git_repository for this, not http_archive.