Skip to content

Add ability to build from git checkout, or obtain sources elsewhere.#50

Merged
val-ms merged 4 commits intoCisco-Talos:masterfrom
jhumlick:CLAM-2938-add-depot_tools-support
Feb 26, 2026
Merged

Add ability to build from git checkout, or obtain sources elsewhere.#50
val-ms merged 4 commits intoCisco-Talos:masterfrom
jhumlick:CLAM-2938-add-depot_tools-support

Conversation

@jhumlick
Copy link
Contributor

In order to support some specialized build environments (i.e. Google), it is necessary to provide the ability to obtain sources via other means. This commit adds this functionality, and a future commit will add recipes which use these new features.

CLAM-2938

build steps.

In order to support some specialized build environments (i.e. Google),
it is necessary to provide the ability to obtain sources via other
means. This commit adds this functionality, and a future commit will add
recipes which use these new features.

CLAM-2938
@jhumlick jhumlick requested a review from val-ms January 22, 2026 21:48
@jhumlick jhumlick self-assigned this Jan 22, 2026
Copy link
Contributor

@val-ms val-ms left a comment

Choose a reason for hiding this comment

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

Overall I'm impressed with this PR.
I haven't tested it yet, so my comments far are just from code review.

of uri, git, or none. Documentation describing these changes is
incluided in this commit.
Copy link
Contributor

@val-ms val-ms left a comment

Choose a reason for hiding this comment

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

The code looks good, outside of breaking support for the older 'url' option.
I need to play with this now.

Comment on lines 255 to 261
self.logger.warning(
f"Failed to load recipe: {fpath}"
)
self.logger.warning(
f"Missing required 'url' field."
f"Recipe must have a 'source' field."
)
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like to see backwards compatibility with the older "url" option which is why I suggested deprecating instead of replacing.

Copy link
Contributor

Choose a reason for hiding this comment

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

I.e. I see this right now:


❯ msl build -t host-static -r clamav_deps
/Users/val/dev/clamav/mussels/.venv/lib/python3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(
2026-02-09 14:46:02 Mussels WARNING Failed to load recipe: /Users/val/.mussels/cookbooks/scrapbook/recipes/template.yaml
2026-02-09 14:46:02 Mussels WARNING Recipe must have a 'source' field.
2026-02-09 14:46:02 Mussels WARNING Failed to load recipe: /Users/val/.mussels/cookbooks/scrapbook/recipes/template_cmake.yaml
2026-02-09 14:46:02 Mussels WARNING Recipe must have a 'source' field.
2026-02-09 14:46:02 Mussels WARNING Failed to load recipe: 

....

2026-02-09 14:46:03 Mussels WARNING Recipe must have a 'source' field.
2026-02-09 14:46:03 Mussels WARNING Failed to load recipe: /Users/val/.mussels/cookbooks/clamav/recipes/libjson-c-0.yaml
2026-02-09 14:46:03 Mussels WARNING Recipe must have a 'source' field.
2026-02-09 14:46:03 Mussels ERROR clamav_deps build failed!
2026-02-09 14:46:03 Mussels WARNING Failed to assemble dependency chain for clamav_deps on Darwin (host-static):
2026-02-09 14:46:03 Mussels WARNING The clamav:libz recipe, required by clamav:clamav_deps-1.5 has dependency issues...
2026-02-09 14:46:03 Mussels WARNING 'libz'

Copy link
Contributor

Choose a reason for hiding this comment

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

I tried copying the pcre2 recipe, plus libbz2 and libz dependencies and using the source: with git:, branch:, tag:, and uri: options and they worked nicely. 👍

@jhumlick jhumlick force-pushed the CLAM-2938-add-depot_tools-support branch from 1b43f41 to da44744 Compare February 13, 2026 01:01
A top-level 'url' field is functionally equivalent to source.uri but if
both are specified, source.uri takes precedence. This allows for
backwards-compatibility with older recipes.
@jhumlick jhumlick force-pushed the CLAM-2938-add-depot_tools-support branch from da44744 to be658af Compare February 13, 2026 01:02
@val-ms val-ms self-requested a review February 17, 2026 19:11
Comment on lines +253 to 261
# Check for source field with valid configuration
if "source" not in yaml_file:
self.logger.warning(
f"Failed to load recipe: {fpath}"
)
self.logger.warning(
f"Missing required 'url' field."
f"Recipe must have a 'source' field."
)
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

@jhumlick this still fails for existing recipes that just have the 'url' field because of this code. After the change, please try testing using https://github.com/Cisco-Talos/clamav-mussels-cookbook/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be fixed now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems to be working nicely

@jhumlick jhumlick requested a review from val-ms February 26, 2026 19:48
@val-ms val-ms merged commit 8c1d9a9 into Cisco-Talos:master Feb 26, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants