Skip to content

Generate licenses per GOOS/GOARCH build target#12611

Draft
Copilot wants to merge 2 commits intotrunkfrom
copilot/update-license-script-logic
Draft

Generate licenses per GOOS/GOARCH build target#12611
Copilot wants to merge 2 commits intotrunkfrom
copilot/update-license-script-logic

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

License generation only varied by GOOS, not GOARCH. Dependencies differ by architecture (e.g., golang.org/x/sys vs golang.org/x/sys/unix), so license files must match actual build targets.

Changes

  • script/licenses: Added GOOS/GOARCH matrix from .goreleaser.yml, iterates 9 combinations instead of 3 GOOS values
  • script/licenses-check: Updated to verify all architecture-specific license files
  • File naming: third-party-licenses.{goos}-{goarch}.md replaces third-party-licenses.{goos}.md
  • Output: 9 license files (linux: 386/arm/amd64/arm64, darwin: amd64/arm64, windows: 386/amd64/arm64)
# Define GOOS and their corresponding GOARCH values based on .goreleaser.yml
declare -A platform_archs=(
    ["linux"]="386 arm amd64 arm64"
    ["darwin"]="amd64 arm64"
    ["windows"]="386 amd64 arm64"
)

for goos in linux darwin windows ; do
    for goarch in ${platform_archs[$goos]} ; do
        GOOS="${goos}" GOARCH="${goarch}" go-licenses report ./... \
            --template .github/licenses.tmpl --ignore github.com/cli/cli \
            > third-party-licenses.${goos}-${goarch}.md
    done
done

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • al.essio.dev
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli na0X8r.res user.name s (dns block)
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli x64/pkg/tool/linux_amd64/compile-o user.email (dns block)
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli ACCEPT user.name 7336651/b031/ (dns block)
  • dario.cat
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli nfig/composer/ve-deps=true credential.helpe/opt/hostedtoolcache/go/1.24.12/x64/pkg/tool/linux_amd64/compile epOnly,Imports,ImportMap,Module (dns block)
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli u/13/cc1 credential.helpegcc (dns block)
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli ache/go/1.24.12/x64/pkg/tool/lin-o credential.usernbash (dns block)
  • go.mongodb.org
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli nfig/composer/ve-deps=true credential.helpe/opt/hostedtoolcache/go/1.24.12/x64/pkg/tool/linux_amd64/compile epOnly,Imports,ImportMap,Module (dns block)
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli u/13/cc1 credential.helpegcc (dns block)
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli ache/go/1.24.12/x64/pkg/tool/lin-o credential.usernbash (dns block)
  • go.opentelemetry.io
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli nfig/composer/ve-deps=true credential.helpe/opt/hostedtoolcache/go/1.24.12/x64/pkg/tool/linux_amd64/compile epOnly,Imports,ImportMap,Module (dns block)
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli u/13/cc1 credential.helpegcc (dns block)
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli ache/go/1.24.12/x64/pkg/tool/lin-o credential.usernbash (dns block)
  • go.yaml.in
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli nfig/composer/ve-deps=true credential.helpe/opt/hostedtoolcache/go/1.24.12/x64/pkg/tool/linux_amd64/compile epOnly,Imports,ImportMap,Module (dns block)
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli u/13/cc1 credential.helpegcc (dns block)
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli ache/go/1.24.12/x64/pkg/tool/lin-o credential.usernbash (dns block)
  • google.golang.org
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli nfig/composer/ve-deps=true credential.helpe/opt/hostedtoolcache/go/1.24.12/x64/pkg/tool/linux_amd64/compile epOnly,Imports,ImportMap,Module (dns block)
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli u/13/cc1 credential.helpegcc (dns block)
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli ache/go/1.24.12/x64/pkg/tool/lin-o credential.usernbash (dns block)
  • gopkg.in
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli nfig/composer/ve-deps=true credential.helpe/opt/hostedtoolcache/go/1.24.12/x64/pkg/tool/linux_amd64/compile epOnly,Imports,ImportMap,Module (dns block)
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli u/13/cc1 credential.helpegcc (dns block)
    • Triggering command: /home/REDACTED/go/bin/go-licenses go-licenses report ./... --template .github/licenses.tmpl --ignore github.com/cli/cli ache/go/1.24.12/x64/pkg/tool/lin-o credential.usernbash (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Update the script/licenses logic so it produces licenses for all possible build targets resulting from the matrix of:

  • GOOS values listed in script/licenses
  • GOARCH values used in release workflows or found in release artifacts

This ensures that license generation matches exactly what you ship in releases. The updated script should iterate through each GOOS and, for each, all GOARCHes used in releases/workflows. The output should produce the respective licenses for each combination (e.g. linux/amd64, darwin/arm64, etc).

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Updated script/licenses to iterate through all GOOS/GOARCH combinations based on .goreleaser.yml
- Updated script/licenses-check to verify all new license files
- Generated licenses for: linux (386, arm, amd64, arm64), darwin (amd64, arm64), windows (386, amd64, arm64)
- Removed old GOOS-only license files (third-party-licenses.{linux,darwin,windows}.md)
- Added new GOOS-GOARCH license files (e.g., third-party-licenses.linux-amd64.md)

Co-authored-by: williammartin <1611510+williammartin@users.noreply.github.com>
Copilot AI changed the title [WIP] Update script/licenses logic for build target licenses Generate licenses per GOOS/GOARCH build target Feb 3, 2026
Copilot AI requested a review from williammartin February 3, 2026 18:37
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 this pull request may close these issues.

2 participants