Add ability to build from git checkout, or obtain sources elsewhere.#50
Conversation
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
val-ms
left a comment
There was a problem hiding this comment.
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.
val-ms
left a comment
There was a problem hiding this comment.
The code looks good, outside of breaking support for the older 'url' option.
I need to play with this now.
| 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 |
There was a problem hiding this comment.
I'd like to see backwards compatibility with the older "url" option which is why I suggested deprecating instead of replacing.
There was a problem hiding this comment.
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'
There was a problem hiding this comment.
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. 👍
1b43f41 to
da44744
Compare
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.
da44744 to
be658af
Compare
| # 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 |
There was a problem hiding this comment.
@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/
There was a problem hiding this comment.
This should be fixed now.
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