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

make cli fails on main on M1 mac #93

Closed
willmurphyscode opened this issue Jun 28, 2023 · 1 comment
Closed

make cli fails on main on M1 mac #93

willmurphyscode opened this issue Jun 28, 2023 · 1 comment
Labels
bug Something isn't working changelog-ignore

Comments

@willmurphyscode
Copy link
Contributor

What happened:

Running git clone git@github.com:anchore/yardstick ytest && cd ytest && make bootstrap && poetry install && make all fails because it can't install an old enough grype on main.

What you expected to happen:

All the validation targets should pass on a clean checkout of main.

How to reproduce it (as minimally and precisely as possible):

git clone git@github.com:anchore/yardstick ytest && cd ytest && make bootstrap && poetry install && make all

Anything else we need to know?:

Hypothesis

This is likely because the requested version of grype, https://github.com/anchore/grype/releases/tag/v0.27.0, only has a zip for the darwin_arm64 image, but has a .dmg for darwin_amd64.

Later releases of grype, such as https://github.com/anchore/grype/releases/tag/v0.50.2, have a .tar.gz for both versions.

Stacktrace of failure:

one
[info] checking github for release tag='v0.27.0'
[info] fetching release script for tag='v0.27.0'
anchore/grype info checking GitHub for tag 'v0.27.0'
anchore/grype info found version: 0.27.0 for v0.27.0/darwin/arm64
Traceback (most recent call last):
  File "/private/tmp/ytest/tests/cli/venv/bin/yardstick", line 8, in <module>
    sys.exit(cli())
  File "/private/tmp/ytest/tests/cli/venv/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/private/tmp/ytest/tests/cli/venv/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/private/tmp/ytest/tests/cli/venv/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/private/tmp/ytest/tests/cli/venv/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/private/tmp/ytest/tests/cli/venv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/private/tmp/ytest/tests/cli/venv/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/private/tmp/ytest/tests/cli/venv/lib/python3.9/site-packages/click/decorators.py", line 38, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "/private/tmp/ytest/src/yardstick/cli/result.py", line 45, in capture_results
    capture.result_set(
  File "/private/tmp/ytest/src/yardstick/capture.py", line 164, in result_set
    scan_config = one(scan_request, producer_state=producer_data_path, profiles=profiles)
  File "/private/tmp/ytest/src/yardstick/capture.py", line 105, in one
    match_results, raw_json = run_scan(config=scan_config, profile=profile_obj)
  File "/private/tmp/ytest/src/yardstick/capture.py", line 32, in run_scan
    tool = tool_cls.install(version=config.tool_version, path=path, use_cache=not reinstall, **kwargs)
  File "/private/tmp/ytest/src/yardstick/tool/grype.py", line 207, in install
    tool_obj = cls._install_from_installer(version=version, path=path, use_cache=use_cache, **kwargs)
  File "/private/tmp/ytest/src/yardstick/tool/grype.py", line 65, in _install_from_installer
    os.chmod(f"{path}/grype", 0o755)
FileNotFoundError: [Errno 2] No such file or directory: '.yardstick/tools/grype/v0.27.0/grype'
Exited with 1
make[1]: *** [test] Error 1
make: *** [cli] Error 2

Environment:

  • Output of yardstick version: yardstick 0.0.0 (using a dev build off main)
  • OS (e.g: cat /etc/os-release or similar): M1 macbook pro
@willmurphyscode willmurphyscode added the bug Something isn't working label Jun 28, 2023
@willmurphyscode willmurphyscode added changelog-ignore bug Something isn't working and removed bug Something isn't working labels Jul 26, 2023
@willmurphyscode
Copy link
Contributor Author

I'm no longer able to reproduce this issue, so I'm going to assume it was fixed by intermediate development and close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working changelog-ignore
Projects
None yet
Development

No branches or pull requests

1 participant