diff options
author | 2021-12-26 01:40:37 -0800 | |
---|---|---|
committer | 2021-12-26 01:40:37 -0800 | |
commit | 536d6ab302d537af2627f4837ec9ad0b5337dbf2 (patch) | |
tree | 48122eb3c00bd81745efb7144d6a8b2e44a6a23f | |
parent | 99446ffa8a434ae1609898de529620c91aef7f68 (diff) | |
download | bun-536d6ab302d537af2627f4837ec9ad0b5337dbf2.tar.gz bun-536d6ab302d537af2627f4837ec9ad0b5337dbf2.tar.zst bun-536d6ab302d537af2627f4837ec9ad0b5337dbf2.zip |
github actions (#91)
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update Dockerfile
* switch
* :hushed:
* Update bun.yml
* Update Dockerfile
* Update Dockerfile
* wip
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update Dockerfile
* Update Dockerfile
* Update Dockerfile
* Update Dockerfile
* Update Dockerfile
* Update Dockerfile
* Update Dockerfile
* cache is broken
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update Dockerfile
* Update Dockerfile
* Update Dockerfile
* Update bun.yml
* Update Dockerfile
* Update Dockerfile
* Update Dockerfile
* Update bun.yml
* Update Dockerfile
* Update Dockerfile
* Update bun.yml
* bust it
* Update Dockerfile
* jm
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update Dockerfile
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* wip
* Update bun.yml
* Update Dockerfile
* Update Dockerfile
* Update Makefile
* Update Dockerfile
* Update Dockerfile
* Update Dockerfile
* Update Dockerfile
* Update Dockerfile
* Update Dockerfile
* Update Dockerfile
* pass executablePath
* alright
* Update Makefile
* Update Dockerfile
* Update Dockerfile
* Update Makefile
* Update Makefile
* Update Dockerfile
* lets try that
* Update Dockerfile
* Update bun.yml
* hm
* Update Dockerfile
* Update Dockerfile
* Update Dockerfile
* not interactive
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* simplify this
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* missing
* Update Dockerfile
* Update Dockerfile
* wrong dir
* Update Dockerfile
* Update bun.yml
* Update Dockerfile
* Update Dockerfile
* Update bun.yml
* ordering
* Update Dockerfile
* Update bun.yml
* run-test file
* pass github workspace
* hm
* Update bun.yml
* copy the file
* Update run-test.sh
* Update bun.yml
* Update bun.yml
* Update bun.yml
* try this way
* Update bun.yml
* maybe?
* Update bun.yml
* maybe taht's it?
* maybe this
* cache
* up
* Update bun.yml
* Update bun.yml
* try this one i guess
* okay that might do it
* Update Dockerfile
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update chrome.json
* Update chrome.json
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* hm
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* fix caching I think
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* Update bun.yml
* maybe
* Update bun.yml
* fixup
* Update bun.yml
* Update bun.yml
* Update bun.yml
* maybe this time
* Update bun.yml
* Update Dockerfile
* random name
* ok
* explicit runner
* Update bun.yml
* Update bun.yml
* try deleting the files so the layer caching doesn't happen
* :runner:
* Update bun.yml
* Update bun.yml
* Update Dockerfile
* Update Dockerfile
* Update Dockerfile
* Dockerfile.base
* node.js
* Update bun.yml
* Update Dockerfile
* Update Dockerfile.base
* cleanup
-rw-r--r-- | .docker/chrome.json | 1539 | ||||
-rw-r--r-- | .docker/copy-bun-binary.sh | 8 | ||||
-rw-r--r-- | .docker/dockerfile-common.sh (renamed from dockerfile-common.sh) | 0 | ||||
-rw-r--r-- | .docker/run-dockerfile.sh (renamed from run-dockerfile.sh) | 0 | ||||
-rwxr-xr-x | .docker/run-test.sh | 9 | ||||
-rw-r--r-- | .docker/runner.sh | 5 | ||||
-rw-r--r-- | .github/workflows/bun.yml | 100 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Dockerfile | 415 | ||||
-rw-r--r-- | Dockerfile.base | 145 | ||||
-rw-r--r-- | Makefile | 24 | ||||
-rwxr-xr-x | bun.lockb | bin | 0 -> 7340 bytes | |||
-rw-r--r-- | integration/scripts/browser.js | 2 | ||||
-rwxr-xr-x | integration/scripts/bun.lockb | bin | 0 -> 17219 bytes | |||
-rwxr-xr-x | integration/snippets/bun.lockb | bin | 0 -> 20500 bytes | |||
-rw-r--r-- | push-docker.sh | 22 |
16 files changed, 2021 insertions, 250 deletions
diff --git a/.docker/chrome.json b/.docker/chrome.json new file mode 100644 index 000000000..6bd45b6e0 --- /dev/null +++ b/.docker/chrome.json @@ -0,0 +1,1539 @@ +{ + "defaultAction": "SCMP_ACT_ERRNO", + "syscalls": [ + { + "name": "accept", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "accept4", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "access", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "alarm", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "arch_prctl", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "bind", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "brk", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "capget", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "capset", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "chdir", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "chmod", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "chown", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "chown32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "chroot", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "clock_getres", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "clock_gettime", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "clock_nanosleep", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "clone", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "close", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "connect", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "creat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "dup", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "dup2", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "dup3", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "epoll_create", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "epoll_create1", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "epoll_ctl", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "epoll_ctl_old", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "epoll_pwait", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "epoll_wait", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "epoll_wait_old", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "eventfd", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "eventfd2", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "execve", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "execveat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "exit", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "exit_group", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "faccessat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fadvise64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fadvise64_64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fallocate", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fanotify_init", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fanotify_mark", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fchdir", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fchmod", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fchmodat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fchown", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fchown32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fchownat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fcntl", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fcntl64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fdatasync", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fgetxattr", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "flistxattr", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "flock", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fork", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fremovexattr", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fsetxattr", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fstat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fstat64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fstatat64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fstatfs", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fstatfs64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "fsync", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "ftruncate", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "ftruncate64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "futex", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "futimesat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getcpu", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getcwd", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getdents", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getdents64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getegid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getegid32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "geteuid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "geteuid32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getgid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getgid32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getgroups", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getgroups32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getitimer", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getpeername", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getpgid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getpgrp", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getpid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getppid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getpriority", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getrandom", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getresgid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getresgid32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getresuid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getresuid32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getrlimit", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "get_robust_list", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getrusage", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getsid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getsockname", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getsockopt", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "get_thread_area", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "gettid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "gettimeofday", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getuid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getuid32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "getxattr", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "inotify_add_watch", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "inotify_init", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "inotify_init1", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "inotify_rm_watch", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "io_cancel", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "ioctl", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "io_destroy", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "io_getevents", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "ioprio_get", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "ioprio_set", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "io_setup", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "io_submit", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "kill", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "lchown", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "lchown32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "lgetxattr", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "link", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "linkat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "listen", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "listxattr", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "llistxattr", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "_llseek", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "lremovexattr", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "lseek", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "lsetxattr", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "lstat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "lstat64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "madvise", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "memfd_create", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mincore", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mkdir", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mkdirat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mknod", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mknodat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mlock", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mlockall", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mmap", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mmap2", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mprotect", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mq_getsetattr", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mq_notify", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mq_open", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mq_timedreceive", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mq_timedsend", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mq_unlink", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "mremap", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "msgctl", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "msgget", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "msgrcv", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "msgsnd", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "msync", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "munlock", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "munlockall", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "munmap", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "name_to_handle_at", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "nanosleep", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "newfstatat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "_newselect", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "open", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "open_by_handle_at", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "openat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "pause", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "pipe", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "pipe2", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "poll", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "ppoll", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "prctl", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "pread64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "preadv", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "prlimit64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "pselect6", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "pwrite64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "pwritev", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "read", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "readahead", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "readlink", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "readlinkat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "readv", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "recvfrom", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "recvmmsg", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "recvmsg", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "remap_file_pages", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "removexattr", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "rename", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "renameat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "renameat2", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "rmdir", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "rt_sigaction", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "rt_sigpending", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "rt_sigprocmask", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "rt_sigqueueinfo", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "rt_sigreturn", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "rt_sigsuspend", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "rt_sigtimedwait", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "rt_tgsigqueueinfo", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sched_getaffinity", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sched_getattr", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sched_getparam", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sched_get_priority_max", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sched_get_priority_min", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sched_getscheduler", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sched_rr_get_interval", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sched_setaffinity", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sched_setattr", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sched_setparam", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sched_setscheduler", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sched_yield", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "seccomp", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "select", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "semctl", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "semget", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "semop", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "semtimedop", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sendfile", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sendfile64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sendmmsg", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sendmsg", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sendto", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setdomainname", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setfsgid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setfsgid32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setfsuid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setfsuid32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setgid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setgid32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setgroups", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setgroups32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sethostname", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setitimer", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setns", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setpgid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setpriority", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setregid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setregid32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setresgid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setresgid32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setresuid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setresuid32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setreuid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setreuid32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setrlimit", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "set_robust_list", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setsid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setsockopt", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "set_thread_area", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "set_tid_address", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setuid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setuid32", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "setxattr", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "shmat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "shmctl", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "shmdt", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "shmget", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "shutdown", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sigaltstack", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "signalfd", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "signalfd4", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "socket", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "socketpair", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "splice", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "stat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "stat64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "statfs", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "statfs64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "symlink", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "symlinkat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sync", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sync_file_range", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "syncfs", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "sysinfo", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "syslog", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "tee", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "tgkill", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "time", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "timer_create", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "timer_delete", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "timerfd_create", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "timerfd_gettime", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "timerfd_settime", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "timer_getoverrun", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "timer_gettime", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "timer_settime", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "times", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "tkill", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "truncate", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "truncate64", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "ugetrlimit", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "umask", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "uname", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "unlink", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "unlinkat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "unshare", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "utime", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "utimensat", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "utimes", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "vfork", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "vhangup", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "vmsplice", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "wait4", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "waitid", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "write", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { + "name": "writev", + "action": "SCMP_ACT_ALLOW", + "args": null + }, + { "name": "io_uring_setup", "action": "SCMP_ACT_ALLOW", "args": null }, + { "name": "io_uring_enter", "action": "SCMP_ACT_ALLOW", "args": null }, + { "name": "io_uring_register", "action": "SCMP_ACT_ALLOW", "args": null }, + { "name": "copy_file_range", "action": "SCMP_ACT_ALLOW", "args": null } + ] +} diff --git a/.docker/copy-bun-binary.sh b/.docker/copy-bun-binary.sh new file mode 100644 index 000000000..5fce2ac5b --- /dev/null +++ b/.docker/copy-bun-binary.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -euxo pipefail + +name=$(openssl rand -hex 12) +id=$(docker create --name=bun-binary-$name $CONTAINER_TAG) +docker container cp bun-binary-$name:$BUN_RELEASE_DIR bun-binary +echo -e "bun-binary-$name" diff --git a/dockerfile-common.sh b/.docker/dockerfile-common.sh index c9c1a4efa..c9c1a4efa 100644 --- a/dockerfile-common.sh +++ b/.docker/dockerfile-common.sh diff --git a/run-dockerfile.sh b/.docker/run-dockerfile.sh index df22cd2b6..df22cd2b6 100644 --- a/run-dockerfile.sh +++ b/.docker/run-dockerfile.sh diff --git a/.docker/run-test.sh b/.docker/run-test.sh new file mode 100755 index 000000000..74d901753 --- /dev/null +++ b/.docker/run-test.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -euxo pipefail + +bun install +bun install --cwd ./integration/snippets +bun install --cwd ./integration/scripts + +make $BUN_TEST_NAME diff --git a/.docker/runner.sh b/.docker/runner.sh new file mode 100644 index 000000000..837ff8566 --- /dev/null +++ b/.docker/runner.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -euxo pipefail + +docker container run --security-opt seccomp=.docker/chrome.json --env GITHUB_WORKSPACE=$GITHUB_WORKSPACE --env BUN_TEST_NAME=$BUN_TEST_NAME --ulimit memlock=-1:-1 --init --rm bun-test:latest diff --git a/.github/workflows/bun.yml b/.github/workflows/bun.yml index 2c97bd913..02fe85697 100644 --- a/.github/workflows/bun.yml +++ b/.github/workflows/bun.yml @@ -1,28 +1,108 @@ -name: CI workflow for bun +name: bun on: push: branches: [main, bun-actions] pull_request: branches: [main] +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + TEST_TAG: bun-test' + jobs: - release: - runs-on: ubuntu:20.04 + tests: + runs-on: self-hosted steps: - name: Checkout uses: actions/checkout@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + - name: Checkout submodules + run: git -c submodule."src/javascript/jsc/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j 8 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - - name: Build and push + - name: Login to Dockerhub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Pull Base Image + if: steps.cache-builds.outputs.cache-hit != 'true' + run: docker pull bunbunbunbun/bun-test-base:latest && docker pull bunbunbunbun/bun-base:latest && docker pull bunbunbunbun/bun-base-with-zig-and-webkit:latest && docker tag bun-base:latest bunbunbunbun/bun-base && docker tag bun-base-with-zig-and-webkit:latest bunbunbunbun/bun-base-with-zig-and-webkit:latest + - name: Build Release Image uses: docker/build-push-action@v2 with: context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: jarred-sumner/bun:${{steps.vars.outputs.tag}} target: release + tags: bun:${{github.sha}} + builder: ${{ steps.buildx.outputs.name }} + cache-from: type=gha + cache-to: type=gha,mode=max + load: true + - name: Build tests + uses: docker/build-push-action@v2 + with: + context: . + target: test_base + tags: bun-test:latest + load: true cache-from: type=gha cache-to: type=gha,mode=max - ulimit: "memlock=-1:-1 core=-1:-1" + builder: ${{ steps.buildx.outputs.name }} + - name: Run test-with-hmr + env: + BUN_TEST_NAME: test-with-hmr + GITHUB_WORKSPACE: $GITHUB_WORKSPACE + RUNNER_TEMP: ${RUNNER_TEMP} + run: bash .docker/runner.sh + - name: Run test-no-hmr + env: + BUN_TEST_NAME: test-no-hmr + GITHUB_WORKSPACE: $GITHUB_WORKSPACE + RUNNER_TEMP: ${RUNNER_TEMP} + run: bash .docker/runner.sh + - name: Run test-bun-create-next + env: + RUNNER_TEMP: ${RUNNER_TEMP} + BUN_TEST_NAME: test-create-next + GITHUB_WORKSPACE: $GITHUB_WORKSPACE + run: bash .docker/runner.sh + - name: Run test-bun-create-react + env: + RUNNER_TEMP: ${RUNNER_TEMP} + BUN_TEST_NAME: test-create-react + GITHUB_WORKSPACE: $GITHUB_WORKSPACE + run: bash .docker/runner.sh + - name: Run test-bun-run + env: + RUNNER_TEMP: ${RUNNER_TEMP} + BUN_TEST_NAME: test-bun-run + GITHUB_WORKSPACE: $GITHUB_WORKSPACE + run: bash .docker/runner.sh + + release: + runs-on: self-hosted + needs: tests + if: github.ref == 'refs/heads/main' + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Checkout submodules + run: git -c submodule."src/javascript/jsc/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j 8 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + install: true + - name: Build release image + uses: docker/build-push-action@v2 + with: + context: . + target: release + tags: ghcr.io/jarred-sumner/bun:${{github.sha}} + builder: ${{ steps.buildx.outputs.name }} + push: true diff --git a/.gitignore b/.gitignore index 27bc57579..66c10a3fb 100644 --- a/.gitignore +++ b/.gitignore @@ -81,3 +81,5 @@ src/tests.zig src/deps/s2n-tls .npm .npm.gz + +bun-binary diff --git a/Dockerfile b/Dockerfile index a37a78d90..538e0ccc5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,194 +1,194 @@ -FROM ubuntu:20.04 as base +FROM bunbunbunbun/bun-base:latest as mimalloc + ARG DEBIAN_FRONTEND=noninteractive +ARG GITHUB_WORKSPACE=/build +ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig +# Directory extracts to "bun-webkit" +ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit +ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release +ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps +ARG BUN_DIR=${GITHUB_WORKSPACE}/bun -RUN apt-get update && apt-get install --no-install-recommends -y wget gnupg2 curl lsb-release wget software-properties-common - -RUN add-apt-repository ppa:longsleep/golang-backports -RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - - -RUN wget https://apt.llvm.org/llvm.sh --no-check-certificate -RUN chmod +x llvm.sh -RUN ./llvm.sh 12 - -RUN apt-get update && apt-get install --no-install-recommends -y \ - ca-certificates \ - curl \ - gnupg2 \ - software-properties-common \ - cmake \ - build-essential \ - git \ - libssl-dev \ - ruby \ - liblld-12-dev \ - libclang-12-dev \ - nodejs \ - gcc \ - g++ \ - npm \ - clang-12 \ - clang-format-12 \ - libc++-12-dev \ - libc++abi-12-dev \ - lld-12 \ - libicu-dev \ - wget \ - unzip \ - tar \ - golang-go chromium-browser ninja-build pkg-config automake autoconf libtool curl - -RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang-12 90 && \ - update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++-12 90 && \ - update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-12 90 - -ENV CC=clang-12 -ENV CXX=clang++-12 - -WORKDIR /home/ubuntu -ARG BUILDARCH -ENV ARCH "$BUILDARCH" - -RUN npm install -g esbuild - -RUN curl -L https://github.com/Jarred-Sumner/zig/releases/download/dec20/zig-linux-$BUILDARCH.zip > zig-linux-$BUILDARCH.zip; \ - unzip -q zig-linux-$BUILDARCH.zip; \ - rm zig-linux-$BUILDARCH.zip; - - -ENV WEBKIT_OUT_DIR /home/ubuntu/bun-webkit - -WORKDIR /home/ubuntu - -ENV PATH "/home/ubuntu/zig:$PATH" -ENV JSC_BASE_DIR $WEBKIT_OUT_DIR -ENV LIB_ICU_PATH /home/ubuntu/icu/source/lib -ENV BUN_RELEASE_DIR /home/ubuntu/bun-release -ENV BUN_DEPS_OUT_DIR /home/ubuntu/bun-deps +COPY Makefile ${BUN_DIR}/Makefile +COPY src/deps/mimalloc ${BUN_DIR}/src/deps/mimalloc -RUN mkdir -p $BUN_RELEASE_DIR $BUN_DEPS_OUT_DIR /home/ubuntu/bun +RUN cd ${BUN_DIR} && \ + make mimalloc && rm -rf src/deps/mimalloc Makefile -FROM base as base_with_zig_and_webkit +FROM bunbunbunbun/bun-base:latest as zlib -WORKDIR /home/ubuntu +ARG DEBIAN_FRONTEND=noninteractive +ARG GITHUB_WORKSPACE=/build +ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig +# Directory extracts to "bun-webkit" +ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit +ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release +ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps +ARG BUN_DIR=${GITHUB_WORKSPACE}/bun -RUN curl -L https://github.com/Jarred-Sumner/WebKit/releases/download/Bun-v0/bun-webkit-linux-$BUILDARCH.tar.gz > bun-webkit-linux-$BUILDARCH.tar.gz; \ - tar -xzf bun-webkit-linux-$BUILDARCH.tar.gz; \ - rm bun-webkit-linux-$BUILDARCH.tar.gz && cat $WEBKIT_OUT_DIR/include/cmakeconfig.h > /dev/null +COPY Makefile ${BUN_DIR}/Makefile +COPY src/deps/zlib ${BUN_DIR}/src/deps/zlib -RUN curl -L https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c-66_1-src.tgz > icu4c-66_1-src.tgz && \ - tar -xzf icu4c-66_1-src.tgz && \ - rm icu4c-66_1-src.tgz && \ - cd icu/source && \ - ./configure --enable-static --disable-shared && \ - make -j$(nproc) +WORKDIR $BUN_DIR +RUN cd $BUN_DIR && \ + make zlib && rm -rf src/deps/zlib Makefile -WORKDIR /home/ubuntu/bun +FROM bunbunbunbun/bun-base:latest as libarchive -FROM base as mimalloc +ARG DEBIAN_FRONTEND=noninteractive +ARG GITHUB_WORKSPACE=/build +ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig +# Directory extracts to "bun-webkit" +ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit +ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release +ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps +ARG BUN_DIR=${GITHUB_WORKSPACE}/bun -WORKDIR /home/ubuntu/bun -COPY Makefile /home/ubuntu/bun/Makefile -COPY src/deps/mimalloc /home/ubuntu/bun/src/deps/mimalloc +COPY Makefile ${BUN_DIR}/Makefile +COPY src/deps/libarchive ${BUN_DIR}/src/deps/libarchive -RUN make mimalloc +WORKDIR $BUN_DIR -FROM base as zlib +RUN cd $BUN_DIR && \ + make libarchive && rm -rf src/deps/libarchive Makefile -WORKDIR /home/ubuntu/bun -COPY Makefile /home/ubuntu/bun/Makefile -COPY src/deps/zlib /home/ubuntu/bun/src/deps/zlib +FROM bunbunbunbun/bun-base:latest as boringssl -RUN make zlib +ARG DEBIAN_FRONTEND=noninteractive +ARG GITHUB_WORKSPACE=/build +ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig +# Directory extracts to "bun-webkit" +ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit +ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release +ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps +ARG BUN_DIR=${GITHUB_WORKSPACE}/bun -FROM base as libarchive +COPY Makefile ${BUN_DIR}/Makefile +COPY src/deps/boringssl ${BUN_DIR}/src/deps/boringssl -WORKDIR /home/ubuntu/bun -COPY Makefile /home/ubuntu/bun/Makefile -COPY src/deps/libarchive /home/ubuntu/bun/src/deps/libarchive +WORKDIR $BUN_DIR -RUN make libarchive +RUN cd $BUN_DIR && \ + make boringssl && rm -rf src/deps/boringssl Makefile -FROM base as boringssl +FROM bunbunbunbun/bun-base:latest as picohttp -WORKDIR /home/ubuntu/bun -COPY Makefile /home/ubuntu/bun/Makefile -COPY src/deps/boringssl /home/ubuntu/bun/src/deps/boringssl +ARG DEBIAN_FRONTEND=noninteractive +ARG GITHUB_WORKSPACE=/build +ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig +# Directory extracts to "bun-webkit" +ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit +ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release +ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps +ARG BUN_DIR=${GITHUB_WORKSPACE}/bun -RUN make boringssl +COPY Makefile ${BUN_DIR}/Makefile +COPY src/deps/picohttpparser ${BUN_DIR}/src/deps/picohttpparser +COPY src/deps/*.c ${BUN_DIR}/src/deps +COPY src/deps/*.h ${BUN_DIR}/src/deps -FROM base as picohttp +WORKDIR $BUN_DIR -WORKDIR /home/ubuntu/bun -COPY Makefile /home/ubuntu/bun/Makefile -COPY src/deps/picohttpparser /home/ubuntu/bun/src/deps/picohttpparser -COPY src/deps/*.c /home/ubuntu/bun/src/deps -COPY src/deps/*.h /home/ubuntu/bun/src/deps +RUN cd $BUN_DIR && \ + make picohttp -RUN make picohttp +FROM bunbunbunbun/bun-base-with-zig-and-webkit:latest as identifier_cache -FROM base_with_zig_and_webkit as identifier_cache +ARG DEBIAN_FRONTEND=noninteractive +ARG GITHUB_WORKSPACE=/build +ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig +# Directory extracts to "bun-webkit" +ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit +ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release +ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps +ARG BUN_DIR=${GITHUB_WORKSPACE}/bun -WORKDIR /home/ubuntu/bun -COPY Makefile /home/ubuntu/bun/Makefile -COPY src/js_lexer/identifier_data.zig /home/ubuntu/bun/src/js_lexer/identifier_data.zig -COPY src/js_lexer/identifier_cache.zig /home/ubuntu/bun/src/js_lexer/identifier_cache.zig +WORKDIR $BUN_DIR -RUN make identifier-cache +COPY Makefile ${BUN_DIR}/Makefile +COPY src/js_lexer/identifier_data.zig ${BUN_DIR}/src/js_lexer/identifier_data.zig +COPY src/js_lexer/identifier_cache.zig ${BUN_DIR}/src/js_lexer/identifier_cache.zig -FROM base as node_fallbacks +RUN cd $BUN_DIR && \ + make identifier-cache && rm -rf zig-cache Makefile -WORKDIR /home/ubuntu/bun -COPY Makefile /home/ubuntu/bun/Makefile -COPY src/node-fallbacks /home/ubuntu/bun/src/node-fallbacks -RUN make node-fallbacks +FROM bunbunbunbun/bun-base-with-zig-and-webkit:latest as node_fallbacks -FROM base_with_zig_and_webkit as build_dependencies +ARG DEBIAN_FRONTEND=noninteractive +ARG GITHUB_WORKSPACE=/build +ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig +# Directory extracts to "bun-webkit" +ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit +ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release +ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps +ARG BUN_DIR=${GITHUB_WORKSPACE}/bun -WORKDIR /home/ubuntu/bun +WORKDIR $BUN_DIR -ENV BUN_DEPS_OUT_DIR /home/ubuntu/bun-deps -COPY ./src /home/ubuntu/bun/src -COPY ./build.zig /home/ubuntu/bun/build.zig -COPY ./completions /home/ubuntu/bun/completions -COPY ./packages /home/ubuntu/bun/packages -COPY ./build-id /home/ubuntu/bun/build-id -COPY ./package.json /home/ubuntu/bun/package.json -COPY ./misctools /home/ubuntu/bun/misctools -COPY Makefile /home/ubuntu/bun/Makefile +COPY Makefile ${BUN_DIR}/Makefile +COPY src/node-fallbacks ${BUN_DIR}/src/node-fallbacks +RUN cd $BUN_DIR && \ + make node-fallbacks && rm -rf src/node-fallbacks/node_modules Makefile -COPY --from=mimalloc /home/ubuntu/bun-deps/*.o /home/ubuntu/bun-deps -COPY --from=libarchive /home/ubuntu/bun-deps/*.a /home/ubuntu/bun-deps -COPY --from=picohttp /home/ubuntu/bun-deps/*.o /home/ubuntu/bun-deps -COPY --from=boringssl /home/ubuntu/bun-deps/*.a /home/ubuntu/bun-deps -COPY --from=zlib /home/ubuntu/bun-deps/*.a /home/ubuntu/bun-deps -COPY --from=node_fallbacks /home/ubuntu/bun/src/node-fallbacks /home/ubuntu/bun/src/node-fallbacks -COPY --from=identifier_cache /home/ubuntu/bun/src/js_lexer/*.blob /home/ubuntu/bun/src/js_lexer/ +FROM bunbunbunbun/bun-base-with-zig-and-webkit:latest as build_release -RUN make \ +ARG DEBIAN_FRONTEND=noninteractive +ARG GITHUB_WORKSPACE=/build +ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig +# Directory extracts to "bun-webkit" +ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit +ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release +ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps +ARG BUN_DIR=${GITHUB_WORKSPACE}/bun + + +WORKDIR $BUN_DIR + +COPY ./src ${BUN_DIR}/src +COPY ./build.zig ${BUN_DIR}/build.zig +COPY ./completions ${BUN_DIR}/completions +COPY ./packages ${BUN_DIR}/packages +COPY ./build-id ${BUN_DIR}/build-id +COPY ./package.json ${BUN_DIR}/package.json +COPY ./misctools ${BUN_DIR}/misctools +COPY Makefile ${BUN_DIR}/Makefile + +COPY --from=mimalloc ${BUN_DEPS_OUT_DIR}/*.o ${BUN_DEPS_OUT_DIR}/ +COPY --from=libarchive ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/ +COPY --from=picohttp ${BUN_DEPS_OUT_DIR}/*.o ${BUN_DEPS_OUT_DIR}/ +COPY --from=boringssl ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/ +COPY --from=zlib ${BUN_DEPS_OUT_DIR}/*.a ${BUN_DEPS_OUT_DIR}/ +COPY --from=identifier_cache ${BUN_DIR}/src/js_lexer/*.blob ${BUN_DIR}/src/js_lexer + +RUN cd $BUN_DIR && rm -rf $HOME/.cache zig-cache && make \ jsc-bindings-headers \ api \ analytics \ bun_error \ - fallback_decoder + fallback_decoder && rm -rf $HOME/.cache zig-cache && \ + mkdir -p $BUN_RELEASE_DIR && \ + make release copy-to-bun-release-dir && \ + rm -rf $HOME/.cache zig-cache misctools package.json build-id completions build.zig -FROM build_dependencies as build_release +FROM bunbunbunbun/bun-base-with-zig-and-webkit:latest as bun.devcontainer -WORKDIR /home/ubuntu/bun - -ENV BUN_RELEASE_DIR /home/ubuntu/bun-release - -RUN mkdir -p $BUN_RELEASE_DIR; make release \ - copy-to-bun-release-dir +ARG DEBIAN_FRONTEND=noninteractive +ARG GITHUB_WORKSPACE=/workspaces +ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig +# Directory extracts to "bun-webkit" +ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit +ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release +ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps +ARG BUN_DIR=${GITHUB_WORKSPACE}/bun -FROM base_with_zig_and_webkit as bun.devcontainer -ENV WEBKIT_OUT_DIR /home/ubuntu/bun-webkit -ENV PATH "/home/ubuntu/zig:$PATH" +ENV WEBKIT_OUT_DIR ${WEBKIT_DIR} +ENV PATH "$ZIG_PATH:$PATH" ENV JSC_BASE_DIR $WEBKIT_OUT_DIR ENV LIB_ICU_PATH /home/ubuntu/icu/source/lib -ENV BUN_RELEASE_DIR /home/ubuntu/bun-release +ENV BUN_RELEASE_DIR ${BUN_RELEASE_DIR} ENV PATH "/workspaces/bun/packages/bun-linux-x64:/workspaces/bun/packages/bun-linux-aarch64:/workspaces/bun/packages/debug-bun-linux-x64:/workspaces/bun/packages/debug-bun-linux-aarch64:$PATH" ENV PATH "/home/ubuntu/zls/zig-out/bin:$PATH" @@ -202,91 +202,74 @@ COPY .devcontainer/zls.json /workspaces/workspace.code-workspace COPY .devcontainer/limits.conf /etc/security/limits.conf COPY ".devcontainer/scripts/" /scripts/ COPY ".devcontainer/scripts/getting-started.sh" /workspaces/getting-started.sh -RUN mkdir -p /home/ubuntu/.bun /home/ubuntu/.config /workspaces/bun && bash /scripts/common-debian.sh && bash /scripts/github.sh && bash /scripts/nice.sh && bash /scripts/zig-env.sh +RUN mkdir -p /home/ubuntu/.bun /home/ubuntu/.config /workspaces/bun && \ + bash /scripts/common-debian.sh && \ + bash /scripts/github.sh && \ + bash /scripts/nice.sh && \ + bash /scripts/zig-env.sh COPY .devcontainer/zls.json /home/ubuntu/.config/zls.json -FROM ubuntu:20.04 as test_base +FROM ubuntu:20.04 as release ARG DEBIAN_FRONTEND=noninteractive -ENV DEBIAN_FRONTEND=noninteractive - -ENV CI 1 -ENV NPM_CLIENT bun -ENV PATH "/home/ubuntu/bun/packages/bun-linux-x64:/home/ubuntu/bun/packages/bun-linux-aarch64:$PATH" - -# All this is necessary because Ubuntu decided to use snap for their Chromium packages -# Which breaks using Chrome in the container on aarch64 -RUN apt-get update && \ - apt-get install -y wget gnupg2 curl make git unzip nodejs npm psmisc && \ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DCC9EFBF77E11517 && \ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 && \ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AA8E81B4331F7F50 && \ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 112695A0E562B32A - -COPY ./integration /home/ubuntu/bun/integration -COPY Makefile /home/ubuntu/bun/Makefile -COPY package.json /home/ubuntu/bun/package.json - -# We don't want to worry about architecture differences in this image -COPY --from=release /opt/bun/bin/bun /home/ubuntu/bun/packages/bun-linux-aarch64/bun -COPY --from=release /opt/bun/bin/bun /home/ubuntu/bun/packages/bun-linux-x64/bun +ARG GITHUB_WORKSPACE=/build +ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig +# Directory extracts to "bun-webkit" +ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit +ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release +ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps +ARG BUN_DIR=${GITHUB_WORKSPACE}/bun -FROM test_base as test_create_next - -WORKDIR /home/ubuntu/bun -CMD make test-create-next - -FROM test_base as test_create_react - -WORKDIR /home/ubuntu/bun -CMD make test-create-react - - -FROM test_base as test_bun_run - -WORKDIR /home/ubuntu/bun -CMD make test-bun-run - -FROM test_base as browser_test_base - -COPY .docker/chromium.pref /etc/apt/preferences.d/chromium.pref -COPY .docker/debian.list /etc/apt/sources.list.d/debian.list +COPY .devcontainer/limits.conf /etc/security/limits.conf -RUN apt-get update && \ - apt-get install -y --no-install-recommends chromium +ENV BUN_INSTALL /opt/bun +ENV PATH "/opt/bun/bin:$PATH" +ARG BUILDARCH=amd64 +LABEL org.opencontainers.image.title="Bun ${BUILDARCH} (glibc)" +LABEL org.opencontainers.image.source=https://github.com/jarred-sumner/bun +COPY --from=build_release ${BUN_RELEASE_DIR}/bun /opt/bun/bin/bun +WORKDIR /opt/bun +ENTRYPOINT [ "/opt/bun/bin/bun" ] -WORKDIR /home/ubuntu/bun -RUN mkdir -p /var/run/dbus && ln -s /usr/bin/chromium /usr/bin/chromium-browser -RUN apt-get install -y make fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 xvfb ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils --no-install-recommends +FROM bunbunbunbun/bun-test-base as test_base +ARG DEBIAN_FRONTEND=noninteractive +ARG GITHUB_WORKSPACE=/build +ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig +# Directory extracts to "bun-webkit" +ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit +ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release +ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps +ARG BUN_DIR=${GITHUB_WORKSPACE}/bun -FROM browser_test_base as test_hmr +ARG BUILDARCH=amd64 +RUN groupadd -r chromium && useradd -d ${BUN_DIR} -M -r -g chromium -G audio,video chromium \ + && mkdir -p /home/chromium/Downloads && chown -R chromium:chromium /home/chromium -WORKDIR /home/ubuntu/bun -CMD dbus-daemon --system &> /dev/null && \ - bun install --cwd /home/ubuntu/bun/integration/snippets && \ - bun install --cwd /home/ubuntu/bun/integration/scripts && \ - bun install && \ - make test-hmr-hmr +USER chromium +WORKDIR $BUN_DIR -FROM browser_test_base as test_no_hmr +ENV NPM_CLIENT bun +ENV PATH "${BUN_DIR}/packages/bun-linux-x64:${BUN_DIR}/packages/bun-linux-aarch64:$PATH" +ENV CI 1 +ENV BROWSER_EXECUTABLE /usr/bin/chromium -WORKDIR /home/ubuntu/bun -CMD dbus-daemon --system &> /dev/null && \ - bun install --cwd /home/ubuntu/bun/integration/snippets && \ - bun install --cwd /home/ubuntu/bun/integration/scripts && \ - bun install && \ - make test-no-hmr +COPY ./integration ${BUN_DIR}/integration +COPY Makefile ${BUN_DIR}/Makefile +COPY package.json ${BUN_DIR}/package.json +COPY .docker/run-test.sh ${BUN_DIR}/run-test.sh +COPY ./bun.lockb ${BUN_DIR}/bun.lockb -FROM ubuntu:20.04 as release +# # We don't want to worry about architecture differences in this image +COPY --from=release /opt/bun/bin/bun ${BUN_DIR}/packages/bun-linux-aarch64/bun +COPY --from=release /opt/bun/bin/bun ${BUN_DIR}/packages/bun-linux-x64/bun -COPY --from=build_release /home/ubuntu/bun-release/bun /opt/bun/bin/bun -COPY .devcontainer/limits.conf /etc/security/limits.conf +USER root +RUN chgrp -R chromium ${BUN_DIR} && chmod g+rwx ${BUN_DIR} && chown -R chromium:chromium ${BUN_DIR} +USER chromium -ENV BUN_INSTALL /opt/bun -ENV PATH "/opt/bun/bin:$PATH" +CMD [ "bash", ".run-test.sh" ] -LABEL org.opencontainers.image.title="Bun ${BUILDARCH} (glibc)" -LABEL org.opencontainers.image.source=https://github.com/jarred-sumner/bun
\ No newline at end of file +FROM release
\ No newline at end of file diff --git a/Dockerfile.base b/Dockerfile.base new file mode 100644 index 000000000..85b3a37b2 --- /dev/null +++ b/Dockerfile.base @@ -0,0 +1,145 @@ +FROM ubuntu:20.04 as bun-base-with-args + +FROM bun-base-with-args as bun-base + +ARG DEBIAN_FRONTEND=noninteractive +ARG GITHUB_WORKSPACE=/build +ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig +# Directory extracts to "bun-webkit" +ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit +ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release +ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps +ARG BUN_DIR=${GITHUB_WORKSPACE}/bun + +WORKDIR ${GITHUB_WORKSPACE} + +RUN apt-get update && \ + apt-get install --no-install-recommends -y wget gnupg2 curl lsb-release wget software-properties-common && \ + add-apt-repository ppa:longsleep/golang-backports && \ + wget https://apt.llvm.org/llvm.sh --no-check-certificate && \ + chmod +x llvm.sh && \ + ./llvm.sh 12 && \ + apt-get update && \ + apt-get install --no-install-recommends -y \ + ca-certificates \ + curl \ + gnupg2 \ + software-properties-common \ + cmake \ + build-essential \ + git \ + libssl-dev \ + ruby \ + liblld-12-dev \ + libclang-12-dev \ + nodejs \ + gcc \ + g++ \ + npm \ + clang-12 \ + clang-format-12 \ + libc++-12-dev \ + libc++abi-12-dev \ + lld-12 \ + libicu-dev \ + wget \ + unzip \ + tar \ + golang-go ninja-build pkg-config automake autoconf libtool curl && \ + update-alternatives --install /usr/bin/cc cc /usr/bin/clang-12 90 && \ + update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++-12 90 && \ + update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-12 90 && \ + npm install -g esbuild + +ENV CC=clang-12 +ENV CXX=clang++-12 + + +ARG BUILDARCH=amd64 + + +WORKDIR $GITHUB_WORKSPACE + +ENV WEBKIT_OUT_DIR ${WEBKIT_DIR} + +ENV JSC_BASE_DIR $WEBKIT_OUT_DIR +ENV LIB_ICU_PATH ${GITHUB_WORKSPACE}/icu/source/lib +ENV BUN_RELEASE_DIR ${BUN_RELEASE_DIR} +ENV BUN_DEPS_OUT_DIR ${BUN_DEPS_OUT_DIR} + +RUN cd / && mkdir -p $BUN_RELEASE_DIR $BUN_DEPS_OUT_DIR ${BUN_DIR} ${BUN_DEPS_OUT_DIR} + +LABEL org.opencontainers.image.title="Bun base image ${BUILDARCH} (glibc)" +LABEL org.opencontainers.image.source=https://github.com/jarred-sumner/bun + + +FROM bun-base as bun-base-with-zig-and-webkit + +ARG DEBIAN_FRONTEND=noninteractive +ARG GITHUB_WORKSPACE=/build +ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig +# Directory extracts to "bun-webkit" +ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit +ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release +ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps +ARG BUN_DIR=${GITHUB_WORKSPACE}/bun +ARG BUILDARCH=amd64 + +WORKDIR $GITHUB_WORKSPACE + +RUN cd $GITHUB_WORKSPACE && \ + curl -o zig-linux-$BUILDARCH.zip -L https://github.com/Jarred-Sumner/zig/releases/download/dec20/zig-linux-$BUILDARCH.zip && \ + unzip -q zig-linux-$BUILDARCH.zip && \ + rm zig-linux-$BUILDARCH.zip; + +RUN cd $GITHUB_WORKSPACE && \ + curl -o bun-webkit-linux-$BUILDARCH.tar.gz -L https://github.com/Jarred-Sumner/WebKit/releases/download/Bun-v0/bun-webkit-linux-$BUILDARCH.tar.gz && \ + tar -xzf bun-webkit-linux-$BUILDARCH.tar.gz && \ + rm bun-webkit-linux-$BUILDARCH.tar.gz && \ + cat $WEBKIT_OUT_DIR/include/cmakeconfig.h > /dev/null + +RUN cd $GITHUB_WORKSPACE && \ + curl -o icu4c-66_1-src.tgz -L https://github.com/unicode-org/icu/releases/download/release-66-1/icu4c-66_1-src.tgz && \ + tar -xzf icu4c-66_1-src.tgz && \ + rm icu4c-66_1-src.tgz && \ + cd icu/source && \ + ./configure --enable-static --disable-shared && \ + make -j$(nproc) + +ENV ZIG "${ZIG_PATH}/zig" + +LABEL org.opencontainers.image.title="Bun base image with zig & webkit ${BUILDARCH} (glibc)" +LABEL org.opencontainers.image.source=https://github.com/jarred-sumner/bun + + +FROM debian:bullseye-slim as bun-test-base +# Original creator: +# LABEL maintainer "Jessie Frazelle <jess@linux.com>" + +# Install Chromium +# Yes, including the Google API Keys sucks but even debian does the same: https://packages.debian.org/stretch/amd64/chromium/filelist +RUN apt-get update && apt-get install -y \ + chromium \ + chromium-l10n \ + fonts-liberation \ + fonts-roboto \ + hicolor-icon-theme \ + libcanberra-gtk-module \ + libexif-dev \ + libgl1-mesa-dri \ + libgl1-mesa-glx \ + libpangox-1.0-0 \ + libv4l-0 \ + fonts-symbola \ + bash \ + make \ + psmisc \ + curl \ + --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /etc/chromium.d/ \ + && /bin/echo -e 'export GOOGLE_API_KEY="AIzaSyCkfPOPZXDKNn8hhgu3JrA62wIgC93d44k"\nexport GOOGLE_DEFAULT_CLIENT_ID="811574891467.apps.googleusercontent.com"\nexport GOOGLE_DEFAULT_CLIENT_SECRET="kdloedMFGdGla2P1zacGjAQh"' > /etc/chromium.d/googleapikeys && \ + curl -L https://deb.nodesource.com/setup_16.x | bash - && \ + apt-get update && \ + apt-get install -y nodejs npm + @@ -14,12 +14,15 @@ MIN_MACOS_VERSION = 10.14 MARCH_NATIVE = ARCH_NAME := +DOCKER_BUILDARCH = ifeq ($(ARCH_NAME_RAW),arm64) ARCH_NAME = aarch64 + DOCKER_BUILDARCH = arm64 BREW_PREFIX_PATH = /opt/homebrew MIN_MACOS_VERSION = 11.0 else ARCH_NAME = x64 + DOCKER_BUILDARCH = amd64 BREW_PREFIX_PATH = /usr/local MARCH_NATIVE = -march=native endif @@ -284,6 +287,23 @@ zlib: cd $(BUN_DEPS_DIR)/zlib; cmake $(CMAKE_FLAGS) .; make CFLAGS=$(CFLAGS); cp $(BUN_DEPS_DIR)/zlib/libz.a $(BUN_DEPS_OUT_DIR)/libz.a +docker-login: + docker login ghcr.io --username jarred@jarredsumner.com + +docker-push-base: + BUILDKIT=1 docker build -f Dockerfile.base --build-arg GITHUB_WORKSPACE=/build --platform=linux/$(DOCKER_BUILDARCH) --tag bun-base --target base . + BUILDKIT=1 docker build -f Dockerfile.base --build-arg GITHUB_WORKSPACE=/build --platform=linux/$(DOCKER_BUILDARCH) --tag bun-base-with-zig-and-webkit --target base-with-zig-and-webkit . + BUILDKIT=1 docker build -f Dockerfile.base --build-arg GITHUB_WORKSPACE=/build --platform=linux/$(DOCKER_BUILDARCH) --tag bun-base-with-args --target base-with-args . + + docker tag bun-base ghcr.io/jarred-sumner/bun-base:latest + docker push ghcr.io/jarred-sumner/bun-base:latest + + docker tag bun-base-with-zig-and-webkit ghcr.io/jarred-sumner/bun-base-with-zig-and-webkit:latest + docker push ghcr.io/jarred-sumner/bun-base-with-zig-and-webkit:latest + + docker tag bun-base-with-args ghcr.io/jarred-sumner/bun-base-with-args:latest + docker push ghcr.io/jarred-sumner/bun-base-with-args:latest + require: @echo "Checking if the required utilities are available..." @cmake --version >/dev/null 2>&1 || (echo -e "ERROR: cmake is required."; exit 1) @@ -327,7 +347,7 @@ api: $(PRETTIER) --write src/api/schema.d.ts node-fallbacks: - @cd src/node-fallbacks; $(NPM_CLIENT) install; $(NPM_CLIENT) --silent build + @cd src/node-fallbacks; $(NPM_CLIENT) install; $(NPM_CLIENT) run --silent build fallback_decoder: @esbuild --target=esnext --bundle src/fallback.ts --format=iife --platform=browser --minify > src/fallback.out.js @@ -339,7 +359,7 @@ runtime_js_dev: @NODE_ENV=development esbuild --define:process.env.NODE_ENV="development" --target=esnext --bundle src/runtime/index.ts --format=iife --platform=browser --global-name=BUN_RUNTIME --external:/bun:* > src/runtime.out.js; cat src/runtime.footer.js >> src/runtime.out.js bun_error: - @cd packages/bun-error; $(NPM_CLIENT) install; $(NPM_CLIENT) --silent build + @cd packages/bun-error; $(NPM_CLIENT) install; $(NPM_CLIENT) run --silent build generate-install-script: @rm -f $(PACKAGES_REALPATH)/bun/install.js diff --git a/bun.lockb b/bun.lockb Binary files differnew file mode 100755 index 000000000..119c3bb0f --- /dev/null +++ b/bun.lockb diff --git a/integration/scripts/browser.js b/integration/scripts/browser.js index 986e96c7f..c6da2623c 100644 --- a/integration/scripts/browser.js +++ b/integration/scripts/browser.js @@ -75,6 +75,7 @@ function writeSnapshot(name, code) { const baseOptions = { dumpio: !!process.env.CI_DEBUG, + args: [ "--disable-gpu", "--disable-dev-shm-usage", @@ -85,6 +86,7 @@ const baseOptions = { "--use-fake-device-for-media-stream", "--disable-sync", ], + executablePath: process.env.BROWSER_EXECUTABLE, headless: true, }; diff --git a/integration/scripts/bun.lockb b/integration/scripts/bun.lockb Binary files differnew file mode 100755 index 000000000..d7a467e64 --- /dev/null +++ b/integration/scripts/bun.lockb diff --git a/integration/snippets/bun.lockb b/integration/snippets/bun.lockb Binary files differnew file mode 100755 index 000000000..127db7b6d --- /dev/null +++ b/integration/snippets/bun.lockb diff --git a/push-docker.sh b/push-docker.sh deleted file mode 100644 index 3053253fe..000000000 --- a/push-docker.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -source "dockerfile-common.sh" - -export CONTAINER_NAME=$CONTAINER_NAME - -docker build . --target release --progress=plain -t $CONTAINER_NAME:latest --build-arg BUILDKIT_INLINE_CACHE=1 --platform=linux/$BUILDKIT_ARCH --cache-from $CONTAINER_NAME:latest - -if (($?)); then - echo "Failed to build container" - exit 1 -fi - -id=$(docker create $CONTAINER_NAME:latest) -if (($?)); then - echo "Failed to cp container" - exit 1 -fi - -REGISTRY="ghcr.io/jarred-sumner" -docker push $REGISTRY/$CONTAINER_NAME:latest -# docker push $ECR/$CONTAINER_NAME:$BUILD_ID |