Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions bazel/foreign_cc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,31 @@ configure_make(
tags = ["skip_on_windows"],
)

configure_make(
name = "colm",
configure_in_place = True,
configure_options = [
"AUTOMAKE=automake",
"ACLOCAL=aclocal",
],
# Workaround for the issue with statically linked libstdc++
# using -l:libstdc++.a.
env = {
"CXXFLAGS": "-lstdc++ -Wno-unused-command-line-argument",
},
lib_source = "@net_colm_open_source_colm//:all",
out_binaries = ["colm"],
tags = ["skip_on_windows"],
)

configure_make(
name = "ragel",
configure_in_place = True,
configure_options = [
"AUTOMAKE=automake",
"ACLOCAL=aclocal",
"--disable-manual",
"--with-colm=$EXT_BUILD_DEPS/colm",
],
# Workaround for the issue with statically linked libstdc++
# using -l:libstdc++.a.
Expand All @@ -128,6 +148,7 @@ configure_make(
lib_source = "@net_colm_open_source_ragel//:all",
out_binaries = ["ragel"],
tags = ["skip_on_windows"],
deps = [":colm"],
)

# ICU used by the language detection filter (i18n).
Expand Down
11 changes: 11 additions & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def envoy_dependencies(skip_targets = []):
_com_googlesource_googleurl()
_io_hyperscan()
_io_opentracing_cpp()
_net_colm_open_source_colm()
_net_colm_open_source_ragel()
_net_zlib()
_intel_dlb()
Expand Down Expand Up @@ -426,6 +427,16 @@ def _com_github_libevent_libevent():
actual = "@envoy//bazel/foreign_cc:event",
)

def _net_colm_open_source_colm():
external_http_archive(
name = "net_colm_open_source_colm",
build_file_content = BUILD_ALL_CONTENT,
)
native.bind(
name = "colm",
actual = "@envoy//bazel/foreign_cc:colm",
)

def _net_colm_open_source_ragel():
external_http_archive(
name = "net_colm_open_source_ragel",
Expand Down
22 changes: 19 additions & 3 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -510,20 +510,36 @@ REPOSITORY_LOCATIONS_SPEC = dict(
release_date = "2020-07-28",
cpe = "cpe:2.3:a:libevent_project:libevent:*",
),
net_colm_open_source_colm = dict(
project_name = "Colm",
project_desc = "The Colm Programming Language",
project_url = "https://www.colm.net/open-source/colm/",
version = "0.14.7",
sha256 = "6037b31c358dda6f580f7321f97a182144a8401c690b458fcae055c65501977d",
strip_prefix = "colm-{version}",
urls = ["https://www.colm.net/files/colm/colm-{version}.tar.gz"],

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reference Github locations for these files? It's easier to reason about the dependency with canonical links to GH, including things like licenses.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may take time to try to switch to the GitHub repo. Previously, the repo and the tar ball contains different files. Ragel codes from the repo require Ragel itself to compile, which is ridiculous.

@moderation moderation Aug 10, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @htuch. I came here to say the same thing. I've been running the following for months without issue
urls = ["https://github.com/adrian-thurston/ragel/archive/ragel-{version}.tar.gz"],
Edit: I'm not compiling in any of the Intel Hyperscan contrib extensions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I fixed that just now, thanks.

use_category = ["dataplane_ext"],
extensions = [
"envoy.matching.input_matchers.hyperscan",
"envoy.regex_engines.hyperscan",
],
release_date = "2021-02-15",
cpe = "N/A",
),
Comment on lines +513 to +532

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poor results on OSSF scan

scorecard --repo=https://github.com/adrian-thurston/colm
RESULTS
-------
Aggregate score: 4.8 / 10

Check scores:
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
|  SCORE  |          NAME          |             REASON             |                             DOCUMENTATION/REMEDIATION                             |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | Binary-Artifacts       | no binaries found in the repo  | https://github.com/ossf/scorecard/blob/main/docs/checks.md#binary-artifacts       |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 0 / 10  | Branch-Protection      | branch protection not enabled  | https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection      |
|         |                        | on development/release         |                                                                                   |
|         |                        | branches                       |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 0 / 10  | CI-Tests               | 0 out of 22 merged PRs         | https://github.com/ossf/scorecard/blob/main/docs/checks.md#ci-tests               |
|         |                        | checked by a CI test -- score  |                                                                                   |
|         |                        | normalized to 0                |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 0 / 10  | CII-Best-Practices     | no badge detected              | https://github.com/ossf/scorecard/blob/main/docs/checks.md#cii-best-practices     |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 3 / 10  | Code-Review            | GitHub code reviews found for  | https://github.com/ossf/scorecard/blob/main/docs/checks.md#code-review            |
|         |                        | 9 commits out of the last 30   |                                                                                   |
|         |                        | -- score normalized to 3       |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | Contributors           | 13 different organizations     | https://github.com/ossf/scorecard/blob/main/docs/checks.md#contributors           |
|         |                        | found -- score normalized to   |                                                                                   |
|         |                        | 10                             |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | Dangerous-Workflow     | no dangerous workflow patterns | https://github.com/ossf/scorecard/blob/main/docs/checks.md#dangerous-workflow     |
|         |                        | detected                       |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 0 / 10  | Dependency-Update-Tool | no update tool detected        | https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 0 / 10  | Fuzzing                | project is not fuzzed          | https://github.com/ossf/scorecard/blob/main/docs/checks.md#fuzzing                |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | License                | license file detected          | https://github.com/ossf/scorecard/blob/main/docs/checks.md#license                |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 0 / 10  | Maintained             | 0 commit(s) out of 30 and 1    | https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained             |
|         |                        | issue activity out of 30 found |                                                                                   |
|         |                        | in the last 90 days -- score   |                                                                                   |
|         |                        | normalized to 0                |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| ?       | Packaging              | no published package detected  | https://github.com/ossf/scorecard/blob/main/docs/checks.md#packaging              |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | Pinned-Dependencies    | all dependencies are pinned    | https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies    |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 0 / 10  | SAST                   | SAST tool is not run on all    | https://github.com/ossf/scorecard/blob/main/docs/checks.md#sast                   |
|         |                        | commits -- score normalized to |                                                                                   |
|         |                        | 0                              |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 0 / 10  | Security-Policy        | security policy file not       | https://github.com/ossf/scorecard/blob/main/docs/checks.md#security-policy        |
|         |                        | detected                       |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| ?       | Signed-Releases        | no releases found              | https://github.com/ossf/scorecard/blob/main/docs/checks.md#signed-releases        |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | Token-Permissions      | tokens are read-only in GitHub | https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions      |
|         |                        | workflows                      |                                                                                   |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|
| 10 / 10 | Vulnerabilities        | no vulnerabilities detected    | https://github.com/ossf/scorecard/blob/main/docs/checks.md#vulnerabilities        |
|---------|------------------------|--------------------------------|-----------------------------------------------------------------------------------|

net_colm_open_source_ragel = dict(
project_name = "Ragel",
project_desc = "Ragel State Machine Compiler",
project_url = "https://www.colm.net/open-source/ragel/",
version = "6.10",
sha256 = "5f156edb65d20b856d638dd9ee2dfb43285914d9aa2b6ec779dac0270cd56c3f",
version = "7.0.4",
sha256 = "84b1493efe967e85070c69e78b04dc55edc5c5718f9d6b77929762cb2abed278",
strip_prefix = "ragel-{version}",
urls = ["https://www.colm.net/files/ragel/ragel-{version}.tar.gz"],
use_category = ["dataplane_ext"],
extensions = [
"envoy.matching.input_matchers.hyperscan",
"envoy.regex_engines.hyperscan",
],
release_date = "2017-03-24",
release_date = "2021-02-15",
cpe = "N/A",
),
# This should be removed, see https://github.com/envoyproxy/envoy/issues/13261.
Expand Down