burrowers / garble

Obfuscate Go builds
BSD 3-Clause "New" or "Revised" License
3.73k stars 239 forks source link

ABI issue with go1.22 #820

Closed chenrui333 closed 7 months ago

chenrui333 commented 7 months ago

What version of Garble and Go are you using?

latest garble go 1.22rc1

What environment are you running Garble on?

happens on all environments, see this action run, https://github.com/chenrui333/garble/actions/runs/7280828786/job/19840079094

What did you do?

setup go 1.22rc1 and run go test --race -timeout=20m ./...

What did you expect to see?

pass the tests

What did you see instead?

tests failed

--- FAIL: TestScript (0.15s)
    --- FAIL: TestScript/ldflags (19.05s)
        testscript.go:534: # Note the proper domain, since the dot adds an edge case.
            #
            # Also note that there are three forms of -X allowed:
            #
            #   -X=name=value
            #   -X name=value
            #   -X "name=value" (or with single quotes, allows spaces in value) ([19](https://github.com/chenrui333/garble/actions/runs/7280828786/job/19840079094#step:6:20).049s)
            > env LDFLAGS='-X=main.unexportedVersion=v1.22.33 -X=main.replacedWithEmpty= -X "main.replacedWithSpaces= foo bar " -X=domain.test/main/imported.ExportedUnset=garble_replaced -X=domain.test/missing/path.missingVar=value -X=main.someType=notAVariable'
            > exec garble build -ldflags=${LDFLAGS}
            [stderr]
            # internal/chacha8rand
            $WORK/.tmp/garble-shared75670532/OsogyD_oW/Ib6vi6Lf.s:55: ABI selector only permitted when compiling runtime, reference was to "OsogyD_oW.zA5rHYMs"
            asm: assembly of $WORK/.tmp/garble-shared75670532/OsogyD_oW/Ib6vi6Lf.s failed
            exit status 1
            exit status 1
            [exit status 1]
            FAIL: testdata/script/ldflags.txtar:10: unexpected command failure

    --- FAIL: TestScript/syntax (19.46s)
        testscript.go:534: > exec garble build
            [stderr]
            # internal/chacha8rand
            $WORK/.tmp/garble-shared2415[20](https://github.com/chenrui333/garble/actions/runs/7280828786/job/19840079094#step:6:21)8593/OsogyD_oW/Ib6vi6Lf.s:55: ABI selector only permitted when compiling runtime, reference was to "OsogyD_oW.zA5rHYMs"
            asm: assembly of $WORK/.tmp/garble-shared[24](https://github.com/chenrui333/garble/actions/runs/7280828786/job/19840079094#step:6:25)15208593/OsogyD_oW/Ib6vi6Lf.s failed
            exit status 1
            exit status 1
            [exit status 1]
            FAIL: testdata/script/syntax.txtar:1: unexpected command failure

relates to https://github.com/Homebrew/homebrew-core/pull/157782

lu4p commented 7 months ago

Interesting to know that someone made a homebrew package.

chenrui333 commented 7 months ago

Interesting to know that someone made a homebrew package.

why not? what is the concern?

lu4p commented 7 months ago

There is no concern I just didn't know.

chenrui333 commented 7 months ago

Cool cool, thanks for the quick fix!

stefanb commented 6 months ago

Tnx for the fix, but to get it to homebrew this still needs to be tagged / released in the 0.12.0 or higher sometime before Go 1.22.0 is released (scheduled for February).

mvdan commented 6 months ago

We did a release just three weeks ago. We can do another in a few weeks. If you're packaging a Go pre-release, you can package garble master.

stefanb commented 6 months ago

Go 1.22 is scheduled to be released in February, so few weeks from now should still be ok.

stefanb commented 5 months ago

@mvdan Go 1.22 is released

mvdan commented 5 months ago

See https://github.com/burrowers/garble/pull/828. We uncovered a GOOS=darwin bug with Go 1.22, hence a slight delay with the release.