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

Can not run targeted benchmark function in project #1651

Open
vssukharev opened this issue Nov 30, 2024 · 4 comments
Open

Can not run targeted benchmark function in project #1651

vssukharev opened this issue Nov 30, 2024 · 4 comments
Labels
Bug Something isn't working Discussion needed This feature needs discussion to iron out details

Comments

@vssukharev
Copy link
Contributor

vssukharev commented Nov 30, 2024

Get the following error after trying to run c3c bench example:

⚠️ The compiler encountered an unexpected error: "Violated assert: compiler.context.main || compiler.build.no_entry".

- Function: exe_name(...)
- Source file: /build/source/src/compiler/compiler.c:177

🙏 Please consider taking the time to file an issue on GitHub, so that we can get it fixed:

https://github.com/c3lang/c3c/issues/new so that we can get it fixed.

Steps to reproduce:

  1. Create project.json, example.c3 and build/ directory
  2. Add the following lines:
{
  "output": "build",
  "targets": {
    "example": {
      "type": "benchmark",
      "sources": [ "example.c3" ],
    },
  },
  "cpu": "generic",
  "opt": "O0",
}
  1. Run c3c bench example

c3c version: 0.6.5 (WIP)

@lerno lerno added Bug Something isn't working Discussion needed This feature needs discussion to iron out details labels Nov 30, 2024
@lerno
Copy link
Collaborator

lerno commented Dec 6, 2024

This has led to some discussion. What's done here is odd: we're running "bench" which takes any target and tries to run its benchmarks, but in this case the target is a benchmark target which should benchmark automatically.

This means we have:

  1. Normal target - bench
  2. Bench target - run
  3. Bench target - build
  4. Bench target - bench

All of them which would then presumably just run the benchmarks. This is not reasonable.

@vssukharev
Copy link
Contributor Author

We can simply make a restriction for c3c bench to be run on 'benchmark' targets only. For project benches we have c3c benchmark

@vssukharev
Copy link
Contributor Author

And it's kind of confusion to have two different commands with almost the same meaning.

@lerno
Copy link
Collaborator

lerno commented Dec 8, 2024

But that means you'd have a lot of targets just for testing. I am not sure this is right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Discussion needed This feature needs discussion to iron out details
Projects
None yet
Development

No branches or pull requests

2 participants