Replies: 2 comments 5 replies
-
Differentiating which output artifact a metadata file is about can be achieved by using something like:
However, this has two potential issues:
(2) is simply addressed by using a directory which may contain files using the same naming convention rather than a file, so for example:
For (1) we have three solutions:
|
Beta Was this translation helpful? Give feedback.
-
For a single build, Bomsh actually just writes to a single metadata file: bomsh_hook_raw_logfile Then after the build, a bomsh script parses this single metadata file to get what is recorded in this metadata file. If there are multiple metadata for the same output artifact ID, then it is up to the post-processing bomsh script to make the decision. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There is agreement on the location of metadata file under $OMNIBOR_DIR/metadata/context.
(#50)
But we need to discuss how the metadata file itself can be named as it is very important that we can corelate the metadata file with the output artifact. The build tool that generates the metadata file and the consumer tool/scripts that read in the metadata file need to agree on the rules to establish this correlation. A few options and their potential issues are presented below based on the meeting discussions.
<output_filename>.metadata : Eg, hello.metadata
Suppose we generate an executable hello for both x86 and aarch64 and if we store the metadata in the same directory, then there will be a conflict.
<Omnibor_Id>.metadata : Eg, aeb4e9c2c5fc73f9811e5cd16438345a2744bb86.metadata
Note that Omnibor_id is the gitoid of the Input Manifest. There could be potential conflicts in the naming if two different executables have the same input manifest.
Also, there comes the question of whether we should use sha1 or sha256 for the Omnibor Id, as using both in the naming can make it awkward.
<Output_Artifact_id>.metadata: Eg., 3f429a63d3c65c84b3a20772b80d4244555084bc.metadata
In this example, 3f429a63d3c65c84b3a20772b80d4244555084bc is the gitoid of the output executable.
Here too, there comes the question of whether we should use sha1 or sha256 for the Artifact Id, as using both in the naming can make it awkward. May be we could create <sha1_artifact>.metadata and create a symlink to this file for <sha256_artifact_id>.metadata ?
It is not possible for two non-identical output artifacts to have the same gitoid hash, so this brings uniqueness to the name, but it is possible for two output artifacts to be built differently, but end up being identical.
For example, consider
gcc -O2 file.c -o exe1
gcc -O3 file.c -o exe2
clang -O2 file.c -o exe3
gcc_v2 -O2 file.c -o exe4
Both exe1 and exe2 could be identical, even when they are built differently. It is highly unlikely for exe1 and exe3 to be identical (due to differences in sections and .comment sections generated by different compilers), but exe1 and exe4 could again be identical.
The concern with this option is that if the metadata captures information about the build (build command or license info, for example), then overwriting the metadata file for identical output artifacts, could result in loss of information and potential inaccuracy of the metadata. So we need to find a way to mitigate this conflict (would concatenation of metadata help?)
Beta Was this translation helpful? Give feedback.
All reactions