brave-hair-402
09/28/2023, 11:06 AM{pants.hash}
option. For some reason, each time I run the deployment process (even on the same commit), I receive different hash values. However, when I do this locally, it seems to work fine. Does anyone have any insights into why this might be happening?broad-processor-92400
09/28/2023, 12:34 PMpants peek
on the image and all its transitive dependencies (I’m on my phone so I can’t suggest the appropriate shell pipeline, sorry), and comparing them between different retries. (In theory, the output can include hashes of files, but maybe only in 2.18 (prerelease); I don’t recall)
And/or running git status
and git diff
before the pants commandcurved-television-6568
09/28/2023, 1:51 PMpants.hash
is calculated based on build args, build env and build context digest: https://github.com/pantsbuild/pants/blob/43828adfdbe982931ee0c79e39fce3b859c564c3/src/python/pants/backend/docker/util_rules/docker_build_context.py#L130-L134
So any of those three seems to not be stable during your bitbucket pipeline runs. If you’re able to run with --keep-sandboxes=always
you should be able to inspect the sandbox and the __run.sh
script in there to find the differences.broad-processor-92400
09/28/2023, 11:53 PMpants peek ::
includes a`source_fingerprint` hash in Pants 2.16 and newer, so diffing the output of pants dependencies --transitive path/to:image | xargs pants peek
between two runs would hopefully identify if it's a file or configuration change. You can do a similar diff on the output of env
to see if there's interesting environment variable changes, if that might be a source of problems too)