ISSUE created form my initial post
and the suggestion of @m_m
Since I think a have a reliable network (download via browser works, no issue on other places).
To get some more insights I debugged the particle.particle-vscode-core-1.0.0-alpha.3 extensions with code. I see that it is the checksum check inside DependencyManager.downloadDependency
that always fails
if (hash !== dependency.sha256){
// TODO (mirande): delete file?
throw new Error('file hashes do not match!');
}
I then added a log output to this
if (hash !== dependency.sha256){
// TODO (mirande): delete file?
console.log(`**-> hashes do not match exp=${dependency.sha256} != act=${hash}`, dependency);
throw new Error('file hashes do not match!');
}
And actually see that the hash
of the file is each time different! I also see that the tmpFile
in the filesystem, have a different size each time and always smaller than the size of the original file.
I then added another log output to the reportDependencyProgress
function reportDependencyProgress(status){
let msgMap = {};
return (dependency, progress) => {
msgMap[dependency.id] = `${progress.percentage.toFixed(2)}%`;
const text = Object.keys(msgMap).sort().map(key => `${key}: ${msgMap[key]}`);
status.text = text.join(' | ');
console.log("**-> ", status.text);
status.show();
};
}
When I now run the install I see that the gcc-arm % increases at a steady speed but somewhere around 60% (always a bit at a different %) suddenly jumps to 100%.
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 55.91%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 56.16%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 56.43%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 56.70%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 56.96%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 57.22%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 57.49%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 57.75%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 58.01%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 58.28%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 58.54%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 58.81%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 59.08%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 59.34%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 59.58%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 59.61%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 60.66%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 60.94%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 61.20%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 61.46%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 61.73%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 61.99%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 62.06%
**-> buildscripts@1.0.0: 100.00% | buildtools@1.0.0: 100.00% | deviceOS@0.7.0: 100.00% | gcc-arm@5.3.1: 100.00%
**-> hashes do not match exp=f41f32436188c3017422635b187378c8bf0938a3ad396506b2d3b8ce1fb402c9 != act=e776b5f41304ff2bee9883ff131b0b8809abd7c31e8e50e36b1e45113809d193
undefined
Object
id
"gcc-arm@5.3.1"
name
"gcc-arm"
version
"5.3.1"
main
"./bin"
url
"https://binaries.particle.io/gcc-arm/darwin/x64/gcc-arm-v5.3.1.tar.gz"
sha256
"f41f32436188c3017422635b187378c8bf0938a3ad396506b2d3b8ce1fb402c9"
root
"/Users/bittailor/.particle/toolchains/gcc-arm/5.3.1"
dir
"/Users/bittailor/.particle/toolchains/gcc-arm/5.3.1/bin"
So I think somehow the download stops before the whole file is downloaded and then of course the checksum/hash does not match.
I tried to understand the downloading logic. I saw that it is mainly a node source stream that is piped into a file stream but was not yet able to grasp all the additional logic of trackProgressMaybe
and why a pipe
could finish too early without emitting and error
srcStream.on('error', err => reject(err));
destStream.on('error', err => reject(err));
destStream.on('finish', () => resolve({ filename: destination }));
trackProgressMaybe(srcStream, onProgress, interval, size).pipe(destStream);
Supporting information
- VSCode Version: 1.27.2 (1.27.2)
- OS Version: macOS Sierra 10.12.6 (16G1510)
- Other extensions installed: many (39)
Steps to Reproduce:
- Press
install
on thePlease install the Particle Local Compiler