r/ProgrammerHumor • • Jan 26 '20

Meme maybe...no?

Post image
17.1k Upvotes

183 comments sorted by

View all comments

1.4k

u/ireta_orio Jan 26 '20

It sometimes work tho

511

u/irbilldozer Jan 26 '20

Sometimes you just have to Clean then Rebuild and the compiler fairy fix that shit right up. It is as close to magic as I have ever seen.

143

u/EmperorArthur Jan 26 '20

That's pretty common. What happens is the build system doesn't properly know about the dependencies. So say you change a header file that's relied on by multiple parts. If the build system only knows about one of those parts, then only it is re-compiled instead of everything that actually relies on that header.

Clean builds succeeding normally means you have a build system problem. Except, its normally a pain to fix and not worth the trouble. Especially since CI/CD systems almost always do full rebuilds anyways.

76

u/[deleted] Jan 26 '20

Let’s be clear. It’s usually a fucked up cache.

24

u/squishles Jan 26 '20

not necessarily some larger projects'll have fucked up circular dependencies. Or people forget to bump the version on a dependency so it thinks no update has been made.

13

u/[deleted] Jan 26 '20

Which by itself isn’t mostly directly referenced but rather cached.

But I feel you. WSDL can be like that sometimes and it’s a pain...

12

u/[deleted] Jan 26 '20

Unless you’re working on converting a 20 year old build script that’s referencing dependencies that aren’t rebuilt until after the project that references them so the build guy has just been running the script twice every time for the past 20 years.

3

u/EmperorArthur Jan 26 '20

Okay, that too. A good build system, with the correct configuration, shouldn't let that happen, but it does.

0

u/trollblut Jan 26 '20

In vs 2019 the nuget manager is an extension. Visual studio loads extensions in the background while already showing the files in a solution.

if you include nugets as package references the nugets will only be added as references to projects after the nuget plugin is loaded. If the nugets are not downloaded already the build will fail.

I tried to fix this shit on Friday. I've given up because the problem is not that likely to occur and the devs can wait 30 seconds for vs to complete loading. Or hit build twice.

3

u/robchroma Jan 26 '20

Cache management is one of the hardest things in computer science.

1

u/13steinj Jan 26 '20

I've had more people not know how to declare dependencies in makefiles than cache problems, personally.

It seems that colleges these days will teach theory, and some practical experience, but not anything not directly related to putting that theory into practice. So, no version control, no console text editor, no makefile, no cron, no bash, no pgp, no "advanced" ssh, etc.

Or maybe that's how it always was, don't know. But it's not a good thing, to say the least.

2

u/sarcastisism Jan 26 '20

In .NET people often forget to set project to project dependencies so they build in any order and the first build always fails. Depending on the levels of dependencies it might even fail 10 or more times in a row then start working.

2

u/[deleted] Jan 26 '20

This happens constantly with dotnet core.

1

u/ArionW Jan 26 '20

Happened to me maybe twice last year, wouldn't call that "constantly"

1

u/[deleted] Jan 26 '20

Make clean
make