AlgebraicWolf opened a new issue, #2186:
URL: https://github.com/apache/buildstream/issues/2186

   When an element has a dependency with an open workspace, that dependency's 
artifacts get staged with their real mtimes instead of the magic timestamp. 
This can cause differences between builds with and without the workspace.
   
   # Steps to reproduce
   
   A small project to reproduce the issue:
   
   ```
   .
   ├── a.txt
   ├── elements
   │   ├── a.bst
   │   ├── alpine.bst
   │   └── b.bst
   └── project.conf
   ```
   
   The context of `a.txt` are irrelevant, it can be left empty. 
`elements/a.bst` carries `a.txt`:
   
   ```
   kind: import
   
   sources:
     - kind: local
       path: a.txt
   
   config:
     target: /
   ```
   
   `elements/b.bst` has `a.bst` and `alpine.bst` as build dependencies:
   
   ```
   kind: manual
   
   build-depends:
     - alpine.bst
     - a.bst
   ```
   
   <details>
   <summary>project.conf and alpine.bst are set up to pull alpine 
image</summary>
     
   `alpine.bst`:
   
   ```
   kind: import
   description: |
   
       Alpine Linux base runtime
   
   sources:
   - kind: tar
   
     # This is a post doctored, trimmed down system image
     # of the Alpine linux distribution.
     #
     url: alpine:integration-tests-base.v1.x86_64.tar.xz
     ref: 3eb559250ba82b64a68d86d0636a6b127aa5f6d25d3601a79f79214dc9703639
   ```
   
   `project.conf`:
   
   ```
   # Unique project name
   name: bug-repro
   
   # Required BuildStream version
   min-version: 2.7
   
   # Subdirectory where elements are stored
   element-path: elements
   
   aliases:
     alpine: 
https://bst-integration-test-images.ams3.cdn.digitaloceanspaces.com/
   ```
   </details>
   
   When no workspace is open, building `b.bst`, opening its build sandbox, and 
checking the mtime of `a.txt` shows that all is well, and modification time is 
normalised:
   
   ```
   $ bst build b.bst
   ...
   $ bst shell --build b.bst
   ...
   [[email protected]:/buildstream/repro/b.bst]$ stat /a.txt 
     File: /a.txt
     Size: 0               Blocks: 0          IO Block: 4096   regular empty 
file
   Device: 31h/49d Inode: 2           Links: 1
   Access: (0644/-rw-r--r--)  Uid: (1876721912/ UNKNOWN)   Gid: (1174200513/ 
UNKNOWN)
   Access: 2011-11-11 11:11:11.000000000
   Modify: 2011-11-11 11:11:11.000000000
   Change: 2011-11-11 11:11:11.000000000
   ```
   
   If `a.bst`'s workspace is opened first, the modification time is no longer 
the magic timestamp but the actual `a.bst`'s build time instead: 
   
   ```
   $ bst workspace open a.bst
   ...
   $ bst build b.bst
   ...
   $ bst shell --build b.bst
   ...
   [[email protected]:/buildstream/repro/b.bst]$ stat /a.txt
     File: /a.txt
     Size: 0               Blocks: 0          IO Block: 4096   regular empty 
file
   Device: 31h/49d Inode: 3           Links: 1
   Access: (0644/-rw-r--r--)  Uid: (1876721912/ UNKNOWN)   Gid: (1174200513/ 
UNKNOWN)
   Access: 2011-11-11 11:11:11.000000000
   Modify: 2026-08-25 11:06:30.000000000
   Change: 2011-11-11 11:11:11.000000000
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to