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

WASM version in makefile 404s #2

Open
stockholmux opened this issue Jul 2, 2023 · 10 comments
Open

WASM version in makefile 404s #2

stockholmux opened this issue Jul 2, 2023 · 10 comments

Comments

@stockholmux
Copy link
Contributor

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.

@t-paul
Copy link
Member

t-paul commented Jul 2, 2023

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.

@stockholmux
Copy link
Contributor Author

Thanks! I'll poke around with this!

@stockholmux
Copy link
Contributor Author

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.

@t-paul
Copy link
Member

t-paul commented Jul 2, 2023

Hmm, good question. I'm not sure about the original intention. @ochafik what do you think?

@ochafik
Copy link
Collaborator

ochafik commented May 30, 2024

Sorry I've been.. absent :-D

I've just removed (in #26) the public/openscad.{js,wasm} which were gitignored but erroneously checked in.

@t-paul
Copy link
Member

t-paul commented May 30, 2024

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.

@ochafik
Copy link
Collaborator

ochafik commented May 31, 2024

@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

@t-paul
Copy link
Member

t-paul commented May 31, 2024

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.

@ochafik
Copy link
Collaborator

ochafik commented May 31, 2024

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()

@t-paul
Copy link
Member

t-paul commented May 31, 2024

Wow, they really don't advertise the program name 😀. It's a https://concourse-ci.org/ instance running on our file server (pipelines in https://github.com/openscad/openscad-ci).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants