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

target x86_64-unknown-linux-musl #49

Open
hayd opened this issue Dec 8, 2019 · 6 comments
Open

target x86_64-unknown-linux-musl #49

hayd opened this issue Dec 8, 2019 · 6 comments

Comments

@hayd
Copy link
Contributor

hayd commented Dec 8, 2019

It would be great to build/publish this as a target (for alpine and other platforms without glibc, iiuc).

It already seems to build okay (--target x86_64-unknown-linux-musl).
(see also denoland/deno#3711 (comment))

It's unclear to me if it's best to only target x86_64-unknown-linux-musl or to additionally support it. e.g. sccache seems to only provide binaries for that target.

@kesor
Copy link

kesor commented May 9, 2020

If anyone is interested, I have compiled DENO with V8 in Alpine Linux Docker container - without glibc, but completely using the Alpine muslc library.

https://gist.github.com/kesor/68df53a5d76784a235ca6b0e7efed4d9

Enjoy!

@theoparis
Copy link

Any updates on this? It's been 2 years ... I need musl support in order to embed deno into my linux kernel-based system because it needs to be linked statically with no /lib/*.so dependencies.

@kitsonk
Copy link

kitsonk commented Jan 27, 2022

Just because something is open doesn't mean that a) it is being actively worked on or b) set any expectations about it being closed, especially when it comes to open source software.

I am sure a contribution in this area would be welcome.

cd-work added a commit to cd-work/rusty_v8 that referenced this issue Jun 4, 2022
This adds x86_64-unknown-linux-musl as a new supported target for the
pre-built rusty_v8 library releases, which should avoid multiple
downstream consumers having to build this themselves.

This target is useful when trying to build statically-compiled
executables, which seems like a good thing to support for the purpose of
using deno_core as an embedded JavaScript runtime.

Closes denoland#49.
@localhosted
Copy link

I'm trying to build a static Edge Runtime but I'm new to Rust. Where could I start to attempt to build deno statically?

@groboclown
Copy link

I'm attempting to work my way through what it takes to build on musl. Part of this comes from having issues just getting the static build to work, regardless of musl or glibc.

My current approach runs the build inside a container to ensure it's reproducible. For those playing the home game, I'm running off the base image docker.io/rust:latest, which builds off an Ubuntu distro.

I start off easy:

$ apt-get update && apt-get install -y musl-tools musl-dev libclang-dev clang
$ rustup target add x86_64-unknown-linux-musl
$ cd /tmp
$ cargo init v8test
$ cd v8test
$ cargo add v8
$ rustup component add rustfmt
$ V8_FROM_SOURCE=1 cargo build --target x86_64-unknown-linux-musl --release -vv
(snip)
  --- stderr
  ninja: error: '../../../../../../usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/v8-0.106.0/third_party/icu/common/icudtl.dat', needed by 'icudtl.dat', missing and no known rule to make it

This is the old error reported in other issues. I use an ugly work-around to get past it: I replace the Rust cache version of the v8 repository (which explicitly omits items) with the full Git version:

$ v8_src="$( readlink -f /usr/local/cargo/registry/src/index.crates.io-*/v8-0.106.0/)"
$ rm -r "${v8_src}"
$ git clone --depth 1 -j8 --recurse-submodules --branch v0.106.0 https://github.com/denoland/rusty_v8.git "${v8_src}"

And build again:

$ V8_FROM_SOURCE=1 cargo build --target x86_64-unknown-linux-musl --release -vv

This time it works. Notice that there were many additional dependencies necessary to get this to build, but it does work.

@devsnek
Copy link
Member

devsnek commented Sep 24, 2024

The icudtl.dat issue will be fixed when we merge v8 13.0, but that is blocked on another issue not yet fixed in upstream.

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