Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into hotfix/7.4-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiusens committed Jun 15, 2023
2 parents 4ce377c + d8930f1 commit 31f9ee3
Show file tree
Hide file tree
Showing 546 changed files with 382 additions and 38,003 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/spread.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
fail-fast: false
matrix:
spread-jobs:
- google:ubuntu-18.04-64
- google:ubuntu-20.04-64
- google:ubuntu-22.04-64

Expand Down Expand Up @@ -113,7 +112,7 @@ jobs:
SNAPCRAFT_STORE_CREDENTIALS_STAGING: "${{ secrets.SNAPCRAFT_STORE_CREDENTIALS_STAGING }}"
SNAPCRAFT_STORE_CREDENTIALS_STAGING_CANDID: "${{ secrets.SNAPCRAFT_STORE_CREDENTIALS_STAGING_CANDID }}"
SNAPCRAFT_STORE_CREDENTIALS_STAGING_LEGACY: "${{ secrets.SNAPCRAFT_STORE_CREDENTIALS_STAGING_LEGACY }}"
run: spread google:ubuntu-18.04-64:tests/spread/general/store
run: spread google:ubuntu-22.04-64:tests/spread/general/store

- name: Discard spread workers
if: always()
Expand Down
4 changes: 2 additions & 2 deletions docs/.sphinx/pinned-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pyenchant==3.2.2
Pygments==2.13.0
pyparsing==3.0.9
pytz==2022.6
requests==2.28.1
requests==2.31.0
six==1.16.0
snowballstemmer==2.2.0
soupsieve==2.3.2.post1
Expand All @@ -30,5 +30,5 @@ sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
tornado==6.2
tornado==6.3.2
urllib3==1.26.13
10 changes: 5 additions & 5 deletions requirements-devel.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ click==8.1.3
codespell==2.2.4
colorama==0.4.6
coverage==7.2.5
craft-archives==0.0.3
craft-archives==1.0.0
craft-cli==1.2.0
craft-grammar==1.1.1
craft-parts==1.19.6
craft-providers==1.10.0
craft-parts==1.21.1
craft-providers==1.13.0
craft-store==2.4.0
cryptography==40.0.2
cryptography==41.0.0
Deprecated==1.2.13
dill==0.3.6
distlib==0.3.6
Expand Down Expand Up @@ -91,7 +91,7 @@ pytz==2023.3
pyxdg==0.28
PyYAML==6.0
raven==6.10.0
requests==2.30.0
requests==2.31.0
requests-toolbelt==1.0.0
requests-unixsocket==0.3.0
ruff==0.0.220
Expand Down
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ cffi==1.15.1
chardet==5.1.0
charset-normalizer==3.1.0
click==8.1.3
craft-archives==0.0.3
craft-archives==1.0.0
craft-cli==1.2.0
craft-grammar==1.1.1
craft-parts==1.19.6
craft-providers==1.10.0
craft-parts==1.21.1
craft-providers==1.13.0
craft-store==2.4.0
cryptography==40.0.2
cryptography==41.0.0
Deprecated==1.2.13
distro==1.8.0
docutils==0.19
Expand Down Expand Up @@ -53,7 +53,7 @@ pytz==2023.3
pyxdg==0.28
PyYAML==6.0
raven==6.10.0
requests==2.30.0
requests==2.31.0
requests-toolbelt==1.0.0
requests-unixsocket==0.3.0
SecretStorage==3.3.3
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def recursive_data_files(directory, install_directory):
install_requires = [
"attrs",
"click",
"craft-archives==0.0.3",
"craft-archives",
"craft-cli",
"craft-grammar",
"craft-parts",
Expand Down
1 change: 0 additions & 1 deletion snapcraft/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ def get_dispatcher() -> craft_cli.Dispatcher:
"""
# Run the legacy implementation if inside a legacy managed environment.
if os.getenv("SNAPCRAFT_BUILD_ENVIRONMENT") == "managed-host":
snapcraft.BasePlugin = snapcraft_legacy.BasePlugin # type: ignore
snapcraft.ProjectOptions = snapcraft_legacy.ProjectOptions # type: ignore
legacy.legacy_run()

Expand Down
1 change: 1 addition & 0 deletions snapcraft/elf/elf_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class _ArchConfig:
"riscv64": _ArchConfig("riscv64-linux-gnu", "lib/ld-linux-riscv64-lp64d.so.1"),
"s390x": _ArchConfig("s390x-linux-gnu", "lib/ld64.so.1"),
"x86_64": _ArchConfig("x86_64-linux-gnu", "lib64/ld-linux-x86-64.so.2"),
"i686": _ArchConfig("i386-linux-gnu", "lib/ld-linux.so.2"),
}


Expand Down
1 change: 0 additions & 1 deletion snapcraft/legacy_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def run_legacy(err: Optional[Exception] = None):
logger = logging.getLogger(lib_name)
logger.setLevel(_ORIGINAL_LIB_NAME_LOG_LEVEL[lib_name])

snapcraft.BasePlugin = snapcraft_legacy.BasePlugin # type: ignore
snapcraft.ProjectOptions = snapcraft_legacy.ProjectOptions # type: ignore

# Legacy does not use craft-cli
Expand Down
1 change: 0 additions & 1 deletion snapcraft/parts/lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,6 @@ def _run_in_provider(
project_name=project.name,
project_path=project_path,
base_configuration=base_configuration,
build_base=build_base.value,
instance_name=instance_name,
allow_unstable=allow_unstable,
) as instance:
Expand Down
2 changes: 1 addition & 1 deletion snapcraft/parts/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from .colcon_plugin import ColconPlugin
from .conda_plugin import CondaPlugin
from .flutter_plugin import FlutterPlugin
from .kernel import KernelPlugin
from .kernel_plugin import KernelPlugin
from .python_plugin import PythonPlugin
from .register import register

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion snapcraft/parts/plugins/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from .colcon_plugin import ColconPlugin
from .conda_plugin import CondaPlugin
from .flutter_plugin import FlutterPlugin
from .kernel import KernelPlugin
from .kernel_plugin import KernelPlugin
from .python_plugin import PythonPlugin


Expand Down
126 changes: 0 additions & 126 deletions snapcraft/plugins/v1/__init__.py

This file was deleted.

9 changes: 2 additions & 7 deletions snapcraft/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

from craft_cli import emit
from craft_providers import Provider, ProviderError, bases, executor
from craft_providers.actions.snap_installer import Snap
from craft_providers.lxd import LXDProvider
from craft_providers.multipass import MultipassProvider

Expand Down Expand Up @@ -198,13 +199,7 @@ def get_base_configuration(
compatibility_tag=f"snapcraft-{bases.BuilddBase.compatibility_tag}.0",
environment=environment,
hostname=instance_name,
snaps=[
bases.buildd.Snap(
name=snap_name,
channel=snap_channel,
classic=True,
)
],
snaps=[Snap(name=snap_name, channel=snap_channel, classic=True)],
# Requirement for apt gpg and version:git
packages=["gnupg", "dirmngr", "git"],
)
Expand Down
1 change: 0 additions & 1 deletion snapcraft_legacy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,6 @@ def _get_version():

# For backwards compatibility with external plugins.
import snapcraft_legacy._legacy_loader # noqa isort:skip
from snapcraft_legacy.plugins.v1 import PluginV1 as BasePlugin # noqa isort:skip
from snapcraft_legacy import common # noqa
from snapcraft_legacy import extractors # noqa
from snapcraft_legacy import file_utils # noqa
Expand Down
7 changes: 2 additions & 5 deletions snapcraft_legacy/cli/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ def _try_get_base_from_project() -> str:


def _get_modules_iter(base: str) -> Iterable:
if base == "core18":
modules_path = snapcraft_legacy.plugins.v1.__path__ # type: ignore # mypy issue #1422
else:
modules_path = snapcraft_legacy.plugins.v2.__path__ # type: ignore # mypy issue #1422
modules_path = snapcraft_legacy.plugins.v2.__path__ # type: ignore # mypy issue #1422

# TODO make this part of plugin_finder.
return pkgutil.iter_modules(modules_path)
Expand All @@ -59,7 +56,7 @@ def _get_modules_iter(base: str) -> Iterable:
@click.option(
"--base",
help="Show plugins for specific base",
type=click.Choice(["core18", "core20"]),
type=click.Choice(["core20"]),
)
def list_plugins(base):
"""List the available plugins that handle different types of part.
Expand Down
14 changes: 2 additions & 12 deletions snapcraft_legacy/internal/lifecycle/_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import logging
from typing import List, Optional, Sequence, Set

from snapcraft_legacy import config, plugins, storeapi
from snapcraft_legacy import config, storeapi
from snapcraft_legacy.internal import (
common,
errors,
Expand Down Expand Up @@ -293,13 +293,7 @@ def _reprime(self, part, hint=""):
def _handle_part_dependencies(
self, *, step: steps.Step, part: pluginhandler.PluginHandler
) -> None:
# core20 uses Plugins V2 which does not require staging parts for pull
# like V1 Plugins do.
if (
part._build_attributes.core22_step_dependencies()
and self.project._get_build_base() == "core20"
and step == steps.PULL
):
if part._build_attributes.core22_step_dependencies() and step == steps.PULL:
return
elif (
part._build_attributes.core22_step_dependencies()
Expand Down Expand Up @@ -343,10 +337,6 @@ def _prepare_step(self, *, step: steps.Step, part: pluginhandler.PluginHandler):
notify_part_progress(part, "Preparing to {}".format(step.name), debug=True)
preparation_function()

if isinstance(part.plugin, plugins.v1.PluginV1):
common.env = self.parts_config.build_env_for_part(part)
common.env.extend(self.config.project_env())

part = _replace_in_part(part)

def _run_step(self, *, step: steps.Step, part, progress, hint=""):
Expand Down
2 changes: 1 addition & 1 deletion snapcraft_legacy/internal/meta/_snap_packaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def _assemble_runtime_environment(self) -> str:
self._prime_dir, self._project_config.project.arch_triplet
)
for e in runtime_env:
env.append(re.sub(self._prime_dir, "$SNAP", e))
env.append("export " + re.sub(self._prime_dir, "$SNAP", e))

if all(
[
Expand Down
Loading

0 comments on commit 31f9ee3

Please sign in to comment.