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

autoskip - targets which should be rerun are skipped as cached #3895

Closed
idodod opened this issue Mar 12, 2024 · 1 comment
Closed

autoskip - targets which should be rerun are skipped as cached #3895

idodod opened this issue Mar 12, 2024 · 1 comment
Assignees
Labels
type:bug Something isn't working

Comments

@idodod
Copy link
Contributor

idodod commented Mar 12, 2024

What went wrong?

While using the go docker image as the base image to build and run tests for go applications, I noticed that after upgrading the go version, the targets that build & test are still skipped even though I expected those targets to run with the new go version.

common/Earthfile

VERSION 0.8

ARG GOLANG_VERSION=1.21-alpine
FROM golang:$GOLANG_VERSION

some-service/Earthfile

FROM ../common+base
RUN apk add --update --no-cache build-base ca-certificates curl
WORKDIR /app

deps:
    #COPY go files
    COPY go.mod go.sum ./
    RUN go mod download

Earthfile:

build-services:
    BUILD --autoskip ./some-service+deps

earthly --autoskip +build-services

What should have happened?

Autoskip should have detected that the base image changed and rerun the target

Other Helpful Information

@idodod idodod added the type:bug Something isn't working label Mar 12, 2024
@mikejholly mikejholly self-assigned this Mar 12, 2024
@mikejholly
Copy link
Contributor

I was able to reproduce this with:

VERSION --build-auto-skip 0.8

ARG VERSION=3.18.6
FROM alpine:$VERSION

parent:
    RUN cat /etc/os-release

expand-args-from:
    BUILD --auto-skip +parent

mikejholly added a commit that referenced this issue Mar 15, 2024
The auto-skip code did not account for the "base" target. Hence, the
change to root-level `ARG`s were not breaking the cache.

#3895
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants