denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
95.86k stars 5.3k forks source link

OpenBSD build #8012

Closed elmarsto closed 5 months ago

elmarsto commented 3 years ago

Is anyone else working on OpenBSD support?

Basically I need to get deno building on OpenBSD and I'm willing to do the work.

Have already put a trivial PR out on rust-openssl to support openbsd.

Via coaxing, tweaking, and some patchlines in the Cargo.toml, I managed to get deno as far as building v8, which falls over because gn is not available, and building gn from source falls over.

BUT! I recalled that gn is built in /usr/ports/www/chromium, so I'm currently building chromium locally and then borrowing gn. :)

This is obviously suboptimal, but I'm making steady progress. This is important to me for Reasons.

If anyone else has a leg up (or more familiarity with Rust) I'd be relieved, but if not, I will continue my pursuits!

elmarsto commented 3 years ago

One thing that would be super helpful: Is there an easy way to simply use OpenBSD's port of chromium to supply v8? Like, I'm imagining skipping compilation of v8 and just using the one supplied by the OS.

elmarsto commented 3 years ago

How could I determine, aside from trial and error, ;), if this idea is sound? Is there a known minimum supported v8 version?

miraculli commented 3 years ago

I also tried to get demo complied on OpenBSD 6.9. I face a different problem than OP but want to reuse this issue:

ud$ rustc -V rustc 1.51.0 ud$ cargo -V cargo 1.51.0 ud$ uname -a
OpenBSD ud.openbsd.amsterdam 6.9 GENERIC#4 amd64 ud$ cargo install deno --locked Updating crates.io index Installing deno v1.13.0 Compiling libc v0.2.99 Compiling proc-macro2 v1.0.28 Compiling unicode-xid v0.2.2 Compiling syn v1.0.65 Compiling autocfg v1.0.1 Compiling serde_derive v1.0.127 Compiling serde v1.0.127 Compiling log v0.4.14 Compiling memchr v2.4.0 Compiling cfg-if v1.0.0 Compiling bitflags v1.2.1 Compiling proc-macro-hack v0.5.19 Compiling ryu v1.0.5 Compiling version_check v0.9.3 Compiling futures-core v0.3.16 Compiling spin v0.5.2 Compiling serde_json v1.0.66 Compiling once_cell v1.8.0 Compiling futures-task v0.3.16 Compiling futures-channel v0.3.16 Compiling proc-macro-nested v0.1.7 Compiling libm v0.2.1 Compiling ahash v0.4.7 Compiling smallvec v1.6.1 Compiling itoa v0.4.7 Compiling matches v0.1.8 Compiling tinyvec_macros v0.1.0 Compiling percent-encoding v2.1.0 Compiling typenum v1.13.0 Compiling ppv-lite86 v0.2.10 Compiling either v1.6.1 Compiling anyhow v1.0.42 Compiling fnv v1.0.7 Compiling pin-project-lite v0.2.7 Compiling scopeguard v1.1.0 Compiling byteorder v1.4.3 Compiling futures-sink v0.3.16 Compiling getrandom v0.1.16 Compiling unicode-width v0.1.8 Compiling bytes v1.0.1 Compiling slab v0.4.4 Compiling pin-utils v0.1.0 Compiling futures-io v0.3.16 Compiling httparse v1.4.1 Compiling siphasher v0.3.6 Compiling regex-syntax v0.6.25 Compiling encoding_rs v0.8.28 Compiling base64 v0.13.0 Compiling ident_case v1.0.1 Compiling crc32fast v1.2.1 Compiling strsim v0.9.3 Compiling async-trait v0.1.51 Compiling precomputed-hash v0.1.1 Compiling new_debug_unreachable v1.0.4 Compiling drm-fourcc v2.1.1 Compiling untrusted v0.7.1 Compiling stable_deref_trait v1.2.0 Compiling if_chain v1.0.1 Compiling base64 v0.11.0 Compiling cfg-if v0.1.10 Compiling scoped-tls v1.0.0 Compiling lexical-core v0.7.6 Compiling static_assertions v1.1.0 Compiling cpufeatures v0.1.5 Compiling opaque-debug v0.3.0 Compiling unicode-segmentation v1.8.0 Compiling alloc-no-stdlib v2.0.3 Compiling khronos-egl v4.1.0 Compiling try-lock v0.2.3 Compiling proc-macro2 v0.4.30 Compiling autocfg v0.1.7 Compiling adler v1.0.2 Compiling make-cmd v0.1.0 Compiling pkg-config v0.3.19 Compiling fixedbitset v0.2.0 Compiling unicode-xid v0.1.0 Compiling termcolor v1.1.2 Compiling ipnet v2.3.1 Compiling bit-vec v0.6.3 Compiling tower-service v0.3.1 Compiling httpdate v1.0.1 Compiling subtle v2.4.1 Compiling cfg_aliases v0.1.1 Compiling syn v0.15.44 Compiling openssl-probe v0.1.4 Compiling const-oid v0.6.0 Compiling mime v0.3.16 Compiling match_cfg v0.1.0 Compiling utf-8 v0.7.6 Compiling renderdoc-sys v0.7.1 Compiling retain_mut v0.1.3 Compiling linked-hash-map v0.5.4 Compiling inplace_it v0.3.3 Compiling glow v0.9.0 Compiling quick-error v1.2.3 Compiling data-encoding v2.3.2 Compiling fallible-iterator v0.2.0 Compiling fallible-streaming-iterator v0.1.9 Compiling abort_on_panic v2.0.0 Compiling profiling v1.0.3 Compiling copyless v0.1.5 Compiling bumpalo v3.7.0 Compiling crossbeam-utils v0.8.5 Compiling build_const v0.2.2 Compiling pulldown-cmark v0.8.0 Compiling same-file v1.0.6 Compiling convert_case v0.4.0 Compiling unchecked-index v0.2.2 Compiling swc_bundler v0.50.0 Compiling ucd-trie v0.1.3 Compiling endian-type v0.1.2 Compiling humantime v2.1.0 Compiling relative-path v1.5.0 Compiling utf8parse v0.2.0 Compiling ansi_term v0.11.0 Compiling strsim v0.8.0 Compiling remove_dir_all v0.5.3 Compiling radix_fmt v1.0.0 Compiling vec_map v0.8.2 Compiling text-size v1.1.0 Compiling shell-escape v0.1.5 Compiling dissimilar v1.0.2 Compiling indexmap v1.6.2 Compiling futures-util v0.3.16 Compiling futures-macro v0.3.16 Compiling num-traits v0.2.14 Compiling tokio v1.9.0 Compiling num-integer v0.1.44 Compiling miniz_oxide v0.4.4 Compiling num-bigint v0.2.6 Compiling num-iter v0.1.42 Compiling instant v0.1.10 Compiling libloading v0.7.0 Compiling generic-array v0.14.4 Compiling ahash v0.7.4 Compiling proc-macro-error-attr v1.0.4 Compiling unicase v2.6.0 Compiling proc-macro-error v1.0.4 Compiling lazy_static v1.4.0 Compiling thread_local v1.1.3 Compiling hashbrown v0.9.1 Compiling nibble_vec v0.1.0 Compiling unicode-bidi v0.3.5 Compiling data-url v0.1.0 Compiling tinyvec v1.3.1 Compiling form_urlencoded v1.0.1 Compiling lock_api v0.4.4 Compiling fxhash v0.2.1 Compiling textwrap v0.11.0 Compiling input_buffer v0.4.0 Compiling http v0.2.4 Compiling phf_shared v0.8.0 Compiling owning_ref v0.4.1 Compiling heck v0.3.3 Compiling alloc-stdlib v0.2.1 Compiling num-bigint-dig v0.7.0 Compiling deno-libffi-sys v0.0.7 Compiling codespan-reporting v0.11.1 Compiling bit-set v0.5.2 Compiling wgpu-core v0.9.2 Compiling lru-cache v0.1.2 Compiling crc v1.8.1 Compiling walkdir v2.3.2 Compiling pest v2.1.3 Compiling ash v0.32.1 Compiling tracing-core v0.1.18 Compiling radix_trie v0.2.1 Compiling unicode-normalization v0.1.19 Compiling http-body v0.4.3 Compiling brotli-decompressor v2.3.2 error: failed to compile deno v1.13.0, intermediate artifacts can be found at /tmp/cargo-installOYTunu

Caused by: failed to run custom build command for deno-libffi-sys v0.0.7

Caused by: process didn't exit successfully: /tmp/cargo-installOYTunu/release/build/deno-libffi-sys-2c66c562a6b7abe6/build-script-build (exit code: 101) --- stdout checking build system type... x86_64-unknown-openbsd6.9 checking host system type... x86_64-unknown-openbsd6.9 checking target system type... x86_64-unknown-openbsd6.9 continue configure in default builddir "./x86_64-unknown-openbsd" ....exec /bin/sh ../configure "--srcdir=.." "--enable-builddir=x86_64-unknown-openbsd" "openbsd6.9" checking build system type... x86_64-unknown-openbsd6.9 checking host system type... x86_64-unknown-openbsd6.9 checking target system type... x86_64-unknown-openbsd6.9 checking for gsed... sed checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a race-free mkdir -p... ../install-sh -c -d checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether the compiler supports GNU C... yes checking whether gcc accepts -g... yes checking for gcc option to enable C11 features... unsupported checking for gcc option to enable C99 features... -std=gnu99 checking whether gcc -std=gnu99 understands -c and -o together... yes checking whether make supports the include directive... yes (GNU style) checking dependency style of gcc -std=gnu99... gcc3 checking for g++... g++ checking whether the compiler supports GNU C++... yes checking whether g++ accepts -g... yes checking for g++ option to enable C++11 features... none needed checking dependency style of g++... gcc3 checking dependency style of gcc -std=gnu99... gcc3 checking how to print strings... print -r checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by gcc -std=gnu99... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 393216 checking how to convert x86_64-unknown-openbsd6.9 file names to x86_64-unknown-openbsd6.9 format... func_convert_file_noop checking how to convert x86_64-unknown-openbsd6.9 file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... match_pattern /lib[^/]+(.so.[0-9]+.[0-9]+|.so|_pic.a)$ checking for dlltool... no checking how to associate runtime and link libraries... print -r -- checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc -std=gnu99 object... ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for mt... mt checking if mt is a manifest tool... no checking for stdio.h... yes checking for stdlib.h... yes checking for string.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for strings.h... yes checking for sys/stat.h... yes checking for sys/types.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc -std=gnu99 supports -fno-rtti -fno-exceptions... no checking for gcc -std=gnu99 option to produce PIC... -fPIC -DPIC checking if gcc -std=gnu99 PIC flag -fPIC -DPIC works... yes checking if gcc -std=gnu99 static flag -static works... yes checking if gcc -std=gnu99 supports -c -o file.o... yes checking if gcc -std=gnu99 supports -c -o file.o... (cached) yes checking whether the gcc -std=gnu99 linker (/usr/bin/ld) supports shared libraries... yes checking whether -lc should be explicitly linked in... yes checking dynamic linker characteristics... openbsd6.9 ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking how to run the C++ preprocessor... g++ -E checking for ld used by g++... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... openbsd6.9 ld.so checking how to hardcode library paths into programs... immediate checking for readelf... readelf checking size of size_t... 8 checking for C compiler vendor... gnu checking whether C compiler accepts -fstrict-aliasing... yes checking whether C compiler accepts -ffast-math... yes checking for gcc architecture flag... checking for x86 cpuid 0 output... 15:756e6547:6c65746e:49656e69 checking for x86 cpuid 1 output... 206d7:800:9e982203:79ba97f checking whether C compiler accepts -march=sandybridge... no checking whether C compiler accepts -march=corei7-avx... no checking whether C compiler accepts -march=corei7... no checking whether C compiler accepts -march=core2... no checking whether C compiler accepts -march=pentium-m... no checking whether C compiler accepts -march=pentium3... no checking whether C compiler accepts -march=pentiumpro... no checking whether C compiler accepts -mcpu=sandybridge... no checking whether C compiler accepts -mcpu=corei7-avx... no checking whether C compiler accepts -mcpu=corei7... no checking whether C compiler accepts -mcpu=core2... no checking whether C compiler accepts -mcpu=pentium-m... no checking whether C compiler accepts -mcpu=pentium3... no checking whether C compiler accepts -mcpu=pentiumpro... no checking whether C compiler accepts -msandybridge... no checking whether C compiler accepts -mcorei7-avx... no checking whether C compiler accepts -mcorei7... no checking whether C compiler accepts -mcore2... no checking whether C compiler accepts -mpentium-m... no checking whether C compiler accepts -mpentium3... no checking whether C compiler accepts -mpentiumpro... no checking for gcc architecture flag... unknown checking whether C compiler accepts -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math... yes checking CFLAGS for maximum warnings... -Wall checking whether to enable maintainer-specific portions of Makefiles... no checking for sys/memfd.h... no checking for memfd_create... no checking for sys/mman.h... yes checking for mmap... yes checking for mkostemp... yes checking for mkstemp... yes checking for sys/mman.h... (cached) yes checking for mmap... (cached) yes checking whether read-only mmap of a plain file works... yes checking whether mmap from /dev/zero works... yes checking for MAP_ANON(YMOUS)... yes checking whether mmap with MAP_ANON(YMOUS) works... yes checking for egrep... (cached) /usr/bin/grep -E checking for memcpy... yes checking for sizet... yes checking for working alloca.h... no checking for alloca... yes checking size of double... 8 checking size of long double... 16 checking whether byte ordering is bigendian... no checking assembler .cfi pseudo-op support... yes checking assembler supports pc related relocs... yes checking whether compiler supports pointer authentication... no checking for prefix in compiled symbols... no checking toolchain supports unwind section type... yes checking whether C compiler accepts -fno-lto... no checking whether .eh_frame section should be read-only... yes checking for attribute((visibility("hidden")))... yes checking for ld used by gcc -std=gnu99... (cached) /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... (cached) no configure: versioning on shared library symbols is no checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating include/Makefile config.status: creating include/ffi.h config.status: creating Makefile config.status: creating testsuite/Makefile config.status: creating man/Makefile config.status: creating doc/Makefile config.status: creating libffi.pc config.status: creating fficonfig.h config.status: executing buildir commands config.status: create top_srcdir/Makefile guessed from local Makefile config.status: build in x86_64-unknown-openbsd (HOST=x86_64-unknown-openbsd) config.status: executing depfiles commands config.status: executing libtool commands config.status: executing include commands config.status: executing src commands

--- stderr thread 'main' panicked at 'Building libffi: Os { code: 2, kind: NotFound, message: "No such file or directory" }', /home/mirac/.cargo/registry/src/github.com-1ecc6299db9ec823/deno-libffi-sys-0.0.7/build/common.rs:8:26 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace ud$

evilsprut commented 3 years ago

@miraculli hey! This problem occurs because gmake package is not installed on your computer. Ref: https://github.com/tov/libffi-rs/issues/28 , but problem with building rusty_v8 still exists https://github.com/denoland/rusty_v8/issues/771, what did @elmarsto write about.

Until the problem is resolved, @elmarsto could you give instructions on how to use chromium from ports to build rusty_v8?

lucasfcosta commented 2 years ago

In case anyone else is facing problems with linking libffi-sys, I had to make sure ld was using the system version of it.

For that, I updated Cargo.toml within ext/ffi. It went from this:

libffi = "2.0.0"

To this:

libffi = { version = "2.0.0", features = ["system"] }

Also, make sure you've code XCode and its toolchain properly installed.

I did make sure gmake was installed, as @bukhalo suggested, but still no luck.

VlkrS commented 1 year ago

There's a port in OpenBSD -current now, so this issue might be closed.

miraculli commented 1 year ago

Great! Just installed deno as pkg. Seems to work fine.

Superpat commented 9 months ago

Getting an error trying to start a new fresh app on the latest install. The backtrace is as follows:

Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: openbsd x86_64
Version: 1.36.4
Args: ["deno", "run", "-A", "-r", "https://fresh.deno.dev"]

thread 'main' panicked at runtime/ops/os/mod.rs:66:40:
called `Result::unwrap()` on an `Err` value: Error { kind: Uncategorized, message: "no current exe available (short)" }
stack backtrace:
   0:      0x2fa55897f6d - <unknown>
   1:      0x2fa558be90b - <unknown>
   2:      0x2fa558aa9c4 - <unknown>
   3:      0x2fa55897d53 - <unknown>
   4:      0x2fa558804da - <unknown>
   5:      0x2fa558800d7 - <unknown>
   6:      0x2fa52971342 - <unknown>
   7:      0x2fa558817f4 - <unknown>
   8:      0x2fa558983b7 - <unknown>
   9:      0x2fa5589819d - <unknown>
  10:      0x2fa5588137a - <unknown>
  11:      0x2fa558d135a - <unknown>
  12:      0x2fa558cc91a - <unknown>
  13:      0x2fa533d66ad - <unknown>
  14:      0x2fa533d5feb - <unknown>
VlkrS commented 9 months ago

I will look into it. Please note that OpenBSD is not one of the platforms officially supported by the deno project. When you have problems with the OpenBSD port, it's better to send a mail to the openbsd-ports mailing list.

VlkrS commented 9 months ago

@Superpat, I just committed a fix to the -current ports tree.

Superpat commented 9 months ago

Thanks ! Currently travelling without my bsd box, but I'll try to wip up a vm and test it out when I have the time.

Le 30 décembre 2023 21 h 37 min 06 s GMT+01:00, VlkrS @.***> a écrit :

@Superpat, I just committed a fix to the -current ports tree.

-- Reply to this email directly or view it on GitHub: https://github.com/denoland/deno/issues/8012#issuecomment-1872601670 You are receiving this because you were mentioned.

Message ID: @.***>

VlkrS commented 5 months ago

@bartlomieju I suggest to close this issue. We have deno working on OpenBSD and I would rather people sent their issues with the port to the OpenBSD mailing list rather than adding them here.

bartlomieju commented 5 months ago

Sounds good, thanks for the ping!