Skip to content

Commit

Permalink
prepare for v0.5.0
Browse files Browse the repository at this point in the history
While here, add a TODO I forgot about, and run gofumpt.

Also bump all test timeouts slightly,
as the Mac and Windows hosted runners are a bit slow
and I've hit failures twice recently.
  • Loading branch information
mvdan committed Jan 6, 2022
1 parent 29ea99f commit 4f0657a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
pull_request:
branches:
- master

# Note that a full "go test" is quite heavy,
# as it runs many builds under the hood.
# The default -timeout=10m can be hit by the hosted runners.

name: Test
jobs:
test:
Expand All @@ -23,11 +28,10 @@ jobs:
- name: Test
run: |
go env
go test ./...
go test -timeout=15m ./...
- name: Test with -race
# macos and windows tend to be a bit slower,
# and it's rare that a race in garble would be OS-specific.
# also note that this can take 5-10m, so use a larger timeout.
if: matrix.os == 'ubuntu-latest'
run: |
go test -race -timeout=20m ./...
Expand All @@ -50,7 +54,7 @@ jobs:
- name: Test
run: |
go env
go test ./...
go test -timeout=15m ./...
test-gotip:
runs-on: ubuntu-latest
Expand All @@ -77,7 +81,7 @@ jobs:
- name: Test
run: |
go env
go test ./...
go test -timeout=15m ./...
code-checks:
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## WIP: [0.5.0] - 2021-12-??
## [0.5.0] - 2022-01-06

This release of Garble adds initial support for the upcoming Go 1.18,
continues support for Go 1.17.x, and drops support for Go 1.16.x.
Expand All @@ -19,6 +19,7 @@ Noteworthy changes include:
* Add the `-debug` flag to log details of the obfuscated build
* Ensure the `runtime` package is built in a reproducible way
* Obfuscate local variable names to prevent shadowing bugs
* Fix and test support for using garble on 32-bit hosts

## [0.4.0] - 2021-08-26

Expand Down
18 changes: 8 additions & 10 deletions internal/literals/obfuscators.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ type obfuscator interface {
obfuscate(data []byte) *ast.BlockStmt
}

var (
// obfuscators contains all types which implement the obfuscator Interface
obfuscators = []obfuscator{
simple{},
swap{},
split{},
shuffle{},
seed{},
}
)
// obfuscators contains all types which implement the obfuscator Interface
var obfuscators = []obfuscator{
simple{},
swap{},
split{},
shuffle{},
seed{},
}

// If math/rand.Seed() is not called, the generator behaves as if seeded by rand.Seed(1),
// so the generator is deterministic.
Expand Down
2 changes: 2 additions & 0 deletions shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ func listPackage(path string) (*listedPackage, error) {
if ok {
return pkg, nil
}
// TODO: List fewer packages here. std is 200+ packages,
// but in reality we should only miss 20-30 packages at most.
if err := appendListedPackages("std"); err != nil {
panic(err) // should never happen
}
Expand Down

0 comments on commit 4f0657a

Please sign in to comment.