Skip to content

File header checker does not allow multi-line build constraints #5

@samuelkarp

Description

@samuelkarp

In containerd/containerd#7033 (comment), I suggested a constraint of //go:build (linux || windows || darwin) && !no_cri. In the old syntax, that expands to:

// +build linux windows darwin
// +build !no_cri

When used together for compatibility, this results in a three-line build constraint section prior to the file header:

//go:build (linux || windows || darwin) && !no_cri
// +build linux windows darwin
// +build !no_cri

This causes the file headers check to fail:

2022-06-09T17:02:11.9823766Z ##[group]Run echo "::group::📚 File headers"
2022-06-09T17:02:11.9824087Z �[36;1mecho "::group::📚 File headers"�[0m
2022-06-09T17:02:11.9824517Z �[36;1m/home/runner/work/_actions/containerd/project-checks/v1/script/validate/fileheader /home/runner/work/_actions/containerd/project-checks/v1/�[0m
2022-06-09T17:02:11.9824914Z �[36;1mecho "::endgroup::"�[0m

(https://github.com/containerd/containerd/runs/6817382535)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions