Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change pebble dir in 24.04 from /.rock/bin to /usr/bin #552

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions rockcraft/pebble.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
from craft_application.errors import CraftValidationError
from craft_cli import emit

from rockcraft.constants import ROCK_CONTROL_DIR


def _alias_generator(name: str) -> str:
"""Convert underscores to dashes in aliases."""
Expand Down Expand Up @@ -168,7 +166,7 @@ class Pebble:

PEBBLE_PATH = "var/lib/pebble/default"
PEBBLE_LAYERS_PATH = f"{PEBBLE_PATH}/layers"
PEBBLE_BINARY_DIR = f"{ROCK_CONTROL_DIR}/bin"
PEBBLE_BINARY_DIR = "usr/bin"
PEBBLE_BINARY_PATH = f"{PEBBLE_BINARY_DIR}/pebble"
PEBBLE_BINARY_PATH_PREVIOUS = "bin/pebble"
_BASE_PART_SPEC = {
Expand Down
5 changes: 3 additions & 2 deletions tests/spread/rockcraft/base-devel/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ execute: |
docker-daemon:base-devel:0.1
rm base-devel_0.1_amd64.rock
docker images base-devel:0.1
id=$(docker run --rm -d base-devel:0.1)
test "$(docker inspect "$id" -f '{{json .Config.Entrypoint}}')" = '["/.rock/bin/pebble","enter"]'
id=$(docker run -d base-devel:0.1)
test "$(docker inspect "$id" -f '{{json .Config.Entrypoint}}')" = '["/usr/bin/pebble","enter"]'
linostar marked this conversation as resolved.
Show resolved Hide resolved
docker exec "$id" pebble services
docker rm -f "$id"

restore: |
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_application_expand_environment(new_dir, default_application):
@pytest.mark.parametrize(
("base", "build_base", "expected_spec"),
[
# 24.04 and beyond: pebble exists in .rock/bin/
# 24.04 and beyond: pebble exists in usr/bin/
("bare", "devel", Pebble.PEBBLE_PART_SPEC),
("[email protected]", "devel", Pebble.PEBBLE_PART_SPEC),
# 20.04 and 22.04: pebble exists in bin/
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_pebble.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class TestPebble:
def test_attributes(self):
assert Pebble.PEBBLE_PATH == "var/lib/pebble/default"
assert Pebble.PEBBLE_LAYERS_PATH == "var/lib/pebble/default/layers"
assert Pebble.PEBBLE_BINARY_PATH == ".rock/bin/pebble"
assert Pebble.PEBBLE_BINARY_PATH == "usr/bin/pebble"
assert Pebble.PEBBLE_BINARY_PATH_PREVIOUS == "bin/pebble"
assert all(
field in Pebble.PEBBLE_PART_SPEC
Expand Down
Loading