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

wget IPv6 fails to fetch NNUE file during build #4978

Open
Shadetheartist opened this issue Jan 12, 2024 · 1 comment
Open

wget IPv6 fails to fetch NNUE file during build #4978

Shadetheartist opened this issue Jan 12, 2024 · 1 comment
Labels
needs-analysis Needs further analysis

Comments

@Shadetheartist
Copy link

Describe the issue

When building stockfish from src in a docker container, wget failed to fetch the .nnue file and thus the build failed. On my host, name resolution worked normally, but in the container, it would not. I found that forcing wget to use IPv4 (the -4 arg) would return it to working order. So it was an IPv6 name resolution thing.

This is the relevant output of my build process.

Default net: nn-5af11540bbfe.nnue
Downloading https://tests.stockfishchess.org/api/nn/nn-5af11540bbfe.nnue
wget: bad address 'tests.stockfishchess.org'
Removing failed download
Downloading https://github.com/official-stockfish/networks/raw/master/nn-5af11540bbfe.nnue
wget: bad address 'github.com'
Removing failed download
Failed to download nn-5af11540bbfe.nnue.

I worked around this by installing curl, as i noticed it takes priority in the Makefile if it is installed on the system. I think curl has a fallback mechanism that wget lacks, in the event that IPv6 dns lookups fail. And so I ended up getting it working.

But if possible, it would have been better if i could specify ipv4 as an make env var or something.

Posting this in part to help anyone who's searching for a solution in the future.

Expected behavior

The wget command succeeds when using IPv6.

Steps to reproduce

Build the Dockerfile - it may be a my-system sort of thing, so it may not be reproducible.

Anything else?

My Dockerfile (without curl)

FROM alpine:latest AS stockfish_build

# Install dependencies
RUN apk add --no-cache git g++ make

RUN git clone --depth 1 --branch sf_16 https://github.com/official-stockfish/Stockfish.git

WORKDIR /Stockfish/src
RUN echo "arch:$( uname -m )" \
&& case $( uname -m ) in \
  x86_64) \
    make -j 8 build ARCH=x86-64-modern \
  ;; \
  aarch64) \
    make build ARCH=armv8 \
  ;; \
  armv7l) \
    make build ARCH=armv7 \
  ;; \
  ppc64le) \
    make build ARCH=ppc-64 \
  ;; \
  *) \
    exit 1 \
  ;; \
esac

Operating system

Linux

Stockfish version

Stockfish 16 (Tag)

@Disservin
Copy link
Member

Hi sorry for the late response...

regarding the fallback in the GNU wget manual they state

‘-4’
‘--inet4-only’
‘-6’
‘--inet6-only’
...
Neither options should be needed normally. By default, an IPv6-aware Wget will use the address family specified by the host’s DNS record. If the DNS responds with both IPv4 and IPv6 addresses, Wget will try them in sequence until it finds one it can connect to. (Also see --prefer-family option described below.)

So it seems they have a fallback? Regardless of that, neither GitHub nor Fishtest currently support IPv6...

@Disservin Disservin added the needs-analysis Needs further analysis label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-analysis Needs further analysis
Projects
None yet
Development

No branches or pull requests

3 participants
@Shadetheartist @Disservin and others