What build files c3c clean
should supposedly clean?
#1256
Replies: 4 comments 4 replies
-
There's actually an unclosed issue for this: #456 "c3c clean" will currently clean up the object files it created. But it won't remove the executable. The question is "what kind of behaviour do we expect?". When there is a project, then it's fairly straightforward: clean the build directory. But then, is the exe in the (temporary) build directory or elsewhere? Unlike some build systems, where you have to be in the exact top build directory to invoke "build", you can do it further down in a project directory. So then where should the executable and temporary build files end up relative to the project file and the current location? If instead "compile" / "compile-run" is used, the situation is even more difficult. We want to place the temporary files in a sub folder, but the user might already be using any directory we might create by default - unless we generate a name. But if we generate a name, how will the run of "clean" know that this particular directory is to be deleted? And if there is no default sub folder, how do we know that we're just deleting the object files that was last created? These are not HARD questions, but some convention has to be enforced, and it's a convention that should be similar to other build scripts / build systems. So the bottom line is: what behaviour is preferred and expected? |
Beta Was this translation helpful? Give feedback.
-
To me the concept of When I execute the aforementioned command, it means I know exactly what I'm doing, thus the need of execution of this command; I want to clean up everything and rebuild the entire project from start. |
Beta Was this translation helpful? Give feedback.
-
Seems like I have answered my own question after going through an investigation inside Cargo's produced output: Maybe this is the concept that could help C3 to simplify things even further? Food for thought 🤔 |
Beta Was this translation helpful? Give feedback.
-
Seems like what I wanted, can be done with The only "issue" I have is the |
Beta Was this translation helpful? Give feedback.
-
I run
c3c init mydefer
and insrc
, I copied thedefer
example from https://c3-lang.org/references/docs/examples/ and tweaked its module name to avoid compilation errors due to reserved keyworddefer
.Command
c3c build
worked as expected, thec3c run
produced the following output:So far, so good!
Now, I wanted to clean the entire project, therefore I run
c3c clean
, but nothing happened; I can still see themydefer
binary inbuild
folder.Am I doing something wrong?
My version is
Beta Was this translation helpful? Give feedback.
All reactions