-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Could not find module" error on Windows with remote caching #1260
Comments
I was able to reproduce this issue with a
The execution log reveals that the following files are empty:
Their hash is To test if this is a reproducible issue in The object and interface outputs of the compilation action are only tracked as directories ( |
I have encountered such an issue on the Azure build log
|
And another instance on #1411 which succeeded after a CI rerun. |
With #1281 in place in the daml repo we have encountered possibly related issues:
This could be related to this bazel issue where presence of items in the action cache without corresponding items in the CAS leads to missing outputs. |
After some debugging with @aherrmann and @garyverhaegen-da and it looks like the one above is a red herring. We tracked down which AC was queried by Bazel (if someone has a better way of doing that than wireshark, I’m all ears, the eventlog and execlog don’t seem to work). The AC that was queried contains no At least in our current cache, there don’t appear to be any targets with no output directors, files and an empty stdout and stderr so as a workaround we are considering to iterate over all ACs periodically and delete ACs of this type. |
Describe the bug
On Windows with remote caching enabled it can happen that builds fail with an error of the form
Even though a build without remote cache enabled passes.
I.e. that target should build without error. The modules that the compiler could not find are in fact present. The fact that a non-cached build passes suggests that the cache is poisoned or Bazel fetches from cache improperly.
To Reproduce
Unfortunately, I haven't found a way to reproduce the issue. On the
daml
repository this happens occasionally when we updaterules_haskell
.Expected behavior
The target should build without error whether or not remote caching is enabled.
Environment
Additional context
Looking at the contents of
exposed-modules-<target>
,<target>.static.manifest
, or the generated package configuration, reveals that no modules or object files are listed in any of these. These files are generated by actions that take theobjects_dir
orinterfaces_dir
as an input. I.e. they depend on directories rather than files. It seems that the contents of these directories are lost somewhere between the remote cache and the build.I have tried adding the target's haskell source files as inputs to the corresponding actions. However, this did not fix the issue.
I have tried to reproduce the issue on a simpler example, but was unsuccessful.
One possibility to avoid this issue could be to generate the exposed modules list and object manifest files directly during the compilation action, so that they don't depend on a directory, but rather directly on the source files. It is unclear if this would just shift the error to the linking step though. Another possibility would be to explicitly track the object and interface files rather than only the directories containing them. This is more difficult as their paths are dependent on the module names and not the source file paths and therefore cannot generally be predicted within Bazel. However, the compilation action could contain a post-processing step that moves these files into the positions that Bazel expects.
The text was updated successfully, but these errors were encountered: