Add early support for APX builds in autospec. This change also makes
APX disabled by default for now but may revert back to enabled by
default in the future. The APX prefix will be /VA as the arch flag is
not yet finalized. This also may change in the future though for now
there are no plans to move it.
Currently autotools builds are unable to use this as it detects as a
cross compilation.
Currently only C using GCC is supported.
This change also reworks how R language optimized binaries are built
and distributed. They will now work as all the other tooling does with
the /VX prefix.
Signed-off-by: William Douglas <william.douglas@intel.com>
The %doc directive doesn't really align with autospec usage where
paths are automatically managed into subpackages so stop using it.
Signed-off-by: William Douglas <william.douglas@intel.com>
Enable content to be found under %{buildroot}/{V3,V4} and work
seemlessly with bans, compat, excludes, manual extras and patterns.
Eventually the efi-move.py will be retooled to store content in these
locations so preempt this change in autospec.
Signed-off-by: William Douglas <william.douglas@intel.com>
Instead of pushing the filename that is matched, use the glob for the
files section as in some cases it is required (rustc) in order to
avoid build failures as the filenames may not be static.
Signed-off-by: William Douglas <william.douglas@intel.com>
This change allows *extras files to contain '*' matches. This somewhat
emulates the shell glob match in that '/foo*bar' will match '/foobar'
and '/foobazbar' but not '/foo/bar'. The globs are only allowed one
per directory such that '/foo*/bar*' is allowed but '/foo*bar*' is
not.
Signed-off-by: William Douglas <william.douglas@intel.com>
Some packages have a files section replacement in place that uses
globs instead of listing all files in the section. This doesn't work
well with extras. Add an option to config to turn off the replacement
so extras are able to function as normal.
Signed-off-by: William Douglas <william.douglas@intel.com>
Many different components require the target download path and it is
needed early. Previously code existed to attempt to autodetect its
location and so defining the path was enforced later in the build
process. This created problems with ordering functions based on this
requirement but since the target path is now certain to be defined at
startup (due to previous changes) we can better align the location and
initialization of the data to the Config class.
As part of this change also avoid requiring the temporary working
directory to be setup as part of the Build class. This is done as a
cleanup due to the only real user of this location being the Content
class.
This also drops the stand-alone pkg_integrety main function that was
initially used as a one off test to avoid needing to run autospec to
validate the integrity of a package. This feature was seldom used and
doesn't function well without handling configuration so it was
dropped.
The logic behind the files extras, dev_extras and *_extras is
essentially identical but duplicated. Consolidate the code and internal
variables into a single parse and file_maps variable.
The build module had a number of globals that were referenced by many
other modules and has ordering dependencies with the config and
tarball module for some values. This made deciding on where certain
values get initialized difficult but before the initialization can be
addressed a refactor is helpful.
This change moves the global state (and functions that needed to act
on that global state) into a Build class. The goal of this work is
to better track what can be updated by a particular function, load
data in a sensible order and have it owned by a sensible component.
Some of this data is likely to be removed from the build class in the
future as initialization of download and base paths should take place
in other modules most likely.
The tarball module had a number of globals that were referenced by
many other modules and has ordering dependencies with the config
module for some values. This made deciding on where certain values get
initialized difficult but before the initialization can be addressed a
refactor is helpful.
This change moves the global state (and functions that needed to
act on that global state) into a Content class. The goal of this work
is to better track what can be updated by a particular function, load
data in a sensible order and have it owned by a sensible component.
I expect that future work will see the tarball, buildpattern and some
portions of the config moved around to better match what component
should own what data (and to better deliniate between the data that
has a similar use but comes from different sources).
The config module had a large amount of globals that were being
touched across many modules that would import. This made changes to
config very fragile as figuring out what would be modified in any
given call chain was difficult to diagnose.
It also made testing fragile as one would need to reset a given
module's config import to the best of their knowledge before rerunning
another test.
To get away from that (and to try and reduce the number of globally
modified variablies in autospec as a whole), refactor the config
module to provide its state as part config class. The long running
goal of changes like this is to better track what content can be
updated by a particular function (if a function would have access
to the config instance is now the hint rather than the config module
getting imported).
Autospec currently doesn't handle /etc/, /opt/, /usr/etc/, /usr/local/
or /usr/src/ content paths so explicity warn and then fail when
content in these paths are detected.
Instead of the excludes file adding '%exclude' macros for files that
are not being shipped in the binary rpms, they cause the file to be
deleted entirely.
This causes a few ripple effects in other parts of the subpackage file
manipulation code where excludes were used to avoid files being added
to multiple subpackages. To work around this, don't allow calls that
add files to a specific subpackage to fall through into the general
push_package_file fallthrough or file_pat_match calls. Also don't add
files that are still intended to be shipped to show up on the excludes
list.
When adding a file to extras (as well as excludes, setuid etc.), the
files are added to the exclude list dynamically. Instead, load all known
files upfront.
Also, process file-configured subpackages (-extras, custom-extras etc.)
first and only then process "built-in" (pattern-based) packages (such as
-lib64, -lib32, -autostart etc.)
Enable package builders to create custom extras subpackages (suffixed
by -extras). This enables content to be divided more exactly than just
the current extras subpackage support and also allows users to specify
requirements on other subpackages in the package. It is not intended
to replace extras usage as this feature should be used sparingly where
content really must be specificly placed.
It contains files in /usr/lib/systemd or /lib/systemd. Previously was
part of -config subpackage. Helps avoiding unwanted deps on services
files when -config is required by another subpackage (such as -libexec)
which, in turn, does not require actual executables (-bin subpackage).
When making a library compatibility package, the only files that are
needed are the library binary and versioned symlinks to the
library. All the other files are to be excluded as they might conflict
with the files in the main package.
To that end, add a setting in options.conf for a package to signify it
is a compatibility library and do matching for files that meet the
above requirements and exclude all others.
Use a regular expression in order to exclude all directives at the
beginning of the filename, including %doc.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
When cleaning directories from the package file lists do not attempt to
clean "%dir" prefixed files. Although autospec does not currently
support empty directories, it could in the future.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
Clean directories from package file lists. If directories are
encountered, print a warning, add the directory to the blacklist, and
re-run.
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
The files module was being treated like a class, in that it was
necessary to keep state throughout the entire autospec run. Convert the
files module to a class and make some other general clean ups. This
changed how the files module was instantiated and called by the main
autospec module and other modules such as tarball and config.
Test the files module with unit tests and add the target to the
makefile.