Patch Set 29:

I think it's helpful for having portable code for testing purposes if we can isolate the environment more easily.

Is <types.h> a problem for that? It's just a normal coreboot header that chain-includes those others. If you somehow mock out the coreboot versions of <stddef.h> and <stdint.h> for others specific to the test environment, that shouldn't cause a problem... your test code can still include coreboot's <types.h> which will then chain-include those test headers.

Not a huge problem. As I noted, reducing dependencies is the more important bit. If one can write portable code there's not as much of an issue.


Personally, I feel the POSIX distinctions are really annoying sometimes (e.g. why are size_t and uintptr_t in different headers?), and I think having a catchall "include all the standard type and helper stuff" header is nice to avoid forcing everyone to deal with that all the time, while still allowing stuff to be defined in the appropriate POSIX headers in a chain-include behind that. I think in fact this pattern can help making the kind of test isolation you describe easier... right now we have the problem that our <stdXXX.h> headers do *more* than defined by POSIX (e.g. including <commonlib/helpers.h> and defining a bunch of coreboot-specific macros), which would cause things to break if you tried to switch those out for headers from a test environment. If we are piping #includes from most files through an intermediate non-POSIX header like <types.h>, that would make it easier to move those non-POSIX components out of the standard headers and into <types.h> to fix those issues without having to touch every file again and again.

Whether we agree with posix or not issue I was bringing up. It's a portable target environment that our libraries and code can then be easily compiled for multiple environments. Yes, we can totally provide a single binding header that adapts to the environment. I was just noting how I think it's helpful to have code that can be easily reused.


View Change

To view, visit change 32023. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Id89751c600bad2ddb4b5aa9822adc5c5097787aa
Gerrit-Change-Number: 32023
Gerrit-PatchSet: 29
Gerrit-Owner: HAOUAS Elyes <ehaouas@noos.fr>
Gerrit-Reviewer: Aaron Durbin <adurbin@chromium.org>
Gerrit-Reviewer: Alexander Couzens <lynxis@fe80.eu>
Gerrit-Reviewer: Damien Zammit
Gerrit-Reviewer: David Guckian
Gerrit-Reviewer: David Guckian <david.guckian@intel.com>
Gerrit-Reviewer: Felix Held <felix-coreboot@felixheld.de>
Gerrit-Reviewer: HAOUAS Elyes <ehaouas@noos.fr>
Gerrit-Reviewer: Huang Jin <huang.jin@intel.com>
Gerrit-Reviewer: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Gerrit-Reviewer: Julius Werner <jwerner@chromium.org>
Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki@gmail.com>
Gerrit-Reviewer: Lee Leahy <leroy.p.leahy@intel.com>
Gerrit-Reviewer: Michał Żygowski <michal.zygowski@3mdeb.com>
Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph@9elements.com>
Gerrit-Reviewer: Patrick Rudolph <siro@das-labor.org>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Gerrit-Reviewer: Philipp Hug <philipp@hug.cx>
Gerrit-Reviewer: Piotr Król <piotr.krol@3mdeb.com>
Gerrit-Reviewer: Vanny E <vanessa.f.eusebio@intel.com>
Gerrit-Reviewer: Werner Zeh <werner.zeh@siemens.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-Reviewer: ron minnich <rminnich@gmail.com>
Gerrit-CC: Nico Huber <nico.h@gmx.de>
Gerrit-CC: Paul Menzel <paulepanter@users.sourceforge.net>
Gerrit-Comment-Date: Mon, 21 Oct 2019 21:50:24 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment