Skip to content

x/net/lif, x/net/route: as long as std imports these packages, they can't import golang.org/x/sys/unix because of standard library policy #54259

Closed
@dmitshur

Description

@dmitshur

Updating to latest golang.org/x dependencies causes golang.org/x/sys/unix to be vendored into std, which goes against the policy set in #32102:

--- FAIL: TestScript (0.02s)
    --- FAIL: TestScript/prevent_sys_unix_import (1.68s)
        script_test.go:270: 
            # (2022-08-04T14:23:36Z)
            # Policy decision: we shouldn't vendor golang.org/x/sys/unix in std
            # See https://golang.org/issue/32102 (1.671s)

It's happening because the golang.org/x/net/lif package (vendored into std) has been updated to import and depend on golang.org/x/sys/unix in CL 413275 and CL 414994:

src $ go mod why 'golang.org/x/sys/unix'
# golang.org/x/sys/unix
net
golang.org/x/net/lif
golang.org/x/sys/unix

To make progress on #36905, I will likely need to send CLs to revert those golang.org/x/net/lif simplification CLs.

Package net seems to only use golang.org/x/net/lif in one function call interfaceAddrTable, so a path that can be investigated in the future is whether removing that dependency can be simpler overall.

CC @tklauser, @ianlancetaylor, @bcmills.

Metadata

Metadata

Labels

FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions