openscad-playground
openscad-playground copied to clipboard
WASM version in makefile 404s
When attempting to run make public the following error message is produced:
mkdir -p libs/openscad-wasm
wget https://files.openscad.org/snapshots/OpenSCAD-2023.03.22.wasm14181-WebAssembly.zip -O libs/openscad-wasm.zip
--2023-07-02 09:32:33-- https://files.openscad.org/snapshots/OpenSCAD-2023.03.22.wasm14181-WebAssembly.zip
Resolving files.openscad.org (files.openscad.org)... 104.236.249.91
Connecting to files.openscad.org (files.openscad.org)|104.236.249.91|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2023-07-02 09:32:34 ERROR 404: Not Found.
I think make attempts to get https://files.openscad.org/snapshots/OpenSCAD-2023.03.22.wasm14181-WebAssembly.zip which is no longer available in https://files.openscad.org/snapshots/.
I was able to alter the make file to a newer similar file and get it to complete, but the web app doesn't function properly, so once I run down that they are not related, I'm glad to contribute a fix.
I've updated the path to a file that is not auto-cleaned. Also I needed to force bash as extended syntax is used.
It looks like the public folder has a openscad.wasm checked in, so maybe that's also a good starting point.
Thanks! I'll poke around with this!
Make issue seems to be resolved.
Seems like the openscad.wasm file be in .gitignore? Every time someone does a make public it updates the file and it'll get checked in all the time.
Hmm, good question. I'm not sure about the original intention. @ochafik what do you think?
Sorry I've been.. absent :-D
I've just removed (in https://github.com/openscad/openscad-playground/pull/26) the public/openscad.{js,wasm} which were gitignored but erroneously checked in.
Hmm, the snapshot folder is cleaned up automatically, so I guess we need to find some way of tagging the referenced version. Last time I just copied the latest build to the playground folder manually but something automatic would be good. I suppose a minimal way preventing future 404 would be blocking the referenced file from being cleaned up on the file server.
@t-paul The easiest way to get the last version would be this Python snippet:
# pip install bs4 requests
from bs4 import BeautifulSoup
import sys
import requests
url = "https://openscad.org/downloads.html"
try:
soup = BeautifulSoup(requests.get(url).content, "html.parser")
print(soup.find(id="WASM_SNAPSHOT_URL")["href"])
except Exception as e:
sys.stderr.write(f"WASM Snapshot URL not found on {url}: {e}.\n")
exit(1)
I think it's time to setup some github workflow (will try and take a stab at it in a few days), which could ultimately auto deploy the playground to https://github.com/openscad/openscad.github.com
I started creating some base images on https://ci.openscad.org/ but that's currently a bit stuck. So a github action would be also a nice option.
Hmm, good point, using always the latest version would work too. As that page is populated from https://files.openscad.org/snapshots/.snapshot_wasm.js it might be even easier to parse that :-).
But as the file is generated by a python script anyway, that could just symlink the latest version to a stable name.
I started creating some base images on https://ci.openscad.org/ but that's currently a bit stuck. So a github action would be also a nice option.
@t-paul Pretty slick! What's running this?
Hmm, good point, using always the latest version would work too. As that page is populated from https://files.openscad.org/snapshots/.snapshot_wasm.js it might be even easier to parse that :-).
Yay, thanks!
And actually my code above wasn't working, since the link is populated dynamically it needs selenium as follows:
# pip install selenium
# brew install chromedriver
# # brew install --cask google-chrome
from selenium import webdriver
from selenium.webdriver.common.by import By
driver = webdriver.Chrome()
try:
driver.get("https://openscad.org/downloads.html")
print(driver.find_element(By.ID, "WASM_SNAPSHOT_URL").get_attribute("href"))
finally:
driver.quit()
Wow, they really don't advertise the program name :grinning:. It's a https://concourse-ci.org/ instance running on our file server (pipelines in https://github.com/openscad/openscad-ci).
Closing this as currently should be fine. Version pinned needs to be switched back to the latest CI build, once https://github.com/openscad/openscad/pull/5531 is merged and the ci wasm builds gets unstuck.
(also, it's now easy to build your own wasm w/ make wasm, see main readme)