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

Add ambient #626

Closed
wants to merge 2 commits into from
Closed

Add ambient #626

wants to merge 2 commits into from

Conversation

FredrikNoren
Copy link

Hi,

We're building an open source game engine, called Ambient. Would be great to be able to install it with webi!

See https://github.com/ambientrun/ambient for more details about Ambient

@coolaj86
Copy link
Member

coolaj86 commented Jul 3, 2023

Hey @FredrikNoren, I'm just checking this out today.

Two things:

1. Cheat Sheet

A lot of the value of webi is having a Quick Start and a Cheat Sheet. Can you get some feedback from your users and try to get an idea of what kinds of things the person who installs this on a new machine (or for the first time) needs a quick refresher on and update the README.md?

2. Just Works™ Builds

Ideally things that install with webi should Just Work™ anywhere without extra dependencies. There are a few exceptions that we've allowed for this, such as bat on Windows and pyenv, which have instructions for how to install on Windows or packages to install on Linux.

It makes sense that part of this can't run headless (because game engine, duh), but even the CLI isn't working for me.

Ubuntu Linux

On Linux I get an error about libasound.so.2 not being found (which makes sense for a GUI, but not a CLI):

/home/app/.local/opt/ambient-v0.2.1/bin/ambient: error while loading shared libraries: libasound.so.2: cannot open shared object file: No such file or directory

Windows 10

On Windows I get an error message about

Unsupported 16-bit Application

... incompatibility with 64-bit versions of Windows. Please contact the software vendor...

even though the install package is ambient-x86-64-pc-windows-msvc.zip.

Can you get this so that the CLI will work headless, or that at least the instructions for installing the dependencies are clear?

macOS

I didn't try it on macOS because I don't have a VM readily available for testing.

@coolaj86
Copy link
Member

coolaj86 commented Jul 3, 2023

Also, this is up on https://next.webinstall.dev/ambient, so you can test it out yourself and see how the install actually works.

@coolaj86
Copy link
Member

coolaj86 commented Jul 4, 2023

@coolaj86
Copy link
Member

@FredrikNoren Thoughts?

@FredrikNoren
Copy link
Author

@coolaj86 Thanks for your comments! Sorry for a slow reply, I've been on vacation. I can't seem to get the next.webinstall.dev to work though, it's giving me:

➜  /Users/fredrik/github/DeadMeetsLeadContent/create_pipelines git:(dims) curl -sS https://next.webi.sh/ambient | sh
curl: (6) Could not resolve host: next.webi.sh

@coolaj86
Copy link
Member

@FredrikNoren Sorry, didn't see your message until just now. Try https://next.webinstall.dev/ instead of https://next.webi.sh. I think there's a DNS issue I'll have to delete and re-add the record for the .sh.

@FredrikNoren
Copy link
Author

@coolaj86 Thanks! I was able to test on OSX which seems to work great with that. On windows I'm getting a dns error though:

PS C:\Users\fredr> curl.exe https://next.webinstall.ms/ambient | powershell
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: next.webinstall.ms
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\fredr>
PS C:\Users\fredr> curl.exe https://next.webi.ms/ambient | powershell
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: next.webi.ms
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

I also tried next.webinstall.dev but that downloaded the bash script which didn't work of course.

@FredrikNoren
Copy link
Author

@coolaj86 Anything I can do to fix the DNS issue above? The executable should work on windows (it's definitely not a 16-bit application hehe), so figuring there's something wrong with the download.

Also re-linux: I added libasound.so.2 as a requirement in the readme for the PR. Ambient is both a cli and full-featured engine, so we can't really get around needing it (you can run ambient run to start a game, which will open a window and it may have audio in it).

@coolaj86
Copy link
Member

coolaj86 commented Aug 3, 2023

@FredrikNoren https://next.webinstall.dev/ is the generic url, but requires -A MS on Windows because curl.exe doesn't have a Windows user agent.

curl.exe -A MS https://next.webinstall.dev/ambient | powershell

You can see the releases here:
https://next.webinstall.dev/api/releases/ambient.json?pretty=true

@coolaj86
Copy link
Member

coolaj86 commented Aug 3, 2023

I've also fixed the next.webi.ms DNS service config, but it'll take about an hour for the change to propagate.

Since .ms is not a generally available TLD I have to use a domain registrar that... kinda sucks - they don't even let me set TTL.

@FredrikNoren
Copy link
Author

@coolaj86 Hm still no luck:

curl.exe -A MS https://next.webinstall.dev/ambient | powershell

gives me:

PS C:\Users\fredr> curl.exe -A MS https://next.webinstall.dev/ambient | powershell
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   819    0   819    0     0   1512      0 --:--:-- --:--:-- --:--:--  1516
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\fredr> # Download the latest webi, then install ambient
PS C:\Users\fredr> # <pre>
PS C:\Users\fredr> ############################################################
PS C:\Users\fredr> # <h1>Cheat Sheet at https://next.webinstall.dev/ambient</h1>
PS C:\Users\fredr> # <meta http-equiv="refresh" content="3; URL='https://next.webinstall.dev/ambient'" />
PS C:\Users\fredr> ############################################################
PS C:\Users\fredr> New-Item -Path "$Env:USERPROFILE\Downloads\webi" -ItemType Directory -Force | out-null
PS C:\Users\fredr> New-Item -Path "$Env:USERPROFILE\.local\bin" -ItemType Directory -Force | out-null
PS C:\Users\fredr> IF ($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "http://next.webinstall.dev"}
PS C:\Users\fredr> curl.exe -s -A "windows" "$Env:WEBI_HOST/packages/_webi/webi-pwsh.ps1" -o "$Env:USERPROFILE\.local\bin\webi-pwsh.ps1"
PS C:\Users\fredr> Set-ExecutionPolicy -Scope Process Bypass
PS C:\Users\fredr> & "$Env:USERPROFILE\.local\bin\webi-pwsh.ps1" "ambient"
PS C:\Users\fredr>
PS C:\Users\fredr>

and curl.exe -A MS https://next.webi.ms/ambient | powershell gives me:

PS C:\Users\fredr> curl.exe -A MS https://next.webi.ms/ambient | powershell
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (35) schannel: next InitializeSecurityContext failed: SEC_E_INVALID_TOKEN (0x80090308) - The token supplied to the function is invalid
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\fredr>

@coolaj86
Copy link
Member

coolaj86 commented Aug 5, 2023

For now just use curl.exe -A MS https://next.webinstall.dev/ambient | powershell.

Ignore everything about the next.webi.sh or next.webi.ms domains. Those are purely experimental.

@coolaj86
Copy link
Member

coolaj86 commented Aug 5, 2023

Oh, I see you did use that one first. Did you try just once or multiple times?

If it's just hanging at the Terminal without finishing, that's a long-standing bug in cmd.exe from the Windows 3.11 / Windows 95 transition (not joking, confirmed with a Microsoft employee). All you have to do is hit the enter key (or try again) and it will continue after a few seconds.

I'll try again tomorrow and see what happens for me.

@FredrikNoren
Copy link
Author

@coolaj86 I tried installing deno just to make sure it works to install anything for me, and that works fine. The output starts out similar (echoing a bunch of commands), but it just seems like the ambient one isn't executing those commands? There's no place where it's blocking or anything, so nowhere I can press enter to continue.

@coolaj86
Copy link
Member

@FredrikNoren I started looking at this again today.

  • Windows x86_64: same error as before
  • macOS M1: seems to work
    • must webi rustlang first
    • must also rustup target add --toolchain stable wasm32-wasi (is that intentional?)
  • Linux: not sure due to libasound.so.2, but I'm guessing it works

When it blocks on Windows there's no prompt, you just press enter in the cmd.exe window (it's a bug with signal handling while something else is going on, like a download). It's a random thing. It shouldn't happen every time, just 1 in 10 or so.

@coolaj86
Copy link
Member

Also @FredrikNoren, will you give me maintainer edit access on that branch so I can rebase it?

@coolaj86
Copy link
Member

Are you supposed to be able to do anything with the template game? Or does it just redraw the grey diamond at 120fps?

I thought maybe the arrow keys would make it move around, but no dice.

Anyway, I think we could get this in and just let Windows users report the issues with the installer to you and you'd have a better install base to figure out what's going on there.

I would like a little more to the Cheat Sheet though. I don't know what would make sense, but just "build and run" it seems a little too bare. Maybe not.

@coolaj86
Copy link
Member

coolaj86 commented Oct 16, 2023

🥳 I just figured out what was wrong with the Windows installer.

You had copied from a package that used a bare .exe download, but this is in a .zip file, so it was simply renaming the .zip to .exe without actually unzipping it.

If we copy AtomicParsley verbatim and just find/replace ambient, it works!
(AtomicParsley is also a single binary in a single .zip that requires msvc)

cp -RPp atomicparsley/install.ps1 ambient/
sd AtomicParsley ambient ambient/install.ps1
sd atomicparsley ambient ambient/install.ps1

https://next.webinstall.dev/ambient

@FredrikNoren
Copy link
Author

@coolaj86 We switched to an install path via cargo instead (it's possible to install with cargo install ambient now), so don't think we need this any longer. (Or maybe if there's a way to make it do cargo install ambient instead it might be a good path forward?)

@coolaj86
Copy link
Member

coolaj86 commented Oct 17, 2023

It seems like you must have rustcc installed to use Ambient. Is that correct?

And only existing Rust devs use it?
(you're not bringing in new people just to use Ambient?)

If that's the case it makes sense to just use cargo.

If you want to attract new people outside of the Rust community, or you want to automate out-of-band steps - like installing the required toolchains, then Webi might still be a good fit.

@ErichDonGubler
Copy link

@FredrikNoren:

@coolaj86 We switched to an install path via cargo instead (it's possible to install with cargo install ambient now), so don't think we need this any longer. (Or maybe if there's a way to make it do cargo install ambient instead it might be a good path forward?)

You might also be interested in cargo-binstall, which is easy to support.

@coolaj86
Copy link
Member

Closing because it sounds like this is something that Rust devs would probably prefer to install via Cargo and I don't think there's anything in particular that that Webi has to add to that experience.

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

Successfully merging this pull request may close these issues.

3 participants