Skip to content
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

Add Support for s390x and ppc64le #268

Closed
james-crowley opened this issue Aug 4, 2022 · 4 comments · Fixed by #270
Closed

Add Support for s390x and ppc64le #268

james-crowley opened this issue Aug 4, 2022 · 4 comments · Fixed by #270

Comments

@james-crowley
Copy link
Contributor

@dnephin I saw a couple PRs and additions for various architectures like #181. Would you be open to adding s390x and ppc64le?

s390x refers to the mainframe architecture on Linux or common referred to Linux on Z. While ppc64le refers to the Power architecture. Both architectures are made by IBM, even though some of it is open source.

From my experience both s390x and ppc64le both have great support in GO and usually cross compile without issue.

I believe the .goreleaser.yml would need to be update to look something like:

project_name: gotestsum

release:
  github:
    owner: gotestyourself
    name: gotestsum

builds:
  - binary: gotestsum
    goos:
      - darwin
      - windows
      - linux
    goarch:
      - amd64
      - arm64
      - arm
      - s390x
      - ppc64le
    env: [CGO_ENABLED=0]
    ldflags: ["-s -w -X gotest.tools/gotestsum/cmd.version={{.Version}}"]

checksum:
  name_template: '{{ .ProjectName }}-{{ .Version }}-checksums.txt'

@dnephin If you are open to support those architecture, I can submit a PR for you if you would like!

@dnephin
Copy link
Member

dnephin commented Aug 6, 2022

Hello, thank you for opening this issue!

I am not against adding more architectures to the list, but I'd prefer to only add them if someone needs them. If you have a need for these architectures or know of someone else that does, then definitely lets add them.

I think adding them to the goarch list should be most of the work, but please also see the discussion here #175 (comment) and below in that issue. It appears that simply adding ppc64le to that list may not be enough. We may have to set one other field.

I'll also request that we only build these architectures for Linux. You should be able to check which platforms are being built in the output of the build job in CI.

@james-crowley
Copy link
Contributor Author

@dnephin Thanks for the prompt reply!

We, CircleCI, are doing some testing with ppc64le and s390x. Currently, we utilize this package to do some manual testing. To move forward with automated testing, would would need official support from this package.

In my initial look over, I saw #175. It looks like the CircleCI build you linked to is invalid now, or at least I can't see it.

Would you mind linking to that build or a similar build where the gorelease file was updated? I am happy to look over your CircleCI pipeline, after all that's part of my job 🙂

One suggestion is for you to add a CircleCI badge to the README, so people can easily seeing the builds and status. You can find some docs on that here.

Also, I have access to ppc64le and s390x hardware, so I am happy with doing on architecture verification.

@james-crowley
Copy link
Contributor Author

@dnephin Just tested support for s390x. The binary seemed to compile just fine:

root@cf9cb61447db:/go/gotestsum/dist# file gotestsum
gotestsum: ELF 64-bit MSB executable, IBM S/390, version 1 (SYSV), dynamically linked, interpreter /lib/ld64.so.1, Go BuildID=bfKgpVYvvucvPXPIJNRG/VP50AyqM9OVrX-M6p3FJ/W9OMtTPCvXvxMmul9Vg3/Bkv4S3Kf9odx0WXoJJs0, not stripped
root@cf9cb61447db:/go/gotestsum/dist# ./gotestsum help
Usage:
    ./gotestsum [flags] [--] [go test flags]
    ./gotestsum [command]

Flags:
      --debug                                       enabled debug logging
  -f, --format string                               print format of test input (default "short")
      --hide-summary summary                        hide sections of the summary: skipped,failed,errors,output (default none)
      --jsonfile string                             write all TestEvents to file
      --junitfile string                            write a JUnit XML file
      --junitfile-project-name string               name of the project used in the junit.xml file
      --junitfile-testcase-classname field-format   format the testcase classname field as: full, relative, short (default full)
      --junitfile-testsuite-name field-format       format the testsuite name field as: full, relative, short (default full)
      --max-fails int                               end the test run after this number of failures
      --no-color                                    disable color output
      --packages list                               space separated list of package to test
      --post-run-command command                    command to run after the tests have completed
      --raw-command                                 don't prepend 'go test -json' to the 'go test' command
      --rerun-fails int[=2]                         rerun failed tests until they all pass, or attempts exceeds maximum. Defaults to max 2 reruns when enabled.
      --rerun-fails-max-failures int                do not rerun any tests if the initial run has more than this number of failures (default 10)
      --rerun-fails-report string                   write a report to the file, of the tests that were rerun
      --version                                     show version and exit
      --watch                                       watch go files, and run tests when a file is modified

Formats:
    dots                    print a character for each test
    dots-v2                 experimental dots format, one package per line
    pkgname                 print a line for each package
    pkgname-and-test-fails  print a line for each package and failed test output
    testname                print a line for each test and package
    standard-quiet          standard go test format
    standard-verbose        standard go test -v format

Commands:
    tool                    tools for working with test2json output
    help                    print this help next

@james-crowley
Copy link
Contributor Author

@dnephin Just modified the goreleaser.yml like I mentioned above for s390x and ppc64le. You can see a working build here.

Pulling down the artifact from CircleCI on to an s390x system worked out fine!

linux1@circleci-runner-s390x:~$ wget https://output.circle-artifacts.com/output/job/a0e9cf72-e153-4b73-a04a-9eb6ef1f5499/artifacts/0/dist/gotestsum_linux_s390x/gotestsum && chmod +x gotestsum
linux1@circleci-runner-s390x:~$ ./gotestsum --version
gotestsum version 0.0.0-SNAPSHOT-85a7f9e
linux1@circleci-runner-s390x:~$ arch
s390x

I'll open up a PR soon for official support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants