Run release-builder locally, copy archive failed

I’m trying running release-builder locally
when it runs to build debian package, it can’t found the istio-sidecar.deb 。
I found it in istio.io/istio/tools/packaging/deb/istio.mk , it use ${ISTIO_OUT}/istio-sidecar.deb to save the files,but release-builder’s debian.go use RepoOutDir

func (m Manifest) RepoOutDir(repo string) string {
	return path.Join(m.Directory, "work", "src", "istio.io", repo, "out", "linux_amd64", "release")
}

it seems the ISTIO_OUT unequally RepoOutDir?

make deb/fpm
Building with your local toolchain.
make[1]: Entering directory `/tmp/tmp.nkBh0YztCd/build/work/src/istio.io/istio'
rm -f /tmp/tmp.nkBh0YztCd/build/work/out/linux_amd64/release/istio-sidecar.deb
fpm -s dir -t deb -n istio-sidecar -p /tmp/tmp.nkBh0YztCd/build/work/out/linux_amd64/release/istio-sidecar.deb --version 0.0.1releasebuilder.73a263a -C /tmp/tmp.nkBh0YztCd/build/work -f \
        --url http://istio.io  \
        --license Apache \
        --vendor istio.io \
        --maintainer istio@istio.io \
        --after-install tools/packaging/deb/postinst.sh \
        --config-files /var/lib/istio/envoy/envoy_bootstrap_tmpl.json \
        --config-files /var/lib/istio/envoy/sidecar.env \
        --description "Istio Sidecar" \
        --depends iproute2 \
        --depends iptables \
         out/linux_amd64/release/envoy=/usr/local/bin/envoy out/linux_amd64/release/pilot-agent=/usr/local/bin/pilot-agent out/linux_amd64/release/node_agent=/usr/local/bin/node_agent out/linux_amd64/release/istio-iptables=/usr/local/bin/istio-iptables out/linux_amd64/release/istio-clean-iptables=/usr/local/bin/istio-clean-iptables src/istio.io/istio/tools/packaging/common/istio-start.sh=/usr/local/bin/istio-start.sh src/istio.io/istio/tools/packaging/common/istio-node-agent-start.sh=/usr/local/bin/istio-node-agent-start.sh src/istio.io/istio/tools/packaging/common/istio.service=/lib/systemd/system/istio.service src/istio.io/istio/tools/packaging/common/istio-auth-node-agent.service=/lib/systemd/system/istio-auth-node-agent.service src/istio.io/istio/tools/packaging/common/sidecar.env=/var/lib/istio/envoy/sidecar.env src/istio.io/istio/tools/packaging/common/envoy_bootstrap_v2.json=/var/lib/istio/envoy/envoy_bootstrap_tmpl.json
Debian packaging tools generally labels all files in /etc as config files, as mandated by policy, so fpm defaults to this behavior for deb packages. You can disable this default behavior with --deb-no-default-config-files flag {:level=>:warn}
Created package {:path=>"/tmp/tmp.nkBh0YztCd/build/work/out/linux_amd64/release/istio-sidecar.deb"}
make[1]: Leaving directory `/tmp/tmp.nkBh0YztCd/build/work/src/istio.io/istio'
2020-01-15T04:07:42.344207Z     info    Copying /tmp/tmp.nkBh0YztCd/build/work/src/istio.io/istio/out/linux_amd64/release/istio-sidecar.deb -> /tmp/tmp.nkBh0YztCd/build/out/deb/istio-sidecar.deb
Error: failed to build: failed to build Debian: failed to package istio-sidecar.deb: failed to open file /tmp/tmp.nkBh0YztCd/build/work/src/istio.io/istio/out/linux_amd64/release/istio-sidecar.deb to copy: open /tmp/tmp.nkBh0YztCd/build/work/src/istio.io/istio/out/linux_amd64/release/istio-sidecar.deb: no such file or directory
exit status 1

I’m running from within a container on my Mac and so far have found a few issues running it with the current master:

  1. I had to add an if check around copying some files during the docker phase. It may be due to the fact that the “installer” repo isn’t being built anymore, but haven’t verified.
  2. I had to fix a few other MacOS issues in istio/istio.
  3. I’m currently hitting the same error now with the copy of the Istio-sidecar.deb: In my case I see the actual file is (relative to the /work directory):
find . -name istio-sidecar.deb*
./out/linux_amd64/release/istio-sidecar.deb

The output shows trying to pull from the RepoOutDir:

2020-01-17T22:04:44.548892Z	info	Copying /tmp/tmp.sKEvsL10Mq/build/work/src/istio.io/istio/out/linux_amd64/release/istio-sidecar.deb -> /tmp/tmp.sKEvsL10Mq/build/out/deb/istio-sidecar.deb
Error: failed to build: failed to build Debian: failed to package istio-sidecar.deb: failed to open file /tmp/tmp.sKEvsL10Mq/build/work/src/istio.io/istio/out/linux_amd64/release/istio-sidecar.deb to copy: open /tmp/tmp.sKEvsL10Mq/build/work/src/istio.io/istio/out/linux_amd64/release/istio-sidecar.deb: no such file or directory
exit status 1

I am continuing to peel this and see where it goes and plan to submit a PR when done.

Issue created here: https://github.com/istio/istio/issues/20330