jenkinsci / jenkinsci/git-plugin

[JENKINS-65395] Docker/SELinux/git break incremental builds

Open
#3,652 7 comments 0 reactions 0 assignees View on GitHub
component:git-plugin enhancement imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

I have a declarative pipeline with a docker agent running on a machine with SELinux enabled. At some point in the "checkout scm" step "git checkout -f " is run.

During the first run the checkout is all fine. The Docker agent gives the correct SELinux label to the files and it's all fine. The problem is that when setting the SELinux label the files ctime is modified (even if the correct SELinux label was already in place) and in the next job run, if it's an incremental build "git checkout -f " updates the mtime... so the build system ends up rebuilding stuff that doesn't need to be rebuilt, making the build not that "incremental".

 

Running "git update-index --refresh" the git index is updated and later "git checkout -f " doesn't update the mtime any more. But I don't really know git so well, so I don't know if running "git update-index --refresh" is a (good) fix.

 

---
Originally reported by reddwarf94, imported from: Docker/SELinux/git break incremental builds


  • status: Open
  • priority: Minor
  • component(s): git-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 4
  • imported: 2025-12-02

Raw content of original issue

I have a declarative pipeline with a docker agent running on a machine with SELinux enabled. At some point in the "checkout scm" step "git checkout -f <commit_id>" is run.

During the first run the checkout is all fine. The Docker agent gives the correct SELinux label to the files and it's all fine. The problem is that when setting the SELinux label the files ctime is modified (even if the correct SELinux label was already in place) and in the next job run, if it's an incremental build "git checkout -f <commit_id>" updates the mtime... so the build system ends up rebuilding stuff that doesn't need to be rebuilt, making the build not that "incremental".

 

Running "git update-index --refresh" the git index is updated and later "git checkout -f <commit_id>" doesn't update the mtime any more. But I don't really know git so well, so I don't know if running "git update-index --refresh" is a (good) fix.

 

  • environment: Fedora 33, Btrfs, Jenkins 2.277.2 all plugins updated

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.