Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion packages/compass/.depcheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ ignores: [
'mongodb-client-encryption',
'interruptor',
# webpack always externalizes 'clipboard' for legacy reasons
'clipboard'
'clipboard',
# include signing-utils so that signtool.go can get to it
'@mongodb-js/signing-utils'
]
1 change: 1 addition & 0 deletions packages/compass/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@
"@mongodb-js/my-queries-storage": "^0.22.0",
"@mongodb-js/prettier-config-compass": "^1.2.0",
"@mongodb-js/sbom-tools": "^0.7.0",
"@mongodb-js/signing-utils": "^0.3.7",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the bug was that signtool.go is doing node -e 'require("@mongodb-js/signing-utils")' from the packages/compass folder and that node module doesn't exist there.

In the past it probably worked because the dep was hoisted and then it broke because now it is not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think doing something like npx run sign -w @mongodb-js/hadron-build -- path-to-file from signtool.go would be a cleaner fix. I'll try that in a follow-up.

"@mongodb-js/testing-library-compass": "^1.2.0",
"@mongodb-js/tsconfig-compass": "^1.2.0",
"@mongodb-js/webpack-config-compass": "^1.6.0",
Expand Down
Binary file modified packages/hadron-build/signtool/signtool.exe
Binary file not shown.
13 changes: 10 additions & 3 deletions packages/hadron-build/signtool/signtool.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ func main() {
}

allowedExtensions := []string{
"GARASIGN_USERNAME",
"GARASIGN_PASSWORD",
"ARTIFACTORY_USERNAME",
"ARTIFACTORY_PASSWORD",
"SIGNING_SERVER_HOSTNAME",
"SIGNING_SERVER_PRIVATE_KEY",
"SIGNING_SERVER_USERNAME",
Expand Down Expand Up @@ -55,12 +59,15 @@ func main() {
cmd := exec.Command("node", "-e", script)
fmt.Println("Running command:", cmd.String())

cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
stdoutStderr, err := cmd.CombinedOutput()

err := cmd.Run()
if err != nil {
fmt.Println("Error signing the file")
fmt.Printf("%s\n", stdoutStderr)
log.Println(err)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally this would be log.fatal(err) but then we don't see any of the logging and electron winstaller throws a huge error, none of which is helpful. Maybe it doesn't flush its subprocess's output? I'm not sure.

// if we error out then we won't see much because of how
// electron-windows-installer fails. We'll have to rely on package
// verification elsewhere to fail CI
return
}

Expand Down
Loading