For a new version of CL 703015 I tried importing internal/syscall/windows from the new crypto/internal/fips140/entropy package.

I expected that to work according to https://pkg.go.dev/cmd/go#hdr-Internal_Directories, since crypto/internal/fips140/entropy is in the tree rooted at the parent of internal/, which should be the whole standard library.

Instead (building with GOOS=windows):

# crypto/internal/fips140test
package crypto/internal/fips140test (test)
        imports crypto/internal/fips140/entropy
        src/crypto/internal/fips140/entropy/now_noasm.go:10:2: use of internal package internal/syscall/windows not allowed
FAIL    crypto/internal/fips140test [setup failed]
FAIL

/cc @golang/compiler

Comment From: cherrymui

cc @golang/command-line

Comment From: gabyhelp

Related Issues

(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)

Comment From: FiloSottile

Bizarrely, I moved the import to crypto/internal/fips140deps/time and it works there. Maybe something due to the fips140 import paths rewrites, in which case it would still be a bug but pretty low priority (since we do try to intermediate all internal imports via crypto/internal/fips140deps to avoid fossilizing them).