Conversation
|
debugging via |
|
comptime output added through |
|
comtime output is now added via |
|
added |
|
I was able to get |
|
adding additional libpaths via build logic, would require changing the way linking commands are queued, so I'll leave it at that for now |
Recap
Exampleclass MyBuildLogic : BuildLogic
{
public override void PreBuild()
{
String output = scope .(16);
output.Append("archive.");
if (Compiler.Options.Platform == .Windows)
output.Append("lib");
else
output.Append('a');
String buildDir = scope $"{Compiler.BuildDir}/{Compiler.ProjectName}";
Console.RunShellCommand(scope $"clang -c -target {Compiler.Options.TargetTriple} -o {buildDir}/object.o file.cpp");
Console.RunShellCommand(scope $"llvm-ar crs {buildDir}/{output} {buildDir}/object.o");
}
} |
|
I do always appreciate a slam-dunk PRs: implementations of obviously missing funtionality, bug fixes, etc. This is definitely not that. I appreciate that you have taken the initiative to fully design and develop a completely new feature, but there are some fundamental problems here:
This is a feature that requires thoughtful planning and consideration. Unfortunately at this time I can neither accept this PR as-is, nor commit to the thoughtful planning and consideration to determine how and whether this kind of feature should be exposed. |
|
okay, so I'll give you the full picture. I was making a new binding generator (https://git.unicon-gmbh.de/BeefBindings/Cpp2Beef), and it basically done at this point. I then wanted to make a binding eco-system that automatically builds the c/c++ libraries. Most of the current beef bindings only expose win64 prebuild binaries, which is not really cross-platform and new version would have to put in manually. What I wanted is a 1-click package manager git pull and everything just works out of the box without any tinkering. In order to do this I had it would have to build the c code from source, across all platforms and link it into the beef project. Now currently the only ways to execute something at build are build commands and comptime. Comptime doesn't really have the functionality to build stuff because:
and most of this PR attempts to fix these issues. So the only option is prebuild commands. But there were so many issues I had with prebuild commands:
So my first idea was something like zig has (a class CompileC
{
[Comptime, OnCompile(.TypeDone)]
static void OnCompile()
{
if (!Compiler.IsBuilding) return;
// ...
}
}while this might be a good compromise there is one thing it can't do, that the I am open to any revisions or stuctural changes, such as removing |
|
Is it not feasible to use comptime to generate a shell/batch file that you can run in postbuild commands? |
|
postbuild is well... post build so after linking, it needs to happen before linking. |
|
Prebuild then. Currently the build process is:
|
|
okay that works, but we can still get |
|
Yes, those are reasonable features to support. |
|
new PR with build logic removed: #2417 |
|
I went ahead and added support for Console.Write and the Environment.[G/S]etEnvironmentVariable fa01e14 |
|
why did you change the naming of |
|
Because that's the right name for it. |
This adds build logic classes as described in #2403, progress:
dynamically add additional lib paths from build logic