-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Publish failed due to "Could not find MODULE.bazel", not sure how to debug #176
Comments
Gentle ping @kormide -- do the logs show anything that might be related? I've not been able to figure out how to get this project to run locally for testing. |
Sorry for the delay. I'll fork your repo and try to reproduce it in the dev environment I have set up. |
Nevermind, I can just hardcode the source url to one of your existing release archives. |
I found the issue. We aren't waiting for the writable stream to close after decompressing. Fixing this revealed another bug. I'll get some fixes up soon. |
After fixing the waiting issue, it seems that the extracted contents are not correct. For example, it's trying to parse the extracted MODULE.bazel file, but that file contains contents from your m4_repository.bzl file. |
I was able to reproduce the incorrect Is it possible that Node's file streams require explicit synchronization to preserve order between calls? This doesn't make sense to me, but the following diff seems to fix the problem (the logged bytes and streamed bytes become the same). diff --git a/src/infrastructure/xzdec/xzdec.ts b/src/infrastructure/xzdec/xzdec.ts
index 208d150..5fd9efc 100644
--- a/src/infrastructure/xzdec/xzdec.ts
+++ b/src/infrastructure/xzdec/xzdec.ts
@@ -126,7 +126,11 @@ export async function decompress(r: stream.Readable, w: stream.Writable) {
}
const outputLen = peekU32(mem, outputLenPtr);
if (outputLen > 0) {
- w.write(Buffer.from(mem.buffer, outputPtr, outputLen));
+ await (new Promise((resolve) => {
+ w.write(Buffer.from(mem.buffer, outputPtr, outputLen), () => {
+ resolve(null);
+ });
+ }));
}
}
} |
The fixes have been deployed to prod. |
I just cut rules_m4 v0.2.4 (https://github.com/jmillikin/rules_m4/releases/tag/v0.2.4), but publish-to-bcr failed:
The source archive does contain a
MODULE.bazel
file at the top level:I suspect the underlying cause is somewhere in the recently-added
.tar.xz
support (is it not extracting properly?), but the error email contains no logs or information so it's difficult to debug.The text was updated successfully, but these errors were encountered: