Skip to content

Commit

Permalink
Remove all modularity support
Browse files Browse the repository at this point in the history
Part of https://fedoraproject.org/wiki/Changes/RetireModularity

It's dead, so let's remove all the code.  I think this may
cause things to silently do nothing if folks have modules
layered, but at least server side builds will just stop working.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed May 23, 2024
1 parent 50a558c commit 4238364
Show file tree
Hide file tree
Showing 19 changed files with 6 additions and 578 deletions.
11 changes: 0 additions & 11 deletions docs/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ The format of the `extensions.yaml` file is as follow:
repos:
- myrepo

# Any modules to enable/install
modules:
enable:
- foo:bar
install:
- baz:boo/default

# The top-level object is a dict. The only supported key
# right now is `extensions`, which is a dict of extension
# names to extension objects.
Expand All @@ -67,10 +60,6 @@ extensions:
# on a particular architecture.
repos:
- sooper-repo
# Optional additional modules (this also affects global state)
modules:
enable:
- sooper:latest
# Optional list of architectures on which this extension
# is valid. These are RPM basearches. If omitted,
# defaults to all architectures.
Expand Down
8 changes: 0 additions & 8 deletions docs/treefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,14 +500,6 @@ version of `rpm-ostree`.
via lockfiles. This is useful when locked packages are kept
separately from the primary repos and one wants to ensure that
rpm-ostree will otherwise not select unlocked packages from them.
* `modules`: Object, optional: Describes RPM modules to enable or install. Two
keys are supported:
* `enable`: Array of strings, required: Set of RPM module specs to enable
(the same formats as dnf are supported, e.g. `NAME[:STREAM]`).
One can then cherry-pick specific packages from the enabled modules via
`packages`.
* `install`: Array of strings, required: Set of RPM module specs to install
(the same formats as dnf are supported, e.g. `NAME[:STREAM][/PROFILE]`).
* `repovars`: object (`Map<String, String>`), optional: yum repository variable
names to use when substituting variables in yum repo files. The `releasever`
variable name is invalid. Use the `releasever` key instead. The `basearch`
Expand Down
71 changes: 0 additions & 71 deletions rpmostree-cxxrs.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1759,11 +1759,6 @@ struct Treefile final : public ::rust::Opaque
bool remove_package_override_remove (::rust::Str package) noexcept;
bool has_packages_override_remove_name (::rust::Str name) const noexcept;
bool remove_all_overrides () noexcept;
::rust::Vec< ::rust::String> get_modules_enable () const noexcept;
bool has_modules_enable () const noexcept;
::rust::Vec< ::rust::String> get_modules_install () const noexcept;
bool add_modules (::rust::Vec< ::rust::String> modules, bool enable_only) noexcept;
bool remove_modules (::rust::Vec< ::rust::String> modules, bool enable_only) noexcept;
bool remove_all_packages () noexcept;
::rust::Vec< ::rust::String> get_exclude_packages () const noexcept;
::rust::String get_platform_module () const noexcept;
Expand Down Expand Up @@ -2422,9 +2417,6 @@ extern "C"
::rpmostreecxx::HistoryEntry *return$) noexcept;

::rust::repr::PtrLen rpmostreecxx$cxxbridge1$history_prune () noexcept;

::rust::repr::PtrLen
rpmostreecxx$cxxbridge1$modularity_entrypoint (::rust::Vec< ::rust::String> const &args) noexcept;
::std::size_t rpmostreecxx$cxxbridge1$TokioHandle$operator$sizeof () noexcept;
::std::size_t rpmostreecxx$cxxbridge1$TokioHandle$operator$alignof () noexcept;
::std::size_t rpmostreecxx$cxxbridge1$TokioEnterGuard$operator$sizeof () noexcept;
Expand Down Expand Up @@ -2571,23 +2563,6 @@ extern "C"
bool
rpmostreecxx$cxxbridge1$Treefile$remove_all_overrides (::rpmostreecxx::Treefile &self) noexcept;

void rpmostreecxx$cxxbridge1$Treefile$get_modules_enable (
::rpmostreecxx::Treefile const &self, ::rust::Vec< ::rust::String> *return$) noexcept;

bool rpmostreecxx$cxxbridge1$Treefile$has_modules_enable (
::rpmostreecxx::Treefile const &self) noexcept;

void rpmostreecxx$cxxbridge1$Treefile$get_modules_install (
::rpmostreecxx::Treefile const &self, ::rust::Vec< ::rust::String> *return$) noexcept;

bool rpmostreecxx$cxxbridge1$Treefile$add_modules (::rpmostreecxx::Treefile &self,
::rust::Vec< ::rust::String> *modules,
bool enable_only) noexcept;

bool rpmostreecxx$cxxbridge1$Treefile$remove_modules (::rpmostreecxx::Treefile &self,
::rust::Vec< ::rust::String> *modules,
bool enable_only) noexcept;

bool
rpmostreecxx$cxxbridge1$Treefile$remove_all_packages (::rpmostreecxx::Treefile &self) noexcept;

Expand Down Expand Up @@ -4617,16 +4592,6 @@ history_prune ()
}
}

void
modularity_entrypoint (::rust::Vec< ::rust::String> const &args)
{
::rust::repr::PtrLen error$ = rpmostreecxx$cxxbridge1$modularity_entrypoint (args);
if (error$.ptr)
{
throw ::rust::impl< ::rust::Error>::error (error$);
}
}

::std::size_t
TokioHandle::layout::size () noexcept
{
Expand Down Expand Up @@ -5068,42 +5033,6 @@ Treefile::remove_all_overrides () noexcept
return rpmostreecxx$cxxbridge1$Treefile$remove_all_overrides (*this);
}

::rust::Vec< ::rust::String>
Treefile::get_modules_enable () const noexcept
{
::rust::MaybeUninit< ::rust::Vec< ::rust::String> > return$;
rpmostreecxx$cxxbridge1$Treefile$get_modules_enable (*this, &return$.value);
return ::std::move (return$.value);
}

bool
Treefile::has_modules_enable () const noexcept
{
return rpmostreecxx$cxxbridge1$Treefile$has_modules_enable (*this);
}

::rust::Vec< ::rust::String>
Treefile::get_modules_install () const noexcept
{
::rust::MaybeUninit< ::rust::Vec< ::rust::String> > return$;
rpmostreecxx$cxxbridge1$Treefile$get_modules_install (*this, &return$.value);
return ::std::move (return$.value);
}

bool
Treefile::add_modules (::rust::Vec< ::rust::String> modules, bool enable_only) noexcept
{
::rust::ManuallyDrop< ::rust::Vec< ::rust::String> > modules$ (::std::move (modules));
return rpmostreecxx$cxxbridge1$Treefile$add_modules (*this, &modules$.value, enable_only);
}

bool
Treefile::remove_modules (::rust::Vec< ::rust::String> modules, bool enable_only) noexcept
{
::rust::ManuallyDrop< ::rust::Vec< ::rust::String> > modules$ (::std::move (modules));
return rpmostreecxx$cxxbridge1$Treefile$remove_modules (*this, &modules$.value, enable_only);
}

bool
Treefile::remove_all_packages () noexcept
{
Expand Down
7 changes: 0 additions & 7 deletions rpmostree-cxxrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -1536,11 +1536,6 @@ struct Treefile final : public ::rust::Opaque
bool remove_package_override_remove (::rust::Str package) noexcept;
bool has_packages_override_remove_name (::rust::Str name) const noexcept;
bool remove_all_overrides () noexcept;
::rust::Vec< ::rust::String> get_modules_enable () const noexcept;
bool has_modules_enable () const noexcept;
::rust::Vec< ::rust::String> get_modules_install () const noexcept;
bool add_modules (::rust::Vec< ::rust::String> modules, bool enable_only) noexcept;
bool remove_modules (::rust::Vec< ::rust::String> modules, bool enable_only) noexcept;
bool remove_all_packages () noexcept;
::rust::Vec< ::rust::String> get_exclude_packages () const noexcept;
::rust::String get_platform_module () const noexcept;
Expand Down Expand Up @@ -1973,8 +1968,6 @@ ::rust::Box< ::rpmostreecxx::HistoryCtx> history_ctx_new ();

void history_prune ();

void modularity_entrypoint (::rust::Vec< ::rust::String> const &args);

::rust::Box< ::rpmostreecxx::TokioHandle> tokio_handle_get () noexcept;

bool script_is_ignored (::rust::Str pkg, ::rust::Str script) noexcept;
Expand Down
10 changes: 0 additions & 10 deletions rust/src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,6 @@ fn deployment_populate_variant_origin(

// Package mappings. Note these are inserted unconditionally, even if empty.
vdict_insert_optset(dict, "requested-packages", tf.packages.as_ref());
vdict_insert_optset(
dict,
"requested-modules",
tf.modules.as_ref().and_then(|m| m.install.as_ref()),
);
vdict_insert_optset(
dict,
"requested-modules-enabled",
tf.modules.as_ref().and_then(|m| m.enable.as_ref()),
);
vdict_insert_optmap(
dict,
"requested-local-packages",
Expand Down
16 changes: 0 additions & 16 deletions rust/src/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ pub struct Extensions {
extensions: HashMap<String, Extension>,
#[serde(skip_serializing_if = "Option::is_none")]
repos: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
modules: Option<crate::treefile::ModulesConfig>,
}

#[derive(Serialize, Deserialize, Debug)]
Expand All @@ -40,8 +38,6 @@ pub struct Extension {
#[serde(skip_serializing_if = "Option::is_none")]
repos: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
modules: Option<crate::treefile::ModulesConfig>,
#[serde(skip_serializing_if = "Option::is_none")]
architectures: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
match_base_evr: Option<String>,
Expand Down Expand Up @@ -89,7 +85,6 @@ fn extensions_load_stream(
} else {
parsed.repos = ext.repos.take();
}
crate::treefile::merge_modules(&mut parsed.modules, &mut ext.modules);
if ext.kind == ExtensionKind::OsExtension {
for pkg in &ext.packages {
if base_pkgs.contains_key(pkg.as_str()) {
Expand Down Expand Up @@ -195,7 +190,6 @@ impl Extensions {
..Default::default()
},
packages: Some(self.get_os_extension_packages().into_iter().collect()),
modules: self.modules.clone(),
..Default::default()
};
Ok(Box::new(Treefile {
Expand Down Expand Up @@ -324,9 +318,6 @@ extensions:
architectures:
- s390x
foo:
modules:
enable:
- foo:stable
packages:
- foo
repos:
Expand All @@ -339,9 +330,6 @@ extensions:
assert!(extensions.get_os_extension_packages() == vec!["bazboo"]);
assert_eq!(extensions.get_repos().len(), 2);
assert_eq!(extensions.get_repos()[1], "bazboo-repo");
let modules = extensions.modules.unwrap();
assert!(modules.enable.unwrap().contains("virt:av"));
assert!(modules.install.is_none());

let mut input = std::io::BufReader::new(buf.as_bytes());
let extensions = extensions_load_stream(&mut input, "s390x", &base_rpmdb()).unwrap();
Expand All @@ -354,10 +342,6 @@ extensions:
assert_eq!(extensions.get_os_extension_packages(), vec!["foo"]);
assert_eq!(extensions.get_repos().len(), 2);
assert_eq!(extensions.get_repos()[1], "foo-repo");
let modules = extensions.modules.unwrap();
assert!(modules.enable.as_ref().unwrap().contains("foo:stable"));
assert!(modules.enable.as_ref().unwrap().contains("virt:av"));
assert!(modules.install.is_none());
}

#[test]
Expand Down
12 changes: 0 additions & 12 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,6 @@ pub mod ffi {
fn history_prune() -> Result<()>;
}

// modularity.rs
extern "Rust" {
fn modularity_entrypoint(args: &Vec<String>) -> Result<()>;
}

// tokio_ffi.rs
extern "Rust" {
type TokioHandle;
Expand Down Expand Up @@ -609,11 +604,6 @@ pub mod ffi {
fn remove_package_override_remove(&mut self, package: &str) -> bool;
fn has_packages_override_remove_name(&self, name: &str) -> bool;
fn remove_all_overrides(&mut self) -> bool;
fn get_modules_enable(&self) -> Vec<String>;
fn has_modules_enable(&self) -> bool;
fn get_modules_install(&self) -> Vec<String>;
fn add_modules(&mut self, modules: Vec<String>, enable_only: bool) -> bool;
fn remove_modules(&mut self, modules: Vec<String>, enable_only: bool) -> bool;
fn remove_all_packages(&mut self) -> bool;
fn get_exclude_packages(&self) -> Vec<String>;
fn get_platform_module(&self) -> String;
Expand Down Expand Up @@ -1003,8 +993,6 @@ mod lockfile;
pub(crate) use self::lockfile::*;
mod live;
pub(crate) use self::live::*;
pub mod modularity;
pub(crate) use self::modularity::*;
mod nameservice;
mod normalization;
mod origin;
Expand Down
Loading

0 comments on commit 4238364

Please sign in to comment.