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

update_boot_image does not cover non-master branches / edge cases well #6

Open
catb0t opened this issue May 3, 2019 · 0 comments
Open
Assignees
Labels
bug Something isn't working
Milestone

Comments

@catb0t
Copy link
Owner

catb0t commented May 3, 2019

the hot path for update_boot_image / _get_boot_image is when branch is master and there's an internet connection. the following output, from a different branch, demonstrates how useless it currently is

its logic needs to be entirely overhauled

** GET http://downloads.factorcode.org/images/reproducible-vm/checksums.txt ==> 404 Not Found
** GET http://downloads.factorcode.org/images/master/checksums.txt ==> 200 OK
update_boot_image: boot image sums: 380a22ac3b325b5675e7aecae99fa7f0 / 03fbcb9aa339ca129577a689544e3aaf
	update_boot_image: !!! local / remote checksum mismatch !!! 
_get_boot_image: Downloading boot image file boot.unix-x86.64.image
** GET http://downloads.factorcode.org/images/master/boot.unix-x86.64.image ==> 200 OK (1s)
** GET http://downloads.factorcode.org/images/master/checksums.txt ==> 200 OK
_get_boot_image: boot image sums: 380a22ac3b325b5675e7aecae99fa7f0 / 380a22ac3b325b5675e7aecae99fa7f0

-> _get_boot_image {
const File boot_image_file = BuildSh.generate_make_targets(){:boot_image}
say (__METHOD_NAME__ + ': Downloading boot image file ' + boot_image_file)
const boot_image_urls = BuildSh.boot_image_urls
const boot_image_data = BuildSh.make_http_request( boot_image_urls{:boot_image_url} )
const local_md5 = boot_image_data.md5
const remote_checksum_data = BuildSh.make_http_request( boot_image_urls{:checksum} )
if (! remote_checksum_data) {
say "#{__METHOD_NAME__}: Can't download, can't checksum"
return false
}
const remote_md5 = BuildSh._process_checksums_file(remote_checksum_data, boot_image_file)
say "#{__METHOD_NAME__}: boot image sums: #{remote_md5} / #{local_md5}"
if (remote_md5 != local_md5) { die "#{__METHOD_NAME__}: !!! downloaded checksum mismatch !!! (unrecoverable)" }
boot_image_file.touch.cleave(
{ .binmode },
{ .spurt( boot_image_data ) }
)
}

@catb0t catb0t self-assigned this Oct 5, 2019
@catb0t catb0t added this to the 0.3 milestone Oct 5, 2019
@catb0t catb0t added the bug Something isn't working label Oct 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant