Skip to content

Commit b18cbba

Browse files
authored
Merge pull request #257 from bugsnag/release/v3.7.0
v3.7.0 Release
2 parents 4535691 + 3d13411 commit b18cbba

File tree

9 files changed

+61
-31
lines changed

9 files changed

+61
-31
lines changed

.buildkite/pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ steps:
5050

5151
- label: "Node {{matrix}} Package Installation Tests"
5252
depends_on: build
53+
branches: "!release/*"
5354
matrix:
5455
- "18"
5556
- "20"

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [3.7.0] - 2026-01-19
4+
5+
### Changed
6+
7+
- Update the logic and order when checking for empty dSYMS and missing DWARF information for dSYM uploads. [#256](https://github.com/bugsnag/bugsnag-cli/pull/256)
8+
39
## [3.6.1] - 2026-01-07
410

511
### Fixed

features/steps/steps.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@
3434
Maze.check.include(run_output, message)
3535
end
3636

37+
Then('I should see a log level of {string} when the dSYM files is empty') do |log_level|
38+
message_regex = /#{Regexp.escape(log_level)}\s+Error\ locating\ dSYM\ files:\s+(\/[^\/\s]+)+\.dSYM\s+is\ empty/
39+
regex = Regexp.new(message_regex)
40+
Maze.check.match(regex, run_output)
41+
end
42+
43+
Then('I should see a log level of {string} when the DWARF file is not valid') do |log_level|
44+
message_regex = /#{Regexp.escape(log_level)}\s+Error\ locating\ dSYM\ files:\s+(\/[^\/\s]+)+\.dSYM\s+does\ not\ contain\ valid\ DWARF\ information/
45+
regex = Regexp.new(message_regex)
46+
Maze.check.match(regex, run_output)
47+
end
48+
3749
Then('I should see a log level of {string} when no dSYM files could be uploaded') do |log_level|
3850
message = log_level + ' failed after'
3951
Maze.check.include(run_output, message)

features/xcode/expected_err_and_warn_scenarios.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ Feature: dSYM Expected Error and Warning scenario Integration Tests
66

77
Scenario: If --ignore-empty-dsym is not set, then the log message returned should be [ERROR]
88
When I run bugsnag-cli with upload xcode-build --upload-api-root-url=http://localhost:$MAZE_RUNNER_PORT --api-key=1234567890ABCDEF1234567890ABCDEF --project-root=/path/to/project/root --scheme=test features/xcode/fixtures/ZeroByteDsym
9-
Then I should see a log level of "[FATAL]" when no dSYM files could be found
9+
Then I should see a log level of "[FATAL]" when the dSYM files is empty
1010

1111
Scenario: If --ignore-missing-dwarf is set to true, then the log message returned should be [WARN]
1212
When I run bugsnag-cli with upload xcode-build --upload-api-root-url=http://localhost:$MAZE_RUNNER_PORT --api-key=1234567890ABCDEF1234567890ABCDEF --project-root=/path/to/project/root --scheme=test --ignore-missing-dwarf=true features/xcode/fixtures/MissingDWARFdSYM
1313
Then I should see a log level of "[FATAL]" when no dSYM files could be found
1414

1515
Scenario: If --ignore-missing-dwarf is not set, then the log message returned should be [ERROR]
1616
When I run bugsnag-cli with upload xcode-build --upload-api-root-url=http://localhost:$MAZE_RUNNER_PORT --api-key=1234567890ABCDEF1234567890ABCDEF --project-root=/path/to/project/root --scheme=test features/xcode/fixtures/MissingDWARFdSYM
17-
Then I should see a log level of "[FATAL]" when no dSYM files could be found
17+
Then I should see a log level of "[FATAL]" when the DWARF file is not valid
1818

1919
Scenario: If --ignore-missing-dwarf is set to true, then the log message returned should be [WARN]
2020
When I run bugsnag-cli with upload xcode-build --upload-api-root-url=http://localhost:$MAZE_RUNNER_PORT --api-key=1234567890ABCDEF1234567890ABCDEF --project-root=/path/to/project/root --scheme=test --ignore-missing-dwarf=true features/xcode/fixtures/MissingDWARFdSYM
2121
Then I should see a log level of "[FATAL]" when no dSYM files could be found
2222

2323
Scenario: If --ignore-missing-dwarf is not set, then the log message returned should be [ERROR]
2424
When I run bugsnag-cli with upload xcode-build --upload-api-root-url=http://localhost:$MAZE_RUNNER_PORT --api-key=1234567890ABCDEF1234567890ABCDEF --project-root=/path/to/project/root --scheme=test features/xcode/fixtures/MissingDWARFdSYM
25-
Then I should see a log level of "[FATAL]" when no dSYM files could be found
25+
Then I should see a log level of "[FATAL]" when the DWARF file is not valid

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ display_help() {
9191
EOS
9292
}
9393

94-
VERSION="3.6.1"
94+
VERSION="3.7.0"
9595

9696
while [[ "$#" -gt 0 ]]; do
9797
case "$1" in

js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bugsnag/cli",
3-
"version": "3.6.1",
3+
"version": "3.7.0",
44
"description": "BugSnag CLI",
55
"main": "dist/bugsnag-cli-wrapper.js",
66
"types": "dist/bugsnag-cli-wrapper.d.ts",

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/bugsnag/bugsnag-cli/pkg/upload"
1212
)
1313

14-
var package_version = "3.6.1"
14+
var package_version = "3.7.0"
1515

1616
func main() {
1717
commands := options.CLI{}

pkg/ios/dsym-utils.go

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ func FindDsymsInPath(path string, ignoreEmptyDsym, ignoreMissingDwarf bool, logg
3737
var tempDir string
3838
var dsymLocations []string
3939
var dwarfInfo []*DwarfInfo
40+
var dwarfLocation string
4041

4142
// If path is set and is a directory
4243
if utils.IsDir(path) {
4344
// Check for dSYMs within it
4445
dsymLocations = findDsyms(path)
45-
4646
} else {
4747

4848
// If path is pointing to a .zip file, we will extract it and look for dSYMS within it to get dsymLocations
@@ -60,12 +60,10 @@ func FindDsymsInPath(path string, ignoreEmptyDsym, ignoreMissingDwarf bool, logg
6060
logger.Debug(fmt.Sprintf("Unzipped %s to %s for uploading", fileName, tempDir))
6161
dsymLocations = findDsyms(tempDir)
6262
}
63-
6463
} else {
6564
// If path points to a file, then we will assume it is a dSYM and use it as-is
6665
dsymLocations = append(dsymLocations, path)
6766
}
68-
6967
}
7068

7169
// If we have found dSYMs, use dwarfdump to get the UUID etc for each dSYM
@@ -75,10 +73,28 @@ func FindDsymsInPath(path string, ignoreEmptyDsym, ignoreMissingDwarf bool, logg
7573
}
7674

7775
for _, dsymLocation := range dsymLocations {
78-
filesFound, err := os.ReadDir(dsymLocation)
76+
fileInfo, err := os.Stat(dsymLocation)
7977

8078
if err != nil {
81-
// If not a directory, then we'll assume that the path is pointing straight to a file
79+
return nil, tempDir, err
80+
}
81+
82+
// Skip empty *.dSYM if requested
83+
if fileInfo.Size() == 0 {
84+
if ignoreEmptyDsym {
85+
logger.Info(fmt.Sprintf("%s is empty, skipping", dsymLocation))
86+
continue
87+
} else {
88+
return nil, tempDir, fmt.Errorf("%s is empty", dsymLocation)
89+
}
90+
}
91+
92+
dwarfLocation = filepath.Join(dsymLocation, "Contents", "Resources", "DWARF")
93+
94+
filesFound, err := os.ReadDir(dwarfLocation)
95+
96+
if err != nil {
97+
// If not a directory, then we'll assume that the path is pointing straight to a DWARF file
8298
if strings.Contains(err.Error(), "not a directory") {
8399
fileName := filepath.Base(dsymLocation)
84100
dsymLocation = filepath.Dir(dsymLocation)
@@ -87,24 +103,18 @@ func FindDsymsInPath(path string, ignoreEmptyDsym, ignoreMissingDwarf bool, logg
87103
}
88104

89105
for _, file := range filesFound {
90-
fileInfo, _ := os.Stat(filepath.Join(dsymLocation, file.Name()))
91-
92-
if fileInfo.Size() > 0 {
93-
info := getDwarfFileInfo(dsymLocation, file.Name())
94-
if len(info) == 0 {
95-
if ignoreMissingDwarf {
96-
logger.Info(fmt.Sprintf("%s is not a valid DWARF file, skipping", fileInfo.Name()))
97-
} else {
98-
return nil, tempDir, fmt.Errorf("%s is not a valid DWARF file", fileInfo.Name())
99-
}
100-
}
106+
// Extract DWARF info
107+
info := getDwarfFileInfo(dwarfLocation, file.Name())
108+
if len(info) > 0 {
101109
dwarfInfo = append(dwarfInfo, info...)
110+
}
111+
}
112+
113+
if len(dwarfInfo) == 0 {
114+
if ignoreMissingDwarf {
115+
logger.Info(fmt.Sprintf("%s does not contain valid DWARF information, skipping", dsymLocation))
102116
} else {
103-
if ignoreEmptyDsym {
104-
logger.Info(fmt.Sprintf("%s is empty, skipping", file.Name()))
105-
} else {
106-
return nil, tempDir, fmt.Errorf("%s is empty", file.Name())
107-
}
117+
return nil, tempDir, fmt.Errorf("%s does not contain valid DWARF information", dsymLocation)
108118
}
109119
}
110120
}
@@ -168,7 +178,7 @@ func findDsyms(root string) []string {
168178

169179
// If the file is a dSYM, add it to the list (unless it resides within the __MACOSX directory)
170180
if strings.HasSuffix(strings.ToLower(info.Name()), ".dsym") && !strings.Contains(strings.ToLower(path), "__macosx") {
171-
dsyms = append(dsyms, filepath.Join(path, "Contents", "Resources", "DWARF"))
181+
dsyms = append(dsyms, path)
172182
}
173183

174184
return nil

pkg/ios/xcarchive.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ package ios
33
import (
44
"bytes"
55
"fmt"
6-
"github.com/bugsnag/bugsnag-cli/pkg/log"
7-
"github.com/bugsnag/bugsnag-cli/pkg/options"
8-
"github.com/bugsnag/bugsnag-cli/pkg/utils"
96
"os"
107
"os/exec"
118
"os/user"
129
"path/filepath"
1310
"strings"
1411
"time"
12+
13+
"github.com/bugsnag/bugsnag-cli/pkg/log"
14+
"github.com/bugsnag/bugsnag-cli/pkg/options"
15+
"github.com/bugsnag/bugsnag-cli/pkg/utils"
1516
)
1617

1718
// GetLatestXcodeArchiveForScheme retrieves the latest xcarchive for a given scheme.

0 commit comments

Comments
 (0)