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

wrong location of build artefact when building project #1464

Open
BluBloos opened this issue Sep 20, 2024 · 4 comments
Open

wrong location of build artefact when building project #1464

BluBloos opened this issue Sep 20, 2024 · 4 comments
Assignees
Labels
Additional info please Further information is requested

Comments

@BluBloos
Copy link

I downloaded and unzipped to get a folder containing c3c.exe.
I navigated cmd.exe to the folder.
I ran: c3c init project.
I ran: c3c compile project.
main.exe was created in the same folder level as c3c.exe, whereas I expected main.exe to be created within the build folder belonging to the project.

@lerno
Copy link
Collaborator

lerno commented Sep 20, 2024

Two things:

  1. If you use c3c compile project it is actually saying "compile all the source files in the 'project' folder'. Use c3c build instead.
  2. If you build a project, then the .exe will end up in the same directory as the project.json by default. This behaviour can be overridden.
  3. The build folder is intended for intermediate build artifacts.

@lerno lerno self-assigned this Sep 20, 2024
@lerno lerno added the Additional info please Further information is requested label Sep 20, 2024
@BluBloos
Copy link
Author

Thanks for the response!

I misunderstood the purpose of the build folder because I skimmed https://c3-lang.org/guide/my-first-project/ and assumed the build folder is not only where intermediate build artifacts go but all artifacts.

As a first-time user, I think it's confusing that there are two commands compile and build. If I were to suggest a change, it would be to have just one command compile. The compile command would build all source files in a folder unless it recognizes that the folder is a project, in which case it builds the project. That being said, maybe this is another case of my lack of understanding for why there are two commands.

@lerno
Copy link
Collaborator

lerno commented Sep 21, 2024

They act quite differently. build takes a single "target" argument, which is what target in the project.json file one wishes to compile for, e.g. c3c build mygame-testversion, whereas compile is to just straight go and compile individual files, without a project, e.g. c3c compile foo.c3 bar.c3 baz.c3

@lerno
Copy link
Collaborator

lerno commented Sep 21, 2024

There is also compile-run (compile files and run them), and run (build the target and run it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Additional info please Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants