bob icon indicating copy to clipboard operation
bob copied to clipboard

build: additional checks for source tree

Open jkloetzke opened this issue 4 years ago • 3 comments

Re-hash the src workspace after the build step to detect inadvertent changes. Only useful when building outside of a sandbox. Should probably only be done in release mode and Jenkins builds by default.

jkloetzke avatar Jun 27 '20 11:06 jkloetzke

Maybe it's also useful to rehash the dist workspace of dependencies. I had a bad gpr file of a ADA-Library resulting in a rebuild of that library in it's dist when the lib was used by another component. :cry: :see_no_evil:

rhubert avatar Sep 30 '20 05:09 rhubert

@rhubert If the dist has not the same hash anymore, bob should throw an error in my humble opinion because it leads to unexpected builds in the case the dependency is used more than once.

Shortly, I prepared test data in a package for test runs and I used the dist path directly. But I noticed that the test would change those test files.. (Now, I made a copy of it when I execute the tests.)

What would happen if a second test is using the dist folder?!

Rerunning the packageScript for each use of a dependency is maybe a solution without errors but it would slow down the overall build time. I would be confused if the package step runs more than once but I am unsure how easy it is to detect that misbehavior.

DevelAngel avatar Apr 30 '22 05:04 DevelAngel

My idea was to make this an optional check and fail the build if changes to the dependency workspaces are detected. The initial idea was to check just src workspaces but given your input we should check all dependencies. These are all mounted read-only anyway when using a sandbox. It is simply not allowed to change dependency workspaces and there is no reasonable way to allow that.

I would only enable the check in "bob build" mode by default. For "bob dev" it should be a user choice to enable it. And when we have a sandbox the check is superfluous anyway because these workspaces are all read-only for the script...

jkloetzke avatar May 01 '22 19:05 jkloetzke