Bro updates force some bro-pkg rebuilds.. sometimes.

I’m sure others have experienced this, when updating Bro, packages with C++ components will need to be re-installed/rebuilt (sometimes, not always). There may be some crazy C++ way of avoiding that, but outside of that I’ve been trying to come up with options to suggest so our upgrade process can be more easily automated.

What do folks think about a couple options to bro-pkg such as:

  1. a new package.meta file field:

rebuild=yes
2) And a corresponding bro-pkg command: bro-pkg rebuild [nodeps]

Separately, but kinda related, I wouldn’t mind a ‘–yes’ flag or something similar when packages aren’t being installed interactively.

Alternatively, the idea has been tossed around that we build the bro packages we use into RPMs, but then that sorta defeats the bro-pkg command entirely.

-Dop

Sounds appealing to me, I would use it if it existed.

Jon

What do folks think about a couple options to bro-pkg such as:
1) a new package.meta file field:
rebuild=yes

I wonder if that's needed since bro-pkg can already see what packages
have specified a 'build_command' ? i.e. bro-pkg can simply rebuild any
package that has supplied a build command. I'd think that even for
packages which don't strictly require a rebuild, it's not harmful to
rebuild/reinstall anyway.

2) And a corresponding bro-pkg command: bro-pkg rebuild [nodeps]

Makes sense to me. Unless there's further feedback from this thread,
I'd say go ahead and create an issue on on github for adding a
'rebuild' command or take a crack at a PR in case I don't get to it
immediately.

Possibly a workaround to do in the meantime would be to do:

bro\-pkg bundle everything\.bundle bro-pkg unbundle everything.bundle
$ rm everything.bundle

Which should result in a rebuild/reinstall of all installed packages.

Separately, but kinda related, I wouldn't mind a '--yes' flag or something
similar when packages aren't being installed interactively.

The --force flag will suppress all interactive prompts. Does that
work like you need?

- Jon

I wonder if that's needed since bro-pkg can already see what packages
have specified a 'build_command' ? i.e. bro-pkg can simply rebuild any
package that has supplied a build command. I'd think that even for
packages which don't strictly require a rebuild, it's not harmful to
rebuild/reinstall anyway.

Great point, build_command serves the same purpose.

> 2) And a corresponding bro-pkg command: bro-pkg rebuild [nodeps]

Makes sense to me. Unless there's further feedback from this thread,
I'd say go ahead and create an issue on on github for adding a
'rebuild' command or take a crack at a PR in case I don't get to it
immediately.

Possibly a workaround to do in the meantime would be to do:

bro\-pkg bundle everything\.bundle bro-pkg unbundle everything.bundle
$ rm everything.bundle

Which should result in a rebuild/reinstall of all installed packages

Good to know. I may take a stab at a PR for 'rebuild', but I can't promise
anything soon either. Will wait for additional community feedback.

> Separately, but kinda related, I wouldn't mind a '--yes' flag or
something
> similar when packages aren't being installed interactively.

The --force flag will suppress all interactive prompts. Does that
work like you need ?

Not sure I realized --force was an option, but that should work.

Thanks, Jon.

-Dop