Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

None of the commands that uses pre-built packages runs on FreeBSD #1402

Closed
Erk- opened this issue Jun 20, 2020 · 6 comments
Closed

None of the commands that uses pre-built packages runs on FreeBSD #1402

Erk- opened this issue Jun 20, 2020 · 6 comments

Comments

@Erk-
Copy link

Erk- commented Jun 20, 2020

🐛 Bug Report

The pre-built packages does not exist for FreeBSD and there is no clear way to build them yourself.
Furthermore they seem to segfaults after failing.

Environment

  • operating system: FreeBSD 12.1-RELEASE-p3 GENERIC amd64
  • output of rustc -V: rustc 1.44.1 (c7087fe00 2020-06-17)
  • output of node -v: Not installed
  • output of wrangler -V: wrangler 1.10.1
  • contents of wrangler.toml: Empty or populated with the following after using cargo-generate directly:
name = "rust"
type = "rust"

account_id = ""
workers_dev = true
route = ""
zone_id = ""

Steps to reproduce

Install wrangler: cargo install wrangler
Attempt: wrangler generate

$ wrangler generate my-app https://github.com/cloudflare/rustwasm-worker-template
  Installing cargo-generate v0.5.0...
Error: could not download `cargo-generate`
no prebuilt cargo-generate binaries are available for this platform
Segmentation fault (core dumped)

Attempt: wrangler preview

$ wrangler preview
  Installing wasm-pack v0.9.1...
Error: could not download `wasm-pack`
no prebuilt wasm-pack binaries are available for this platform

What did you expect to see?

I expected to see a way that made it possible to build the needed binaries myself.

What did you see instead?

An error that did not give a lot more information other than the operating system is not supported.
And a segfault.

@EverlastingBugstopper
Copy link
Contributor

Thanks for the report! One workaround for now is to install wasm-pack and cargo-generate on your own. If you're up to the latest version, Wrangler should just use your system version instead of downloading a new one 😄

@Erk-
Copy link
Author

Erk- commented Jun 29, 2020

That was the first I attempted, but wrangler does not appear to look for the tools outside of the wrangler cache located in ~/.cache/.wrangler/.

(12:06:52 </usr/home/erk/dev>) 0 $ cargo generate --version
cargo-generate 0.5.0
(12:07:15 </usr/home/erk/dev>) 0 $ wrangler generate
  Installing cargo-generate v0.5.0...
Error: could not download `cargo-generate`
no prebuilt cargo-generate binaries are available for this platform
Segmentation fault (core dumped)

I got it working by making a hard link with ln the binary for cargo-generate into ~/.cache/.wrangler/cargo-generate-0.5.0/cargo-generate should be noted that a symbolic link did not work and would also error out. Similarily I made a hard link for wasm-pack.

Update: the below note is no longer correct as rust-lld is not included in the build cf. rust-lang/rust#79484

Note to other users wanting to get this running on FreeBSD:
Do not use rustup to install your toolchain. As FreeBSD is a tier 2 platform rust-lld is not build in CI. This means that wasm is not supported when installed that way. Either install the rust package with pkg or build it from ports with wasm support enabled to get it working. Also wasm-pack does not seem to search PATH for wasm-opt so disable it until that is fixed.

@stale
Copy link

stale bot commented Aug 28, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Aug 28, 2020
@Erk-
Copy link
Author

Erk- commented Sep 2, 2020

This issue should probably not be marked as stale as the issue have not been fixed as far as I know.

@facklambda
Copy link

facklambda commented Sep 9, 2021

Hello all,
I'm seeing an identical issue to OP however my platform is an aarch64-unknown-linux-gnu host.

Environment

  • operating system: Debian GNU/Linux 10 (buster)
  • output of rustc -V: rustc 1.55.0 (c8dfcfe04 2021-09-06)
  • output of node -v: Not installed
  • output of wrangler -V: wrangler 1.19.2
  • contents of wrangler.toml: Empty

Workaround of symlinking the installed .cargo/bin/cargo-generate binary in to the .cache/.wrangler/cargo-generate-0.5.0/cargo-generate is sufficient to get wrangler generate to work.

My best guess is that something relating to get_installation function (maybe the get_wrangler_cache part?) in https://github.com/cloudflare/wrangler/blob/master/src/install/mod.rs isn't working. Because previous to the workaround being applied, the code was getting all the way to attempting to download a prebuilt binary for cargo-generate (despite me already having installed cargo-generate v0.5.0)

I also tried testing with the latest version of cargo-generate installed, and that resulted in the same exact error:

wrangler --verbose generate --type=rust version
⬇️   Installing cargo-generate v0.5.0...
Error: could not download `cargo-generate`
no prebuilt cargo-generate binaries are available for this platform

So regardless of cargo-generate version installed, it was unable to find it, and defaulted to attempting to install a prebuilt binary for a platform with no prebuilt binaries advertised.

@petebacondarwin
Copy link

Closing as there is a newer version of Wrangler written in node.js, which should work across all architectures that support node.js.

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

No branches or pull requests

5 participants