canonical / craft-parts

https://canonical-craft-parts.readthedocs-hosted.com
GNU Lesser General Public License v3.0
11 stars 37 forks source link

Updating repositories does not trigger necessary actions #413

Open gboutry opened 1 year ago

gboutry commented 1 year ago

This is a behavior seen while using Rockcraft.

Updating repositories entries does not remove PPA files from the disk and does not trigger pull steps.

rockcraft.yaml

name: python-3.8
summary: Python 3.8
license: Apache-2.0
description: |
  Python 3.8
version: "3.8"

base: ubuntu:22.04
platforms:
  amd64:

package-repositories:
  - type: apt
    ppa: dqlite/dev
    priority: always
  - type: apt
    ppa: deadsnakes/ppa
    priority: always

parts:
  python:
    plugin: nil
    stage-packages:
      - python3.8

Performing pull step:

rockcraft pull --shell-after
Launching instance...                                                                                                                                                                                                                                  
Retrieved base ubuntu:22.04 for amd64                                                                                                                                                                                                                  
Extracted ubuntu:22.04                                                                                                                                                                                                                                 
Package repositories installed                                                                                                                                                                                                                         
Executed: pull pebble                                                                                                                                                                                                                                  
Executed: pull python                                                                                                                                                                                                                                  
Launching shell on build environment...                                                                                                                                                                                                                
root@rockcraft-keystone-53910271:~/project# ls -alh /etc/apt/sources.list.d/
total 4.0K
drwxr-xr-x 2 root root   4 Apr  3 13:09 .
drwxr-xr-x 8 root root   9 Apr 26  2022 ..
-rw-r--r-- 1 root root 164 Apr  3 13:09 snapcraft-ppa-deadsnakes_ppa.sources
-rw-r--r-- 1 root root 160 Apr  3 13:09 snapcraft-ppa-dqlite_dev.sources
root@rockcraft-keystone-53910271:~/project# 

Then, removing the deadsnakes/ppa PPA:

diff rockcraft.yaml/before rockcraft.yaml/after
16,18d15
<   - type: apt
<     ppa: deadsnakes/ppa
<     priority: always

This is the result:

rockcraft pull --shell-after
Launching instance...                                                                                                                                                                                                                                  
Retrieved base ubuntu:22.04 for amd64                                                                                                                                                                                                                  
Extracted ubuntu:22.04                                                                                                                                                                                                                                 
Package repositories installed                                                                                                                                                                                                                         
Executed: skip pull pebble (already ran)                                                                                                                                                                                                               
Executed: skip pull python (already ran)                                                                                                                                                                                                               
Launching shell on build environment...                                                                                                                                                                                                                
root@rockcraft-keystone-53910271:~/project# ls -alh /etc/apt/sources.list.d/
total 4.0K
drwxr-xr-x 2 root root   4 Apr  3 13:09 .
drwxr-xr-x 8 root root   9 Apr 26  2022 ..
-rw-r--r-- 1 root root 164 Apr  3 13:09 snapcraft-ppa-deadsnakes_ppa.sources
-rw-r--r-- 1 root root 160 Apr  3 13:09 snapcraft-ppa-dqlite_dev.sources

The sources file is not removed, and the pull stage is not retriggered. (this should have failed)

cmatsuoka commented 1 year ago

This should be addressed in the application using craft-archives, craft-parts doesn't handle package-repositories. cc @tigarmo @lengau

syncronize-issues-to-jira[bot] commented 5 months ago

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-2955.

This message was autogenerated