treeverse / treeverse/dvc

checkout: incorrectly states files are modified when they are executable

Open
#10,588 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
15.9k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

Bug Report

checkout: incorrectly states files are modified when they are executable

Description

When tracking a file that is executable, using a shared cache with symlinks, dvc checkout keeps stating changes are applied to the file.

Reproduce

contents of dvc.yaml:

  stages:
    add_some_text:
      wdir: ../
      desc: write some text
      cmd:
        - > 
          touch data/some_new_file.txt
      deps:
        - data/data.txt
      outs:
        - data/some_new_file.txt

contents of config

[cache]
    dir = ../../cache
    type = symlink
    shared = group
['remote "temp"']
    url = ../../remote
[core]
    remote = temp

steps to reproduce:

  1. mkdir -p dvc_mwe/dvc_mwe/data dvc_mwe/cache dvc_mwe/remote
  2. touch dvc_mwe/dvc_mwe/data/data.txt && chmod +x dvc_mwe/dvc_mwe/data/data.txt
  3. cd dvc_mwe/dvc_mwe
  4. git init && dvc init
  5. Copy contents of dvc.yaml to dvc_mwe/dvc_mwe/data/dvc.yaml
  6. Copy contents of config to dvc_mwe/dvc_mwe/.dvc/config
  7. dvc add data/data.txt
  8. dvc repro data/dvc.yaml
  9. dvc push
  10. dvc checkout
  11. dvc checkout

dvc checkout will keep stating that some_new_file.txt has been modified

Expected

repeatedly calling dvc checkout without any data changes should not print any files that have been modified

Environment information

python==3.10.12
dvc==3.55.2

Output of dvc doctor:

$ dvc doctor
DVC version: 3.55.2 (pip)
-------------------------
Platform: Python 3.10.13 on Linux-6.9.3-76060903-generic-x86_64-with-glibc2.35
Subprojects:
	dvc_data = 3.16.6
	dvc_objects = 5.1.0
	dvc_render = 1.0.2
	dvc_task = 0.40.2
	scmrepo = 3.3.8
Supports:
	http (aiohttp = 3.10.10, aiohttp-retry = 2.8.3),
	https (aiohttp = 3.10.10, aiohttp-retry = 2.8.3)
Config:
	Global: /home/joostdorscheidt/.config/dvc
	System: /etc/xdg/xdg-pop/dvc
Cache types: hardlink, symlink
Cache directory: ext4 on /dev/mapper/data-root
Caches: local
Remotes: local
Workspace directory: ext4 on /dev/mapper/data-root
Repo: dvc, git
Repo.site_cache_dir: /var/tmp/dvc/repo/8324f5dfe498694db375810644b6aa5a

Additional Information (if any):

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the supplied dvc.yaml, .dvc/config, symlink cache, and repeated dvc checkout commands. Start by tracing the checkout handling for executable files and symlinks; done means repeated checkout runs no longer report unchanged files as modified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.