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

core20: part is not rebuild even if source file has changed #4917

Open
paddor opened this issue Nov 26, 2024 · 1 comment
Open

core20: part is not rebuild even if source file has changed #4917

paddor opened this issue Nov 26, 2024 · 1 comment

Comments

@paddor
Copy link

paddor commented Nov 26, 2024

Expected behaviour

Part should be rebuilt if the content of its source .tar.gz or .tar file has changed.

Steps to reproduce the problem

Create a bundle.tar like this: tar -c Gemfile Gemfile.lock vendor/cache > bundle.tar

Have a part like this:

  bundle:
    after:
      - ruby
    plugin: dump
    source: bundle.tar
    build-packages:
      - ccache
      - autoconf
      - automake
      - libxml2-dev
      - git
    build-environment:
      - CC: "ccache cc"
      - CXX: "ccache c++"
      - CFLAGS: "-Os"
    stage-packages:
      - libczmq-dev
      - libxml2
      - less
    override-build: |
      mkdir -p $SNAPCRAFT_PART_INSTALL/app
      cd $SNAPCRAFT_PART_INSTALL/app
      cp $SNAPCRAFT_PART_SRC/Gemfile .
      cp $SNAPCRAFT_PART_SRC/Gemfile.lock .
      bundle config set --local deployment true
      bundle config set --local cache_path $SNAPCRAFT_PART_SRC/vendor/cache
      bundle config set --local silence_root_warning true
      bundle config set --local jobs $SNAPCRAFT_PARALLEL_BUILD_COUNT
      bundle env

      if bundle check
      then
        echo "Bundle is already installed."
      else
        echo "Installing bundle ..."
        bundle install --local
        bundle check
      fi

      bundle clean --force

Build a snap: snapcraft --use-lxd --debug

Update the bundle.tar (e.g. add a gem to the Gemfile and bundle && bundle pack && tar -c Gemfile Gemfile.lock vendor/cache > bundle.tar

Try to build another snap:

snapcraft --use-lxd --debug
Launching a container.
Waiting for container to be ready
Waiting for network to be ready...
snap "snapd" has no updates available
Skipping pull app (already ran)
Skipping pull openssl (already ran)
Skipping pull ruby-install (already ran)
Skipping pull ruby (already ran)
Skipping pull bundle (already ran) # <---- wrong
Skipping pull webui (already ran)
Skipping build app (already ran)
Skipping build openssl (already ran)
Skipping build ruby-install (already ran)
Skipping build ruby (already ran)
Skipping build bundle (already ran)
Skipping build webui (already ran)
Skipping stage app (already ran)
Skipping stage openssl (already ran)
Skipping stage ruby-install (already ran)
Skipping stage ruby (already ran)
Skipping stage bundle (already ran) # <---- wrong
Skipping stage webui (already ran)
Skipping prime app (already ran)
Skipping prime openssl (already ran)
Skipping prime ruby-install (already ran)
Skipping prime ruby (already ran)
Skipping prime bundle (already ran)
Skipping prime webui (already ran)
The requested action has already been taken. Consider  # <---- does not make sense. I didn't request a specific action.
specifying parts, or clean the steps you want to run again.
Snapping |

Specs

  • Operating system: Ubuntu 20.04
@cosmic-zip
Copy link

Post or link the snap file as a hole, it's difficult to help without it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants