Live data from Hacker News

Show HN: I built a Cargo-like build tool for C/C++

github.com

51–60 of 181 posts

Re: Show HN: I built a Cargo-like build tool for C/C++

#51
post #48

In the age of AI tools like this are pointless. Especially new ones, given existence of make, cmake, premake and a bunch of others. C++ build system, at the core, boils down to calling gcc foo.c -o foo.obj / link foo.obj foo.exe (please forgive if I got they syntax wrong). Sure, you have more .c files, and you pass some flags but that's the core. I've recently started a new C++ program from scratch. What build system…

You're missing finding library/include paths, build configuration (`-D` flags for conditional compilation), fetching these from remote repositories, and versioning.

Re: Show HN: I built a Cargo-like build tool for C/C++

#52
post #49

Feedback of someone who is used to manage large (>1500) software stack in C / C++ / Fortran / Python / Rust / etc: - (1) Provide a way to compile without internet access and specify the associated dependencies path manually. This is absolutely critical. Most 'serious' multi-language package managers and integration systems are building in a sandbox without internet access for security reasons and reproducibility reas…

>15000

15000 what?

Re: Show HN: I built a Cargo-like build tool for C/C++

#53
post #48

In the age of AI tools like this are pointless. Especially new ones, given existence of make, cmake, premake and a bunch of others. C++ build system, at the core, boils down to calling gcc foo.c -o foo.obj / link foo.obj foo.exe (please forgive if I got they syntax wrong). Sure, you have more .c files, and you pass some flags but that's the core. I've recently started a new C++ program from scratch. What build system…

[deleted]

Re: Show HN: I built a Cargo-like build tool for C/C++

#54
post #49

Feedback of someone who is used to manage large (>1500) software stack in C / C++ / Fortran / Python / Rust / etc: - (1) Provide a way to compile without internet access and specify the associated dependencies path manually. This is absolutely critical. Most 'serious' multi-language package managers and integration systems are building in a sandbox without internet access for security reasons and reproducibility reas…

>15000 15000 what?

1500 C/C++ individual software components.

The 15000 was a typo on my side. Fixed.

Re: Show HN: I built a Cargo-like build tool for C/C++

#55
post #54

Earlier quoted context omitted.

>15000 15000 what?

1500 C/C++ individual software components. The 15000 was a typo on my side. Fixed.

I see, thanks. I didn't mind the number it just wasn't clear what was it about.

Re: Show HN: I built a Cargo-like build tool for C/C++

#58
post #20

Uses CMAKE, Sorry not for me. Call me old but i prefere good old make or batch. Maybe it's because i can understand those tools. Debugging CMAKE build problems made me hate it. Also i code for embedded CPU and most of the time CMAKE is just overkill and does not play well the compiler/binutils provided. The Platform independency is just not happening in those environments.

When you need a configuration step, cmake will actually save you a lot of time, especially if you work cross platform or even cross compile. I love to hate cmake as much as the next guy, and it would be hard to design a worse scripting language, but I'll take it any time over autoconf. Some of the newer tools may well be more convenient - I tried Bazel, and it sure wasn't (for me).

If you're happy to bake one config in a makefile, then cmake will do very little for you.

Re: Show HN: I built a Cargo-like build tool for C/C++

#59
post #49

Feedback of someone who is used to manage large (>1500) software stack in C / C++ / Fortran / Python / Rust / etc: - (1) Provide a way to compile without internet access and specify the associated dependencies path manually. This is absolutely critical. Most 'serious' multi-language package managers and integration systems are building in a sandbox without internet access for security reasons and reproducibility reas…

[deleted]

Re: Show HN: I built a Cargo-like build tool for C/C++

#60
post #37

Earlier quoted context omitted.

Do your Makefiles work across Linux, macOS and Windows (without WSL or MingW), GCC, Clang and MSVC, or allow loading the project into an IDE like Xcode or Visual Studio though? That's why meta-build-systems like cmake were created, not to be a better GNU Make.

There is something fundamentally wrong with Windows or Visual Studio that it requires ugly solutions.

Ok, then just cl.exe instead of gcc or clang. Completely different set of command line options from gcc and clang, but that's fine. C/C++ build tooling needs to be able to deal with different toolchains. The diversity of C/C++ toolchains is a strength, not a weakness :)

One nice feature of MSVC is that you can describe the linker dependencies in the source files (via #pragma comment(lib, ...)), this enables building fairly complex single-file tools trivially without a build system like this:

   cl mytool.c
...without having to specify system dependencies like kernel32 etc... on the cmdline.
Post reply on HN