From 924b71ccc16c434005c0f4111e86d658734c0133 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Sat, 19 Feb 2022 00:04:43 +0800 Subject: [PATCH] build(next-swc): linux glibc compatible issue (#34481) Fix `GLIBC` compatible issues: - Fixes https://github.com/vercel/next.js/issues/33854 - All `CentOS 7` related issues in https://github.com/vercel/next.js/discussions/30468 Should also fix: - https://github.com/vercel/next.js/discussions/33530 Refactored jobs tested in https://github.com/Brooooooklyn/next.js/runs/5233199833?check_suite_focus=true ### `objdump` in `next@12.0.10`
Symbols node_modules/@next/swc-linux-x64-gnu/next-swc.linux-x64-gnu.node: file format elf64-x86-64 DYNAMIC SYMBOL TABLE: 0000000000000000 D *UND* 0000000000000000 napi_resolve_deferred 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.4 __xpg_strerror_r 0000000000000000 D *UND* 0000000000000000 napi_typeof 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_setspecific 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.2 pthread_cond_destroy 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.4 __stack_chk_fail 0000000000000000 DF *UND* 0000000000000000 GCC_3.0 _Unwind_GetRegionStart 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 memset 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 fputs 0000000000000000 DF *UND* 0000000000000000 GCC_3.3 _Unwind_FindEnclosingFunction 0000000000000000 DF *UND* 0000000000000000 GCC_3.0 _Unwind_GetTextRelBase 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 setgroups 0000000000000000 DO *UND* 0000000000000000 GLIBC_2.2.5 stdout 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 madvise 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3 realpath 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawn_file_actions_adddup2 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pow 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 sigaltstack 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_self 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 trunc 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.4 __strncat_chk 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_attr_setstacksize 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 sigemptyset 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_detach 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 __fxstat64 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.2 pthread_cond_broadcast 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 strtol 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 __cxa_atexit 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 round 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 sigaddset 0000000000000000 DF *UND* 0000000000000000 GCC_3.0 _Unwind_RaiseException 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.15 posix_spawnp 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 memcmp 0000000000000000 D *UND* 0000000000000000 napi_queue_async_work 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_rwlock_wrlock 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 floor 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.4 __vsnprintf_chk 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_key_create 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 close 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutexattr_destroy 0000000000000000 D *UND* 0000000000000000 napi_throw_error 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3 __ctype_toupper_loc 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 poll 0000000000000000 D *UND* 0000000000000000 napi_reject_deferred 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 signal 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 getcwd 0000000000000000 w D *UND* 0000000000000000 __gmon_start__ 0000000000000000 D *UND* 0000000000000000 napi_get_value_string_utf8 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawnattr_setsigmask 0000000000000000 D *UND* 0000000000000000 napi_create_promise 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 dup2 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_attr_getguardsize 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 __xstat64 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_attr_getstack 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 strerror 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 getenv 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 read 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 memrchr 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_rwlock_rdlock 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 fmod 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 fork 0000000000000000 DF *UND* 0000000000000000 GCC_3.3 _Unwind_Backtrace 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawn_file_actions_destroy 0000000000000000 D *UND* 0000000000000000 napi_get_value_bool 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 setuid 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.9 pipe2 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.4 __snprintf_chk 0000000000000000 DF *UND* 0000000000000000 GCC_3.0 _Unwind_SetIP 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 dlsym 0000000000000000 D *UND* 0000000000000000 napi_create_error 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutex_destroy 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 access 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 ioctl 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 strncpy 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 localtime_r 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 memmove 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 syscall 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 readlink 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 fma 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 getuid 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 sin 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutex_init 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 strlen 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawnattr_setflags 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawn_file_actions_init 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 strstr 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_key_delete 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_getattr_np 0000000000000000 D *UND* 0000000000000000 napi_get_buffer_info 0000000000000000 DO *UND* 0000000000000000 GLIBC_2.2.5 stderr 0000000000000000 DF *UND* 0000000000000000 GCC_3.0 _Unwind_Resume 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawnattr_destroy 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.2 pthread_cond_signal 0000000000000000 w DF *UND* 0000000000000000 GLIBC_2.18 __cxa_thread_atexit_impl 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutex_trylock 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 writev 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 clock_gettime 0000000000000000 D *UND* 0000000000000000 napi_delete_async_work 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_getspecific 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_condattr_destroy 0000000000000000 DF *UND* 0000000000000000 GCC_3.0 _Unwind_DeleteException 0000000000000000 D *UND* 0000000000000000 napi_create_function 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 prctl 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 waitpid 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 lseek64 0000000000000000 D *UND* 0000000000000000 napi_set_named_property 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 cos 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawnattr_init 0000000000000000 DF *UND* 0000000000000000 GCC_3.0 _Unwind_GetIP 0000000000000000 w D *UND* 0000000000000000 _ITM_registerTMCloneTable 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 execvp 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 ceil 0000000000000000 DO *UND* 0000000000000000 GLIBC_2.2.5 environ 0000000000000000 D *UND* 0000000000000000 napi_get_cb_info 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutexattr_init 0000000000000000 D *UND* 0000000000000000 napi_coerce_to_object 0000000000000000 D *UND* 0000000000000000 napi_throw 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 mprotect 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.14 memcpy 0000000000000000 w D *UND* 0000000000000000 _ITM_deregisterTMCloneTable 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_attr_init 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 fcntl 0000000000000000 DF *UND* 0000000000000000 GCC_4.2.0 _Unwind_GetIPInfo 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 free 0000000000000000 w DF *UND* 0000000000000000 GLIBC_2.2.5 __cxa_finalize 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutex_unlock 0000000000000000 DF *UND* 0000000000000000 GCC_3.0 _Unwind_GetDataRelBase 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutex_lock 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 dl_iterate_phdr 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.4 sched_getaffinity 0000000000000000 DF *UND* 0000000000000000 GCC_3.0 _Unwind_SetGR 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.2 pthread_cond_init 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 memchr 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 open 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3 __tls_get_addr 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 log10 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.2 pthread_cond_wait 0000000000000000 D *UND* 0000000000000000 napi_create_async_work 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 sysconf 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 munmap 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 log2 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.3 pthread_condattr_setclock 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_attr_destroy 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 bcmp 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_create 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawnattr_setsigdefault 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 abort 0000000000000000 D *UND* 0000000000000000 napi_create_string_utf8 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_condattr_init 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_sigmask 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutexattr_settype 0000000000000000 DO *UND* 0000000000000000 GLIBC_2.2.5 __environ 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 mmap 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 __errno_location 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 _exit 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 write 0000000000000000 DF *UND* 0000000000000000 GCC_3.3 _Unwind_GetCFA 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 getrusage 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_rwlock_unlock 0000000000000000 DF *UND* 0000000000000000 GCC_3.0 _Unwind_GetLanguageSpecificData 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 sched_yield 0000000000000000 D *UND* 0000000000000000 napi_create_object 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 setgid 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 chdir 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 open64 000000000039bbd0 g DF .text 000000000000032a Base napi_register_module_v1 0000000001ddd750 g DF .text 00000000000002e5 Base rust_eh_personality
There is `0000000000000000 w DF *UND* 0000000000000000 GLIBC_2.18 __cxa_thread_atexit_impl` introduced by https://github.com/rust-lang/rust/issues/36826 ### `objdump` in current branch
Symbols next-swc.linux-x64-gnu.node: file format elf64-x86-64 DYNAMIC SYMBOL TABLE: 0000000000000000 w D *UND* 0000000000000000 Base __gmon_start__ 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 memcpy 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 trunc 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3 __tls_get_addr 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 bcmp 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 memmove 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 memset 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutex_lock 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutex_trylock 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 memcmp 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutex_unlock 0000000000000000 D *UND* 0000000000000000 Base napi_create_function 0000000000000000 D *UND* 0000000000000000 Base napi_set_named_property 0000000000000000 D *UND* 0000000000000000 Base napi_create_string_utf8 0000000000000000 D *UND* 0000000000000000 Base napi_coerce_to_object 0000000000000000 D *UND* 0000000000000000 Base napi_get_cb_info 0000000000000000 D *UND* 0000000000000000 Base napi_create_error 0000000000000000 D *UND* 0000000000000000 Base napi_throw 0000000000000000 D *UND* 0000000000000000 Base napi_throw_error 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 fma 0000000000000000 D *UND* 0000000000000000 Base napi_create_object 0000000000000000 D *UND* 0000000000000000 Base napi_create_promise 0000000000000000 D *UND* 0000000000000000 Base napi_create_async_work 0000000000000000 D *UND* 0000000000000000 Base napi_queue_async_work 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 strlen 0000000000000000 D *UND* 0000000000000000 Base napi_get_value_string_utf8 0000000000000000 D *UND* 0000000000000000 Base napi_get_value_bool 0000000000000000 D *UND* 0000000000000000 Base napi_typeof 0000000000000000 D *UND* 0000000000000000 Base napi_get_buffer_info 0000000000000000 D *UND* 0000000000000000 Base napi_reject_deferred 0000000000000000 D *UND* 0000000000000000 Base napi_resolve_deferred 0000000000000000 D *UND* 0000000000000000 Base napi_delete_async_work 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 close 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pow 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 round 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 localtime_r 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 log10 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 cos 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 sin 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 fmod 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 ceil 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.2 pthread_cond_wait 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.4 sched_getaffinity 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 sysconf 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.4 __xpg_strerror_r 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 syscall 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 __errno_location 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 read 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 open64 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 poll 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 log2 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 munmap 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 mmap 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 dl_iterate_phdr 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 clock_gettime 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 getrusage 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 snprintf 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 access 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 vsnprintf 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 madvise 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 strerror 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 mprotect 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_setspecific 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 memchr 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3 realpath 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 getenv 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_key_create 0000000000000000 DO *UND* 0000000000000000 GLIBC_2.2.5 stderr 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 fputs 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 strncat 0000000000000000 DO *UND* 0000000000000000 GLIBC_2.2.5 environ 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3 __ctype_toupper_loc 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 strncpy 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 strstr 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 strtol 0000000000000000 DO *UND* 0000000000000000 GLIBC_2.2.5 stdout 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawnattr_destroy 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawn_file_actions_destroy 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutexattr_destroy 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_rwlock_unlock 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutex_destroy 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 sched_yield 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 getcwd 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_rwlock_rdlock 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_rwlock_wrlock 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 getuid 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 write 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 fcntl 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 lseek64 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 writev 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 memrchr 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 ioctl 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 waitpid 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.2 pthread_cond_broadcast 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_condattr_init 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.3 pthread_condattr_setclock 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.2 pthread_cond_init 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_condattr_destroy 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.2 pthread_cond_signal 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 sigaltstack 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 abort 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 signal 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_self 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_getattr_np 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_attr_getstack 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_attr_destroy 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 malloc 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 free 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.3.2 pthread_cond_destroy 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutexattr_init 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutexattr_settype 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_mutex_init 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_getspecific 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_key_delete 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 dlsym 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 readlink 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 chdir 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.9 pipe2 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_attr_init 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_attr_setstacksize 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_create 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 prctl 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_detach 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_attr_getguardsize 0000000000000000 w D *UND* 0000000000000000 Base __cxa_thread_atexit_impl 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawnattr_init 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawn_file_actions_init 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawn_file_actions_adddup2 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 sigemptyset 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawnattr_setsigmask 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 sigaddset 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawnattr_setsigdefault 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawnattr_setflags 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 fork 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 posix_spawnp 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 _exit 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 dup2 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 setgroups 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 setgid 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 setuid 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 pthread_sigmask 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 execvp 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 fprintf 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 fflush 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 dladdr 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 fwrite 0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 __cxa_atexit 0000000002830dc0 g DF .text 00000000000002e5 Base rust_eh_personality 0000000000e10380 g DF .text 000000000000032a Base napi_register_module_v1
No more `GLIBC_2.18` symbols. Confirm it works on `centos:7` docker image. --- .github/workflows/build_test_deploy.yml | 616 +++++------------- packages/next-swc/.cargo/config.toml | 2 +- .../napi/npm/android-arm-eabi/README.md | 3 + .../napi/npm/android-arm-eabi/package.json | 18 + packages/next-swc/package.json | 1 + packages/next/package.json | 2 +- scripts/install-native.mjs | 1 + yarn.lock | 8 +- 8 files changed, 180 insertions(+), 471 deletions(-) create mode 100644 packages/next-swc/crates/napi/npm/android-arm-eabi/README.md create mode 100644 packages/next-swc/crates/napi/npm/android-arm-eabi/package.json diff --git a/.github/workflows/build_test_deploy.yml b/.github/workflows/build_test_deploy.yml index 7906496c0d9ad69..e2b02075f956a6d 100644 --- a/.github/workflows/build_test_deploy.yml +++ b/.github/workflows/build_test_deploy.yml @@ -518,13 +518,6 @@ jobs: - build - build-wasm - build-native - - build-windows-i686 - - build-windows-aarch64 - - build-linux-musl - - build-linux-arm7 - - build-linux-aarch64-gnu - - build-android-aarch64 - - build-linux-aarch64-musl env: NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }} steps: @@ -606,7 +599,7 @@ jobs: uses: actions/setup-node@v2 if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} with: - node-version: 14 + node-version: 16 check-latest: true - name: Install @@ -621,14 +614,14 @@ jobs: if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} with: path: ~/.cargo/registry - key: stable-ubuntu-18.04-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} + key: stable-ubuntu-18.04-cargo-registry - name: Cache cargo index uses: actions/cache@v1 if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} with: path: ~/.cargo/git - key: stable-ubuntu-18.04-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }} + key: stable-ubuntu-18.04-cargo-index # We use week in the turbo cache key to keep the cache from infinitely growing - id: get-week @@ -660,9 +653,7 @@ jobs: # since the repo's dependencies aren't installed we need # to install napi globally - - run: npm i -g @napi-rs/cli@1.2.1 - - run: npm i -g turbo@1.0.28 - + - run: npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 - name: Build if: ${{ steps.docs-change.outputs.DOCS_CHANGE != 'docs only change' }} run: turbo run build-native --cache-dir=".turbo" @@ -747,95 +738,137 @@ jobs: # Build binaries for publishing build-native: - needs: build - if: ${{ needs.build.outputs.isRelease == 'true' }} strategy: + fail-fast: false matrix: - os: [ubuntu-18.04, macos-latest, windows-latest] - description: [default] - include: - - os: ubuntu-18.04 - target: x86_64-unknown-linux-gnu - name: linux-x64-gnu - - os: windows-latest - target: x86_64-pc-windows-msvc - name: win32-x64-msvc - - os: macos-latest - target: x86_64-apple-darwin - name: darwin-x64 - - os: macos-latest - target: aarch64-apple-darwin - name: darwin-arm64 - description: m1 - - name: next-swc - ${{ matrix.os }} - ${{ matrix.target }} - node@14 - runs-on: ${{ matrix.os }} - + settings: + - host: macos-latest + target: 'x86_64-apple-darwin' + build: | + npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 + turbo run build-native --cache-dir=".turbo" -- --release + strip -x packages/next-swc/native/next-swc.*.node + - host: windows-latest + build: | + npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 + turbo run build-native --cache-dir=".turbo" -- --release + target: 'x86_64-pc-windows-msvc' + - host: windows-latest + build: | + npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 + turbo run build-native --cache-dir=".turbo" -- --release --target i686-pc-windows-msvc + target: 'i686-pc-windows-msvc' + - host: ubuntu-latest + target: 'x86_64-unknown-linux-gnu' + docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine-zig + # Node.js in Baidu need to compatible with `GLIBC_2.12` + build: >- + set -e && + rustup toolchain install nightly-2021-11-15 && + rustup default nightly-2021-11-15 && + rustup target add x86_64-unknown-linux-gnu && + npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 && + turbo run build-native --cache-dir=".turbo" -- --release --target x86_64-unknown-linux-gnu --zig --zig-abi-suffix 2.12 && + llvm-strip -x packages/next-swc/native/next-swc.*.node + - host: ubuntu-latest + target: 'x86_64-unknown-linux-musl' + docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine + build: >- + set -e && + rustup toolchain install nightly-2021-11-15 && + rustup default nightly-2021-11-15 && + rustup target add x86_64-unknown-linux-musl && + npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 && + turbo run build-native --cache-dir=".turbo" -- --release --target x86_64-unknown-linux-musl && + strip packages/next-swc/native/next-swc.*.node + - host: macos-latest + target: 'aarch64-apple-darwin' + build: | + sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*; + export CC=$(xcrun -f clang); + export CXX=$(xcrun -f clang++); + SYSROOT=$(xcrun --sdk macosx --show-sdk-path); + export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT"; + npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 + turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-apple-darwin + strip -x packages/next-swc/native/next-swc.*.node + - host: ubuntu-latest + target: 'aarch64-unknown-linux-gnu' + docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine-zig + build: >- + set -e && + rustup toolchain install nightly-2021-11-15 && + rustup default nightly-2021-11-15 && + rustup target add aarch64-unknown-linux-gnu && + npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 && + turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-unknown-linux-gnu --zig --zig-abi-suffix 2.12 && + llvm-strip -x packages/next-swc/native/next-swc.*.node + - host: ubuntu-18.04 + target: 'armv7-unknown-linux-gnueabihf' + setup: | + sudo apt-get update + sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y + build: | + npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 + turbo run build-native --cache-dir=".turbo" -- --release --target armv7-unknown-linux-gnueabihf + arm-linux-gnueabihf-strip packages/next-swc/native/next-swc.*.node + - host: ubuntu-latest + target: aarch64-linux-android + build: | + export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang" + export CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang" + export CXX="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang++" + export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}" + npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 + turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-linux-android + ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-strip packages/next-swc/native/next-swc.*.node + - host: ubuntu-latest + target: armv7-linux-androideabi + build: | + export CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang" + export CC="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang" + export CXX="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi24-clang++" + export PATH="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin:${PATH}" + npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 + turbo run build-native --cache-dir=".turbo" -- --release --target armv7-linux-androideabi + ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip packages/next-swc/native/next-swc.*.node + - host: ubuntu-latest + target: 'aarch64-unknown-linux-musl' + docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine + build: >- + set -e && + npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 && + rustup toolchain install nightly-2021-11-15 && + rustup default nightly-2021-11-15 && + rustup target add aarch64-unknown-linux-musl && + turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-unknown-linux-musl && + llvm-strip -x packages/next-swc/native/next-swc.*.node + - host: windows-latest + target: 'aarch64-pc-windows-msvc' + build: | + npm i -g @napi-rs/cli@2.4.4 turbo@1.0.28 + turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-pc-windows-msvc + if: ${{ needs.build.outputs.isRelease == 'true' }} + needs: build + name: stable - ${{ matrix.settings.target }} - node@16 + runs-on: ${{ matrix.settings.host }} steps: # https://github.com/actions/virtual-environments/issues/1187 - name: tune linux network run: sudo ethtool -K eth0 tx off rx off - if: ${{ matrix.os == 'ubuntu-18.04' }} + if: ${{ matrix.settings.host == 'ubuntu-18.04' }} + - name: tune linux network + run: sudo ethtool -K eth0 tx off rx off + if: ${{ matrix.settings.host == 'ubuntu-latest' }} - name: tune windows network run: Disable-NetAdapterChecksumOffload -Name * -TcpIPv4 -UdpIPv4 -TcpIPv6 -UdpIPv6 - if: ${{ matrix.os == 'windows-latest' }} + if: ${{ matrix.settings.host == 'windows-latest' }} - name: tune mac network run: sudo sysctl -w net.link.generic.system.hwcksum_tx=0 && sudo sysctl -w net.link.generic.system.hwcksum_rx=0 - if: ${{ matrix.os == 'macos-latest' }} - - - name: Setup node - uses: actions/setup-node@v2 - with: - node-version: 14 - check-latest: true - + if: ${{ matrix.settings.host == 'macos-latest' }} # we use checkout here instead of the build cache since # it can fail to restore in different OS' - uses: actions/checkout@v2 - - # since the repo's dependencies aren't installed we need - # to install napi globally - - run: npm i -g @napi-rs/cli@1.2.1 - - run: npm i -g turbo@1.0.28 - - - name: Install - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2021-11-15 - target: ${{ matrix.target }} - - - name: Cache cargo registry - uses: actions/cache@v1 - with: - path: ~/.cargo/registry - key: stable-${{ matrix.os }}-node@14-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }} - - - name: Cache cargo index - uses: actions/cache@v1 - with: - path: ~/.cargo/git - key: stable-${{ matrix.os }}-node@14-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }} - - - name: Turbo cache - id: turbo-cache - uses: actions/cache@v2 - with: - path: .turbo - key: turbo-${{ github.job }}-${{ matrix.name }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }} - restore-keys: | - turbo-${{ github.job }}-${{ matrix.name }}- - turbo-${{ github.job }}-${{ matrix.name }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}- - turbo-${{ github.job }}-${{ matrix.name }}-canary-${{ needs.build.outputs.weekNum }}- - - - name: Cross build aarch64 setup - if: ${{ matrix.target == 'aarch64-apple-darwin' }} - run: | - sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*; - export CC=$(xcrun -f clang); - export CXX=$(xcrun -f clang++); - SYSROOT=$(xcrun --sdk macosx --show-sdk-path); - export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT"; # We use restore-key to pick latest cache. # We will not get exact match, but doc says # "If there are multiple partial matches for a restore key, the action returns the most recently created cache." @@ -844,65 +877,9 @@ jobs: uses: actions/cache@v2 with: path: ./packages/next-swc/target - key: next-swc-cargo-cache-${{ matrix.os }}--${{ hashFiles('**/Cargo.lock') }} + key: next-swc-cargo-cache-${{ matrix.settings.target }}--${{ hashFiles('**/Cargo.lock') }} restore-keys: | - next-swc-cargo-cache-${{ matrix.os }} - - - name: 'Build' - shell: bash - run: turbo run build-native --cache-dir=".turbo" -- --release --target ${{ matrix.target }} - env: - MACOSX_DEPLOYMENT_TARGET: '10.13' - - - name: Upload artifact - uses: actions/upload-artifact@v2.2.4 - with: - name: next-swc-binaries - path: packages/next-swc/native/next-swc.${{ matrix.name }}.node - - - name: Clear the cargo caches - run: | - cargo install cargo-cache --no-default-features --features ci-autoclean - cargo-cache - - build-windows-i686: - needs: build - if: ${{ needs.build.outputs.isRelease == 'true' }} - name: next-swc - windows-i686 - node@14 - runs-on: windows-latest - env: - CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 32 - CARGO_PROFILE_RELEASE_LTO: 'false' - steps: - - name: Install node x86 - run: | - choco install nodejs-lts --x86 -y --force - refreshenv - - - name: Set 32bit Node.js path - run: | - echo "C:\\Program Files (x86)\\nodejs" >> $GITHUB_PATH - shell: bash - - - name: Node.js arch - run: node -e "console.log(process.arch)" - - # we use checkout here instead of the build cache since - # it can fail to restore in different OS' - - uses: actions/checkout@v2 - - # since the repo's dependencies aren't installed we need - # to install napi globally - - run: npm i -g @napi-rs/cli@1.2.1 - - run: npm i -g turbo@1.0.28 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2021-11-15 - override: true - target: i686-pc-windows-msvc - + next-swc-cargo-cache-${{ matrix.settings.target }} - name: Turbo Cache id: turbo-cache uses: actions/cache@v2 @@ -914,349 +891,58 @@ jobs: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}- turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}- - - name: Build - shell: bash - run: turbo run build-native --cache-dir=".turbo" -- --release --target i686-pc-windows-msvc - - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: next-swc-binaries - path: packages/next-swc/native/next-swc.win32-ia32-msvc.node - - build-windows-aarch64: - needs: build - if: ${{ needs.build.outputs.isRelease == 'true' }} - name: next-swc - windows-aarch64 - node@14 - runs-on: windows-latest - steps: - name: Setup node uses: actions/setup-node@v2 + if: ${{ !matrix.settings.docker }} with: - node-version: 14 - - # we use checkout here instead of the build cache since - # it can fail to restore in different OS' - - uses: actions/checkout@v2 - - # since the repo's dependencies aren't installed we need - # to install napi globally - - run: npm i -g @napi-rs/cli@1.2.1 - - run: npm i -g turbo@1.0.28 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2021-11-15 - override: true - target: aarch64-pc-windows-msvc - - - name: Turbo Cache - id: turbo-cache - uses: actions/cache@v2 - with: - path: .turbo - key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }} - restore-keys: | - turbo-${{ github.job }}- - turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}- - turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}- - - - name: Build - shell: bash - run: turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-pc-windows-msvc - - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: next-swc-binaries - path: packages/next-swc/native/next-swc.win32-arm64-msvc.node - - build-linux-musl: - needs: build - if: ${{ needs.build.outputs.isRelease == 'true' }} - name: next-swc - linux-musl - node@lts - runs-on: ubuntu-latest - steps: - # we use checkout here instead of the build cache since - # it can fail to restore in different OS' - - uses: actions/checkout@v2 - - - name: Login to registry - run: | - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD $DOCKER_REGISTRY_URL - env: - DOCKER_REGISTRY_URL: ghcr.io - DOCKER_USERNAME: ${{ github.actor }} - DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} - - - name: Cache - uses: actions/cache@v2 - with: - path: | - target/ - key: linux-musl-publish-integration - - - name: Pull docker image - run: | - docker pull ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine - docker tag ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine builder - - - name: Turbo Cache - id: turbo-cache - uses: actions/cache@v2 - with: - path: .turbo - key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }} - restore-keys: | - turbo-${{ github.job }}- - turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}- - turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}- - - - name: 'Build' - run: | - docker run --rm -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry -v $(pwd):/build -w /build builder sh -c "npm i -g @napi-rs/cli@1.2.1 && npm i -g turbo@1.0.28 && turbo run build-native --cache-dir=".turbo" -- --release --target x86_64-unknown-linux-musl" - - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: next-swc-binaries - path: packages/next-swc/native/next-swc.linux-x64-musl.node - - build-linux-aarch64-gnu: - needs: build - if: ${{ needs.build.outputs.isRelease == 'true' }} - name: next-swc - aarch64-unknown-linux-gnu - node@14 - runs-on: ubuntu-18.04 - steps: - - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset - - - name: Setup node - uses: actions/setup-node@v2 - with: - node-version: 14 - - # we use checkout here instead of the build cache since - # it can fail to restore in different OS' - - uses: actions/checkout@v2 - - # since the repo's dependencies aren't installed we need - # to install napi globally - - run: npm i -g @napi-rs/cli@1.2.1 - - run: npm i -g turbo@1.0.28 - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2021-11-15 - override: true - target: aarch64-unknown-linux-gnu - - - name: Cache - uses: actions/cache@v2 - with: - path: | - target/ - key: aarch64-linux-gnu-publish-integration - - - name: Install cross compile toolchain - run: | - sudo apt-get update - sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu -y - - - name: Turbo Cache - id: turbo-cache - uses: actions/cache@v2 - with: - path: .turbo - key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }} - restore-keys: | - turbo-${{ github.job }}- - turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}- - turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}- - - - name: Cross build aarch64 - if: ${{ steps.binary-cache.outputs.cache-hit != 'true' }} - run: turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-unknown-linux-gnu - - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: next-swc-binaries - path: packages/next-swc/native/next-swc.linux-arm64-gnu.node - - build-linux-aarch64-musl: - needs: build - if: ${{ needs.build.outputs.isRelease == 'true' }} - name: next-swc - aarch64-unknown-linux-musl - node@14 - runs-on: ubuntu-18.04 - steps: - - name: Setup node - uses: actions/setup-node@v2 - with: - node-version: 14 - - # we use checkout here instead of the build cache since - # it can fail to restore in different OS' - - uses: actions/checkout@v2 + node-version: 16 + check-latest: true + cache: yarn - # since the repo's dependencies aren't installed we need - # to install napi globally - - run: npm i -g @napi-rs/cli@1.2.1 - - run: npm i -g turbo@1.0.28 - - name: Install Rust + - name: Install uses: actions-rs/toolchain@v1 + if: ${{ !matrix.settings.docker }} with: profile: minimal - toolchain: nightly-2021-11-15 override: true - target: aarch64-unknown-linux-musl - - - name: Cache - uses: actions/cache@v2 - with: - path: | - target/ - key: aarch64-linux-musl-publish-integration - - - name: Install cross compile toolchain - run: | - sudo apt-get update - sudo apt-get install gcc-aarch64-linux-gnu -y - - - name: Turbo Cache - id: turbo-cache - uses: actions/cache@v2 - with: - path: .turbo - key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }} - restore-keys: | - turbo-${{ github.job }}- - turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}- - turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}- - - - name: Cross build aarch64 - run: turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-unknown-linux-musl - - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: next-swc-binaries - path: packages/next-swc/native/next-swc.linux-arm64-musl.node - - build-linux-arm7: - needs: build - if: ${{ needs.build.outputs.isRelease == 'true' }} - name: next-swc - arm7-unknown-linux-gnu - node@14 - runs-on: ubuntu-18.04 - steps: - - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset - - - name: Setup node - uses: actions/setup-node@v2 - with: - node-version: 14 - - # we use checkout here instead of the build cache since - # it can fail to restore in different OS' - - uses: actions/checkout@v2 - - # since the repo's dependencies aren't installed we need - # to install napi globally - - run: npm i -g @napi-rs/cli@1.2.1 - - run: npm i -g turbo@1.0.28 - - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal toolchain: nightly-2021-11-15 - override: true - target: armv7-unknown-linux-gnueabihf + target: ${{ matrix.settings.target }} - - name: Cache + - name: Cache cargo registry uses: actions/cache@v2 with: - path: | - target/ - key: arm7-linux-gnu-publish-integration - - - name: Install cross compile toolchain - run: | - sudo apt-get update - sudo apt-get install gcc-arm-linux-gnueabihf -y + path: ~/.cargo/registry + key: ${{ matrix.settings.target }}-cargo-registry - - name: Turbo Cache - id: turbo-cache + - name: Cache cargo index uses: actions/cache@v2 with: - path: .turbo - key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }} - restore-keys: | - turbo-${{ github.job }}- - turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}- - turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}- - - - name: Cross build aarch64 - run: turbo run build-native --cache-dir=".turbo" -- --release --target armv7-unknown-linux-gnueabihf - - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: next-swc-binaries - path: packages/next-swc/native/next-swc.linux-arm-gnueabihf.node - - build-android-aarch64: - needs: build - if: ${{ needs.build.outputs.isRelease == 'true' }} - name: next-swc - Android - aarch64 - runs-on: macos-latest - steps: - - name: Setup node - uses: actions/setup-node@v2 - with: - node-version: 14 - - # we use checkout here instead of the build cache since - # it can fail to restore in different OS' - - uses: actions/checkout@v2 - - # since the repo's dependencies aren't installed we need - # to install napi globally - - run: npm i -g @napi-rs/cli@1.2.1 - - run: npm i -g turbo@1.0.28 + path: ~/.cargo/git + key: ${{ matrix.settings.target }}-cargo-index - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly-2021-11-15 - override: true - target: aarch64-linux-android + - name: Setup toolchain + run: ${{ matrix.settings.setup }} + if: ${{ matrix.settings.setup }} + shell: bash - - name: Turbo Cache - id: turbo-cache - uses: actions/cache@v2 + - name: Build in docker + uses: addnab/docker-run-action@v3 + if: ${{ matrix.settings.docker }} with: - path: .turbo - key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}-${{ github.sha }} - restore-keys: | - turbo-${{ github.job }}- - turbo-${{ github.job }}-${{ github.ref_name }}-${{ needs.build.outputs.weekNum }}- - turbo-${{ github.job }}-canary-${{ needs.build.outputs.weekNum }}- + image: ${{ matrix.settings.docker }} + options: -v ${{ env.HOME }}/.cargo/git:/root/.cargo/git -v ${{ env.HOME }}/.cargo/registry:/root/.cargo/registry -v ${{ github.workspace }}:/build -w /build + run: ${{ matrix.settings.build }} - - name: Build + - name: 'Build' + run: ${{ matrix.settings.build }} + if: ${{ !matrix.settings.docker }} shell: bash - run: | - export CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android24-clang" - turbo run build-native --cache-dir=".turbo" -- --release --target aarch64-linux-android - name: Upload artifact uses: actions/upload-artifact@v2 with: name: next-swc-binaries - path: packages/next-swc/native/next-swc.android-arm64.node + path: packages/next-swc/native/next-swc.*.node build-wasm: needs: build diff --git a/packages/next-swc/.cargo/config.toml b/packages/next-swc/.cargo/config.toml index 1fb099927fed8fb..1d7e537b13c3128 100644 --- a/packages/next-swc/.cargo/config.toml +++ b/packages/next-swc/.cargo/config.toml @@ -21,7 +21,7 @@ rustflags = [ ] [target.aarch64-unknown-linux-musl] -linker = "aarch64-linux-gnu-gcc" +linker = "aarch64-linux-musl-gcc" rustflags = [ "-C", "target-feature=-crt-static", diff --git a/packages/next-swc/crates/napi/npm/android-arm-eabi/README.md b/packages/next-swc/crates/napi/npm/android-arm-eabi/README.md new file mode 100644 index 000000000000000..7044554db68c738 --- /dev/null +++ b/packages/next-swc/crates/napi/npm/android-arm-eabi/README.md @@ -0,0 +1,3 @@ +# `@next/swc-android-arm-eabi` + +This is the **android-arm-eabi** binary for `@next/swc` diff --git a/packages/next-swc/crates/napi/npm/android-arm-eabi/package.json b/packages/next-swc/crates/napi/npm/android-arm-eabi/package.json new file mode 100644 index 000000000000000..69ec8a4b23a91b1 --- /dev/null +++ b/packages/next-swc/crates/napi/npm/android-arm-eabi/package.json @@ -0,0 +1,18 @@ +{ + "name": "@next/swc-android-arm-eabi", + "version": "0.0.0", + "os": [ + "android" + ], + "cpu": [ + "arm" + ], + "main": "next-swc.android-arm-eabi.node", + "files": [ + "next-swc.android-arm-eabi.node" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/packages/next-swc/package.json b/packages/next-swc/package.json index 9f16469b8681278..f71acc377734807 100644 --- a/packages/next-swc/package.json +++ b/packages/next-swc/package.json @@ -16,6 +16,7 @@ "armv7-unknown-linux-gnueabihf", "aarch64-apple-darwin", "aarch64-linux-android", + "arm-linux-androideabi", "x86_64-unknown-freebsd", "x86_64-unknown-linux-musl", "aarch64-unknown-linux-musl", diff --git a/packages/next/package.json b/packages/next/package.json index 316aee06f97a5cf..d681c2e8b8a1912 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -115,7 +115,7 @@ "@babel/traverse": "7.15.0", "@babel/types": "7.15.0", "@hapi/accept": "5.0.2", - "@napi-rs/cli": "1.2.1", + "@napi-rs/cli": "2.4.4", "@napi-rs/triples": "1.0.3", "@next/polyfill-module": "12.1.0", "@next/polyfill-nomodule": "12.1.0", diff --git a/scripts/install-native.mjs b/scripts/install-native.mjs index a52305df8881b9b..198b6385e13ba4a 100644 --- a/scripts/install-native.mjs +++ b/scripts/install-native.mjs @@ -19,6 +19,7 @@ import fs from 'fs-extra' version: '1.0.0', optionalDependencies: { '@next/swc-android-arm64': 'canary', + '@next/swc-android-arm-eabi': 'canary', '@next/swc-darwin-arm64': 'canary', '@next/swc-darwin-x64': 'canary', '@next/swc-linux-arm-gnueabihf': 'canary', diff --git a/yarn.lock b/yarn.lock index 1ee4e9b20c7e89b..08be08516ea17f6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3706,10 +3706,10 @@ call-me-maybe "^1.0.1" glob-to-regexp "^0.3.0" -"@napi-rs/cli@1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@napi-rs/cli/-/cli-1.2.1.tgz#eccdf9e0835aec3adcef30074bf69c110ea65960" - integrity sha512-7FoYn1JSK5rTIG9KcKfYnZL/O0UjUMMuzZCXd//bJdkLw0Xx9EqQJs1X/Mg4KqywJYb79LDfxRMiJRSukPGDNw== +"@napi-rs/cli@2.4.4": + version "2.4.4" + resolved "https://registry.yarnpkg.com/@napi-rs/cli/-/cli-2.4.4.tgz#878a38f0fba1709d89d66eba706745ce728a61a5" + integrity sha512-f+tvwCv1ka24dBqI2DgBhR7Oxl3DKHOp4onxLXwyBFt6iCADnr3YZIr1/2Iq5r3uqxFgaf01bfPsRQZPkEp0kQ== "@napi-rs/triples@1.0.3", "@napi-rs/triples@^1.0.3": version "1.0.3"