dry-orange-3870
10/12/2023, 2:34 PMcontent = FileContent(path=versions_file_path, content="some string")
digest = await Get(Digest, CreateDigest([content]))
That resulted in the infamous Filesystem changed during run: retrying 'MyGoal'
infinite loop. I was really confused. Upon further inspection of the run logs, I found this:
09:14:56.95 [31m[ERROR][0m panic at 'called `Result::unwrap()` on an `Err` value: "Field `content` was not convertible to type alloc::vec::Vec<u8>: PyErr { type: <class 'TypeError'>, value: TypeError(\"'str' object cannot be interpreted as an integer\"), traceback: None }"', src/intrinsics.rs:422
So I updated the code above to call .encode()
on the string before passing it as content
and things started working. However, I feel like my mistake should have resulted in an error / failure instead of the infinite Filesystem changed
loop. Should I open a bug for this?curved-television-6568
10/12/2023, 2:37 PMcurved-television-6568
10/12/2023, 2:38 PMcontent
is of type bytes
, but it’s not likely you’ll reach for one when you hit an issue like this.
https://github.com/pantsbuild/pants/blob/main/src/python/pants/engine/fs.py#L53dry-orange-3870
10/12/2023, 2:45 PMcurved-television-6568
10/12/2023, 2:54 PMdry-orange-3870
10/12/2023, 3:07 PMAdditional info
I like pants