Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback bindings does not support filesystem access in Github Action #5837

Closed
nephix opened this issue Sep 12, 2022 · 17 comments
Closed

Fallback bindings does not support filesystem access in Github Action #5837

nephix opened this issue Sep 12, 2022 · 17 comments

Comments

@nephix
Copy link

nephix commented Sep 12, 2022

Describe the bug

When I compile our project locally it works like a charm:

$  npm run build

> [email protected] build
> rimraf dist && npx swc src --out-dir dist --copy-files

Successfully compiled: 269 files, copied 2 files with swc (115.65ms)

When I compile our project in a GitHub action using the same npm run build command it fails.

Input code

No response

Config

{
  "module": {
    "type": "commonjs",
    "ignoreDynamic": true
  },
  "jsc": {
    "target": "es2018",
    "parser": {
      "syntax": "typescript",
      "dynamicImport": true,
      "decorators": true
    },
    "paths": {
      "@app/*": ["./src/*"],
      "@test/*": ["./test/*"]
    },
    "transform": {
      "legacyDecorator": true,
      "decoratorMetadata": true
    }
  },
  "minify": false
}

Playground link

No response

Expected behavior

SWC compiles our code in a GitHub action

Actual behavior

In the Github Action I get

> [email protected] build
> rimraf dist && npx swc src --out-dir dist --copy-files

Fallback bindings does not support filesystem access. # <-- this message gets repeated a lot, I'd assume 269 times
...

Error: Failed to compile:
... 

long list of files

Version

"@swc/core": "^1.2.244"

Additional context

No response

@kwonoj
Copy link
Member

kwonoj commented Sep 12, 2022

Fallback binding doesn't support filesystem itself isn't a bug, but there's lacks of info what env action actually runs makes swc picks up fallback bindings.

@nephix
Copy link
Author

nephix commented Sep 12, 2022

The GH action runs on ubuntu-latest. Is there anything I can do to provide more infos? Can't really share the repo unfortunately. How does swc determine the env and whether it should fall back to the fallback bindings?

@kwonoj
Copy link
Member

kwonoj commented Sep 12, 2022

ubuntu-latest supposed to work with native binaries. If you can't share the repo / or what's happening in the actions, unfortunately you may need to dig to figure out why native binaries are not being installed correctly as we do not have way to figure out those.

@kwonoj
Copy link
Member

kwonoj commented Sep 12, 2022

How does swc determine the env and whether it should fall back to the fallback bindings

Only if native binaries cannot be installed somehow at this moment.

@nephix
Copy link
Author

nephix commented Sep 12, 2022

I checked the npm install output and there was nothing indicating an error during swc installation.

Do you have any advice on what I could do to debug this?

@kwonoj
Copy link
Member

kwonoj commented Sep 12, 2022

Most straight forward debugging process is

  1. check if binary is correctly (physically) installed under node_modules
  2. try to require those native bindings directly, and try to invoke few api to see if it's correctly working

as those are the conditions fallback bindings kick in if any of above fails.

@nephix
Copy link
Author

nephix commented Sep 12, 2022

Here's the content of the @swc package after running npm install:

ls -alR node_modules/@swc
node_modules/@swc:
total 88
drwxr-xr-x    6 runner docker  4096 Sep 12 19:07 .
drwxr-xr-x 1951 runner docker 69632 Sep 12 19:07 ..
drwxr-xr-x    5 runner docker  4096 Sep 12 19:05 cli
drwxr-xr-x    2 runner docker  4096 Sep 12 19:06 core
drwxr-xr-x    5 runner docker  4096 Sep 12 19:05 helpers
drwxr-xr-x    2 runner docker  4096 Sep 12 19:06 wasm

node_modules/@swc/cli:
total 28
drwxr-xr-x 5 runner docker 4096 Sep 12 19:05 .
drwxr-xr-x 6 runner docker 4096 Sep 12 19:07 ..
-rw-r--r-- 1 runner docker  229 Sep 12 19:05 README.md
drwxr-xr-x 2 runner docker 4096 Sep 12 19:05 bin
drwxr-xr-x 4 runner docker 4096 Sep 12 19:05 lib
drwxr-xr-x 3 runner docker 4096 Sep 12 19:05 node_modules
-rw-r--r-- 1 runner docker 2011 Sep 12 19:05 package.json

node_modules/@swc/cli/bin:
total 16
drwxr-xr-x 2 runner docker 4096 Sep 12 19:05 .
drwxr-xr-x 5 runner docker 4096 Sep 12 19:05 ..
-rwxr-xr-x 1 runner docker   71 Sep 12 19:05 spack.js
-rwxr-xr-x 1 runner docker   67 Sep 12 19:05 swc.js

node_modules/@swc/cli/lib:
total 16
drwxr-xr-x 4 runner docker 4096 Sep 12 19:05 .
drwxr-xr-x 5 runner docker 4096 Sep 12 19:05 ..
drwxr-xr-x 2 runner docker 4096 Sep 12 19:05 spack
drwxr-xr-x 4 runner docker 4096 Sep 12 19:05 swc

node_modules/@swc/cli/lib/spack:
total 56
drwxr-xr-x 2 runner docker  4096 Sep 12 19:05 .
drwxr-xr-x 4 runner docker  4096 Sep 12 19:05 ..
-rw-r--r-- 1 runner docker  2708 Sep 12 19:05 index.js
-rw-r--r-- 1 runner docker  5804 Sep 12 19:05 index.js.map
-rw-r--r-- 1 runner docker 12842 Sep 12 19:05 options.js
-rw-r--r-- 1 runner docker 16466 Sep 12 19:05 options.js.map

node_modules/@swc/cli/lib/swc:
total 148
drwxr-xr-x 4 runner docker  4096 Sep 12 19:05 .
drwxr-xr-x 4 runner docker  4096 Sep 12 19:05 ..
drwxr-xr-x 2 runner docker  4096 Sep 12 19:05 __mocks__
drwxr-xr-x 2 runner docker  4096 Sep 12 19:05 __tests__
-rw-r--r-- 1 runner docker  2429 Sep 12 19:05 compile.js
-rw-r--r-- 1 runner docker  5144 Sep 12 19:05 compile.js.map
-rw-r--r-- 1 runner docker   545 Sep 12 19:05 constants.js
-rw-r--r-- 1 runner docker   566 Sep 12 19:05 constants.js.map
-rw-r--r-- 1 runner docker  8547 Sep 12 19:05 dir.js
-rw-r--r-- 1 runner docker 18497 Sep 12 19:05 dir.js.map
-rw-r--r-- 1 runner docker  7690 Sep 12 19:05 file.js
-rw-r--r-- 1 runner docker 13804 Sep 12 19:05 file.js.map
-rw-r--r-- 1 runner docker  1360 Sep 12 19:05 index.js
-rw-r--r-- 1 runner docker  1348 Sep 12 19:05 index.js.map
-rw-r--r-- 1 runner docker  6205 Sep 12 19:05 options.js
-rw-r--r-- 1 runner docker 12922 Sep 12 19:05 options.js.map
-rw-r--r-- 1 runner docker  3725 Sep 12 19:05 sources.js
-rw-r--r-- 1 runner docker  6097 Sep 12 19:05 sources.js.map
-rw-r--r-- 1 runner docker  3786 Sep 12 19:05 util.js
-rw-r--r-- 1 runner docker  6662 Sep 12 19:05 util.js.map

node_modules/@swc/cli/lib/swc/__mocks__:
total 16
drwxr-xr-x 2 runner docker 4096 Sep 12 19:05 .
drwxr-xr-x 4 runner docker 4096 Sep 12 19:05 ..
-rw-r--r-- 1 runner docker  733 Sep 12 19:05 fs.js
-rw-r--r-- 1 runner docker 1942 Sep 12 19:05 fs.js.map

node_modules/@swc/cli/lib/swc/__tests__:
total 60
drwxr-xr-x 2 runner docker  4096 Sep 12 19:05 .
drwxr-xr-x 4 runner docker  4096 Sep 12 19:05 ..
-rw-r--r-- 1 runner docker   663 Sep 12 19:05 compile.test.js
-rw-r--r-- 1 runner docker  1494 Sep 12 19:05 compile.test.js.map
-rw-r--r-- 1 runner docker  9854 Sep 12 19:05 options.test.js
-rw-r--r-- 1 runner docker 14077 Sep 12 19:05 options.test.js.map
-rw-r--r-- 1 runner docker  4263 Sep 12 19:05 sources.test.js
-rw-r--r-- 1 runner docker  6965 Sep 12 19:05 sources.test.js.map

node_modules/@swc/cli/node_modules:
total 12
drwxr-xr-x 3 runner docker 4096 Sep 12 19:05 .
drwxr-xr-x 5 runner docker 4096 Sep 12 19:05 ..
drwxr-xr-x 4 runner docker 4096 Sep 12 19:06 source-map

node_modules/@swc/cli/node_modules/source-map:
total 72
drwxr-xr-x 4 runner docker  4096 Sep 12 19:06 .
drwxr-xr-x 3 runner docker  4096 Sep 12 19:05 ..
-rw-r--r-- 1 runner docker  1526 Sep 12 19:06 LICENSE
-rw-r--r-- 1 runner docker 26782 Sep 12 19:06 README.md
drwxr-xr-x 2 runner docker  4096 Sep 12 19:06 dist
drwxr-xr-x 2 runner docker  4096 Sep 12 19:06 lib
-rw-r--r-- 1 runner docker  3214 Sep 12 19:06 package.json
-rw-r--r-- 1 runner docker 13289 Sep 12 19:06 source-map.d.ts
-rw-r--r-- 1 runner docker   405 Sep 12 19:06 source-map.js

node_modules/@swc/cli/node_modules/source-map/dist:
total 40
drwxr-xr-x 2 runner docker  4096 Sep 12 19:06 .
drwxr-xr-x 4 runner docker  4096 Sep 12 19:06 ..
-rw-r--r-- 1 runner docker 30193 Sep 12 19:06 source-map.js

node_modules/@swc/cli/node_modules/source-map/lib:
total 180
drwxr-xr-x 2 runner docker  4096 Sep 12 19:06 .
drwxr-xr-x 4 runner docker  4096 Sep 12 19:06 ..
-rw-r--r-- 1 runner docker  2398 Sep 12 19:06 array-set.js
-rw-r--r-- 1 runner docker  3945 Sep 12 19:06 base64-vlq.js
-rw-r--r-- 1 runner docker   579 Sep 12 19:06 base64.js
-rw-r--r-- 1 runner docker  4189 Sep 12 19:06 binary-search.js
-rw-r--r-- 1 runner docker  2288 Sep 12 19:06 mapping-list.js
-rw-r--r-- 1 runner docker 48693 Sep 12 19:06 mappings.wasm
-rw-r--r-- 1 runner docker  1684 Sep 12 19:06 read-wasm.js
-rw-r--r-- 1 runner docker 41763 Sep 12 19:06 source-map-consumer.js
-rw-r--r-- 1 runner docker 13791 Sep 12 19:06 source-map-generator.js
-rw-r--r-- 1 runner docker 13730 Sep 12 19:06 source-node.js
-rw-r--r-- 1 runner docker 14214 Sep 12 19:06 util.js
-rw-r--r-- 1 runner docker  3317 Sep 12 19:06 wasm.js

node_modules/@swc/core:
total 648
drwxr-xr-x 2 runner docker   4096 Sep 12 19:06 .
drwxr-xr-x 6 runner docker   4096 Sep 12 19:07 ..
-rw-r--r-- 1 runner docker 420945 Sep 12 19:05 CHANGELOG.md
-rw-r--r-- 1 runner docker  10846 Sep 12 19:05 LICENSE
-rw-r--r-- 1 runner docker   4054 Sep 12 19:05 README.md
-rw-r--r-- 1 runner docker  17253 Sep 12 19:05 Visitor.d.ts
-rw-r--r-- 1 runner docker  47218 Sep 12 19:05 Visitor.js
-rw-r--r-- 1 runner docker    492 Sep 12 19:05 binding.d.ts
-rw-r--r-- 1 runner docker   9613 Sep 12 19:05 binding.js
-rw-r--r-- 1 runner docker   5101 Sep 12 19:05 index.d.ts
-rw-r--r-- 1 runner docker  18299 Sep 12 19:05 index.js
-rw-r--r-- 1 runner docker   5213 Sep 12 19:05 package.json
-rw-r--r-- 1 runner docker   6805 Sep 12 19:05 postinstall.js
-rwxr-xr-x 1 runner docker   3494 Sep 12 19:05 run_swcx.js
-rw-r--r-- 1 runner docker   1252 Sep 12 19:05 spack.d.ts
-rw-r--r-- 1 runner docker   3325 Sep 12 19:05 spack.js
-rw-r--r-- 1 runner docker  58570 Sep 12 19:05 types.d.ts
-rw-r--r-- 1 runner docker     77 Sep 12 19:05 types.js
-rw-r--r-- 1 runner docker     58 Sep 12 19:05 util.d.ts
-rw-r--r-- 1 runner docker   3097 Sep 12 19:05 util.js

node_modules/@swc/helpers:
total 24
drwxr-xr-x 5 runner docker 4096 Sep 12 19:05 .
drwxr-xr-x 6 runner docker 4096 Sep 12 19:07 ..
drwxr-xr-x 2 runner docker 4096 Sep 12 19:05 lib
-rw-r--r-- 1 runner docker  866 Sep 12 19:05 package.json
drwxr-xr-x 2 runner docker 4096 Sep 12 19:05 scripts
drwxr-xr-x 2 runner docker 4096 Sep 12 19:06 src

node_modules/@swc/helpers/lib:
total 392
drwxr-xr-x 2 runner docker  4096 Sep 12 19:05 .
drwxr-xr-x 5 runner docker  4096 Sep 12 19:05 ..
-rw-r--r-- 1 runner docker  1282 Sep 12 19:05 _apply_decorated_descriptor.js
-rw-r--r-- 1 runner docker   308 Sep 12 19:05 _array_like_to_array.js
-rw-r--r-- 1 runner docker   190 Sep 12 19:05 _array_with_holes.js
-rw-r--r-- 1 runner docker   432 Sep 12 19:05 _array_without_holes.js
-rw-r--r-- 1 runner docker   310 Sep 12 19:05 _assert_this_initialized.js
-rw-r--r-- 1 runner docker  2623 Sep 12 19:05 _async_generator.js
-rw-r--r-- 1 runner docker  1184 Sep 12 19:05 _async_generator_delegate.js
-rw-r--r-- 1 runner docker   584 Sep 12 19:05 _async_iterator.js
-rw-r--r-- 1 runner docker   980 Sep 12 19:05 _async_to_generator.js
-rw-r--r-- 1 runner docker   395 Sep 12 19:05 _await_async_generator.js
-rw-r--r-- 1 runner docker   170 Sep 12 19:05 _await_value.js
-rw-r--r-- 1 runner docker   330 Sep 12 19:05 _check_private_redeclaration.js
-rw-r--r-- 1 runner docker   827 Sep 12 19:05 _class_apply_descriptor_destructure.js
-rw-r--r-- 1 runner docker   292 Sep 12 19:05 _class_apply_descriptor_get.js
-rw-r--r-- 1 runner docker   616 Sep 12 19:05 _class_apply_descriptor_set.js
-rw-r--r-- 1 runner docker   931 Sep 12 19:05 _class_apply_descriptor_update.js
-rw-r--r-- 1 runner docker   286 Sep 12 19:05 _class_call_check.js
-rw-r--r-- 1 runner docker   324 Sep 12 19:05 _class_check_private_static_access.js
-rw-r--r-- 1 runner docker   359 Sep 12 19:05 _class_check_private_static_field_descriptor.js
-rw-r--r-- 1 runner docker   371 Sep 12 19:05 _class_extract_field_descriptor.js
-rw-r--r-- 1 runner docker   252 Sep 12 19:05 _class_name_tdz_error.js
-rw-r--r-- 1 runner docker   722 Sep 12 19:05 _class_private_field_destructure.js
-rw-r--r-- 1 runner docker   676 Sep 12 19:05 _class_private_field_get.js
-rw-r--r-- 1 runner docker   498 Sep 12 19:05 _class_private_field_init.js
-rw-r--r-- 1 runner docker   358 Sep 12 19:05 _class_private_field_loose_base.js
-rw-r--r-- 1 runner docker   230 Sep 12 19:05 _class_private_field_loose_key.js
-rw-r--r-- 1 runner docker   701 Sep 12 19:05 _class_private_field_set.js
-rw-r--r-- 1 runner docker   694 Sep 12 19:05 _class_private_field_update.js
-rw-r--r-- 1 runner docker   322 Sep 12 19:05 _class_private_method_get.js
-rw-r--r-- 1 runner docker   486 Sep 12 19:05 _class_private_method_init.js
-rw-r--r-- 1 runner docker   226 Sep 12 19:05 _class_private_method_set.js
-rw-r--r-- 1 runner docker   812 Sep 12 19:05 _class_static_private_field_destructure.js
-rw-r--r-- 1 runner docker   774 Sep 12 19:05 _class_static_private_field_spec_get.js
-rw-r--r-- 1 runner docker   799 Sep 12 19:05 _class_static_private_field_spec_set.js
-rw-r--r-- 1 runner docker   784 Sep 12 19:05 _class_static_private_field_update.js
-rw-r--r-- 1 runner docker  1342 Sep 12 19:05 _construct.js
-rw-r--r-- 1 runner docker   705 Sep 12 19:05 _create_class.js
-rw-r--r-- 1 runner docker  1098 Sep 12 19:05 _create_super.js
-rw-r--r-- 1 runner docker 13113 Sep 12 19:05 _decorate.js
-rw-r--r-- 1 runner docker   491 Sep 12 19:05 _defaults.js
-rw-r--r-- 1 runner docker   824 Sep 12 19:05 _define_enumerable_properties.js
-rw-r--r-- 1 runner docker   414 Sep 12 19:05 _define_property.js
-rw-r--r-- 1 runner docker   442 Sep 12 19:05 _export_star.js
-rw-r--r-- 1 runner docker   614 Sep 12 19:05 _extends.js
-rw-r--r-- 1 runner docker   962 Sep 12 19:05 _get.js
-rw-r--r-- 1 runner docker   402 Sep 12 19:05 _get_prototype_of.js
-rw-r--r-- 1 runner docker   788 Sep 12 19:05 _inherits.js
-rw-r--r-- 1 runner docker   311 Sep 12 19:05 _inherits_loose.js
-rw-r--r-- 1 runner docker   504 Sep 12 19:05 _initializer_define_property.js
-rw-r--r-- 1 runner docker   463 Sep 12 19:05 _initializer_warning_helper.js
-rw-r--r-- 1 runner docker   344 Sep 12 19:05 _instanceof.js
-rw-r--r-- 1 runner docker   235 Sep 12 19:05 _interop_require_default.js
-rw-r--r-- 1 runner docker  1288 Sep 12 19:05 _interop_require_wildcard.js
-rw-r--r-- 1 runner docker   224 Sep 12 19:05 _is_native_function.js
-rw-r--r-- 1 runner docker   503 Sep 12 19:05 _is_native_reflect_construct.js
-rw-r--r-- 1 runner docker   280 Sep 12 19:05 _iterable_to_array.js
-rw-r--r-- 1 runner docker   780 Sep 12 19:05 _iterable_to_array_limit.js
-rw-r--r-- 1 runner docker   481 Sep 12 19:05 _iterable_to_array_limit_loose.js
-rw-r--r-- 1 runner docker  1330 Sep 12 19:05 _jsx.js
-rw-r--r-- 1 runner docker   275 Sep 12 19:05 _new_arrow_check.js
-rw-r--r-- 1 runner docker   316 Sep 12 19:05 _non_iterable_rest.js
-rw-r--r-- 1 runner docker   315 Sep 12 19:05 _non_iterable_spread.js
-rw-r--r-- 1 runner docker   915 Sep 12 19:05 _object_spread.js
-rw-r--r-- 1 runner docker   970 Sep 12 19:05 _object_spread_props.js
-rw-r--r-- 1 runner docker   953 Sep 12 19:05 _object_without_properties.js
-rw-r--r-- 1 runner docker   488 Sep 12 19:05 _object_without_properties_loose.js
-rw-r--r-- 1 runner docker   634 Sep 12 19:05 _possible_constructor_return.js
-rw-r--r-- 1 runner docker   203 Sep 12 19:05 _read_only_error.js
-rw-r--r-- 1 runner docker  1739 Sep 12 19:05 _set.js
-rw-r--r-- 1 runner docker   383 Sep 12 19:05 _set_prototype_of.js
-rw-r--r-- 1 runner docker   278 Sep 12 19:05 _skip_first_generator_next.js
-rw-r--r-- 1 runner docker   814 Sep 12 19:05 _sliced_to_array.js
-rw-r--r-- 1 runner docker   856 Sep 12 19:05 _sliced_to_array_loose.js
-rw-r--r-- 1 runner docker   544 Sep 12 19:05 _super_prop_base.js
-rw-r--r-- 1 runner docker   359 Sep 12 19:05 _tagged_template_literal.js
-rw-r--r-- 1 runner docker   280 Sep 12 19:05 _tagged_template_literal_loose.js
-rw-r--r-- 1 runner docker   143 Sep 12 19:05 _throw.js
-rw-r--r-- 1 runner docker   796 Sep 12 19:05 _to_array.js
-rw-r--r-- 1 runner docker   828 Sep 12 19:05 _to_consumable_array.js
-rw-r--r-- 1 runner docker   750 Sep 12 19:05 _to_primitive.js
-rw-r--r-- 1 runner docker   537 Sep 12 19:05 _to_property_key.js
-rw-r--r-- 1 runner docker   244 Sep 12 19:05 _ts_decorate.js
-rw-r--r-- 1 runner docker   244 Sep 12 19:05 _ts_metadata.js
-rw-r--r-- 1 runner docker   241 Sep 12 19:05 _ts_param.js
-rw-r--r-- 1 runner docker   235 Sep 12 19:05 _type_of.js
-rw-r--r-- 1 runner docker   802 Sep 12 19:05 _unsupported_iterable_to_array.js
-rw-r--r-- 1 runner docker   457 Sep 12 19:05 _wrap_async_generator.js
-rw-r--r-- 1 runner docker  1683 Sep 12 19:05 _wrap_native_super.js
-rw-r--r-- 1 runner docker 20449 Sep 12 19:05 index.js

node_modules/@swc/helpers/scripts:
total 20
drwxr-xr-x 2 runner docker 4096 Sep 12 19:05 .
drwxr-xr-x 5 runner docker 4096 Sep 12 19:05 ..
-rwxr-xr-x 1 runner docker  190 Sep 12 19:05 build.sh
-rwxr-xr-x 1 runner docker   69 Sep 12 19:05 gen.sh
-rwxr-xr-x 1 runner docker  522 Sep 12 19:05 generator.sh

node_modules/@swc/helpers/src:
total 376
drwxr-xr-x 2 runner docker  4096 Sep 12 19:06 .
drwxr-xr-x 5 runner docker  4096 Sep 12 19:05 ..
-rw-r--r-- 1 runner docker  1081 Sep 12 19:05 _apply_decorated_descriptor.mjs
-rw-r--r-- 1 runner docker   201 Sep 12 19:05 _array_like_to_array.mjs
-rw-r--r-- 1 runner docker    87 Sep 12 19:05 _array_with_holes.mjs
-rw-r--r-- 1 runner docker   170 Sep 12 19:05 _array_without_holes.mjs
-rw-r--r-- 1 runner docker   193 Sep 12 19:05 _assert_this_initialized.mjs
-rw-r--r-- 1 runner docker  1988 Sep 12 19:05 _async_generator.mjs
-rw-r--r-- 1 runner docker   936 Sep 12 19:05 _async_generator_delegate.mjs
-rw-r--r-- 1 runner docker   439 Sep 12 19:05 _async_iterator.mjs
-rw-r--r-- 1 runner docker   786 Sep 12 19:05 _async_to_generator.mjs
-rw-r--r-- 1 runner docker   134 Sep 12 19:05 _await_async_generator.mjs
-rw-r--r-- 1 runner docker    71 Sep 12 19:05 _await_value.mjs
-rw-r--r-- 1 runner docker   210 Sep 12 19:05 _check_private_redeclaration.mjs
-rw-r--r-- 1 runner docker   614 Sep 12 19:05 _class_apply_descriptor_destructure.mjs
-rw-r--r-- 1 runner docker   172 Sep 12 19:05 _class_apply_descriptor_get.mjs
-rw-r--r-- 1 runner docker   460 Sep 12 19:05 _class_apply_descriptor_set.mjs
-rw-r--r-- 1 runner docker   818 Sep 12 19:05 _class_apply_descriptor_update.mjs
-rw-r--r-- 1 runner docker   176 Sep 12 19:06 _class_call_check.mjs
-rw-r--r-- 1 runner docker   202 Sep 12 19:06 _class_check_private_static_access.mjs
-rw-r--r-- 1 runner docker   226 Sep 12 19:06 _class_check_private_static_field_descriptor.mjs
-rw-r--r-- 1 runner docker   247 Sep 12 19:06 _class_extract_field_descriptor.mjs
-rw-r--r-- 1 runner docker   146 Sep 12 19:06 _class_name_tdz_error.mjs
-rw-r--r-- 1 runner docker   401 Sep 12 19:06 _class_private_field_destructure.mjs
-rw-r--r-- 1 runner docker   360 Sep 12 19:06 _class_private_field_get.mjs
-rw-r--r-- 1 runner docker   230 Sep 12 19:06 _class_private_field_init.mjs
-rw-r--r-- 1 runner docker   241 Sep 12 19:06 _class_private_field_loose_base.mjs
-rw-r--r-- 1 runner docker   119 Sep 12 19:06 _class_private_field_loose_key.mjs
-rw-r--r-- 1 runner docker   383 Sep 12 19:06 _class_private_field_set.mjs
-rw-r--r-- 1 runner docker   379 Sep 12 19:06 _class_private_field_update.mjs
-rw-r--r-- 1 runner docker   205 Sep 12 19:06 _class_private_method_get.mjs
-rw-r--r-- 1 runner docker   217 Sep 12 19:06 _class_private_method_init.mjs
-rw-r--r-- 1 runner docker   116 Sep 12 19:06 _class_private_method_set.mjs
-rw-r--r-- 1 runner docker   570 Sep 12 19:06 _class_static_private_field_destructure.mjs
-rw-r--r-- 1 runner docker   533 Sep 12 19:06 _class_static_private_field_spec_get.mjs
-rw-r--r-- 1 runner docker   556 Sep 12 19:06 _class_static_private_field_spec_set.mjs
-rw-r--r-- 1 runner docker   544 Sep 12 19:06 _class_static_private_field_update.mjs
-rw-r--r-- 1 runner docker   981 Sep 12 19:06 _construct.mjs
-rw-r--r-- 1 runner docker   580 Sep 12 19:06 _create_class.mjs
-rw-r--r-- 1 runner docker   749 Sep 12 19:06 _create_super.mjs
-rw-r--r-- 1 runner docker 11776 Sep 12 19:06 _decorate.mjs
-rw-r--r-- 1 runner docker   371 Sep 12 19:06 _defaults.mjs
-rw-r--r-- 1 runner docker   650 Sep 12 19:06 _define_enumerable_properties.mjs
-rw-r--r-- 1 runner docker   270 Sep 12 19:06 _define_property.mjs
-rw-r--r-- 1 runner docker   324 Sep 12 19:06 _export_star.mjs
-rw-r--r-- 1 runner docker   465 Sep 12 19:06 _extends.mjs
-rw-r--r-- 1 runner docker   646 Sep 12 19:06 _get.mjs
-rw-r--r-- 1 runner docker   287 Sep 12 19:06 _get_prototype_of.mjs
-rw-r--r-- 1 runner docker   496 Sep 12 19:06 _inherits.mjs
-rw-r--r-- 1 runner docker   205 Sep 12 19:06 _inherits_loose.mjs
-rw-r--r-- 1 runner docker   370 Sep 12 19:06 _initializer_define_property.mjs
-rw-r--r-- 1 runner docker   350 Sep 12 19:06 _initializer_warning_helper.mjs
-rw-r--r-- 1 runner docker   232 Sep 12 19:06 _instanceof.mjs
-rw-r--r-- 1 runner docker   119 Sep 12 19:06 _interop_require_default.mjs
-rw-r--r-- 1 runner docker  1076 Sep 12 19:06 _interop_require_wildcard.mjs
-rw-r--r-- 1 runner docker   119 Sep 12 19:06 _is_native_function.mjs
-rw-r--r-- 1 runner docker   393 Sep 12 19:06 _is_native_reflect_construct.mjs
-rw-r--r-- 1 runner docker   176 Sep 12 19:06 _iterable_to_array.mjs
-rw-r--r-- 1 runner docker   606 Sep 12 19:06 _iterable_to_array_limit.mjs
-rw-r--r-- 1 runner docker   352 Sep 12 19:06 _iterable_to_array_limit_loose.mjs
-rw-r--r-- 1 runner docker  1106 Sep 12 19:06 _jsx.mjs
-rw-r--r-- 1 runner docker   167 Sep 12 19:06 _new_arrow_check.mjs
-rw-r--r-- 1 runner docker   212 Sep 12 19:06 _non_iterable_rest.mjs
-rw-r--r-- 1 runner docker   209 Sep 12 19:06 _non_iterable_spread.mjs
-rw-r--r-- 1 runner docker   608 Sep 12 19:06 _object_spread.mjs
-rw-r--r-- 1 runner docker   828 Sep 12 19:06 _object_spread_props.mjs
-rw-r--r-- 1 runner docker   641 Sep 12 19:06 _object_without_properties.mjs
-rw-r--r-- 1 runner docker   351 Sep 12 19:06 _object_without_properties_loose.mjs
-rw-r--r-- 1 runner docker   310 Sep 12 19:06 _possible_constructor_return.mjs
-rw-r--r-- 1 runner docker   101 Sep 12 19:06 _read_only_error.mjs
-rw-r--r-- 1 runner docker  1248 Sep 12 19:06 _set.mjs
-rw-r--r-- 1 runner docker   264 Sep 12 19:06 _set_prototype_of.mjs
-rw-r--r-- 1 runner docker   154 Sep 12 19:06 _skip_first_generator_next.mjs
-rw-r--r-- 1 runner docker   423 Sep 12 19:06 _sliced_to_array.mjs
-rw-r--r-- 1 runner docker   450 Sep 12 19:06 _sliced_to_array_loose.mjs
-rw-r--r-- 1 runner docker   275 Sep 12 19:06 _super_prop_base.mjs
-rw-r--r-- 1 runner docker   226 Sep 12 19:06 _tagged_template_literal.mjs
-rw-r--r-- 1 runner docker   156 Sep 12 19:06 _tagged_template_literal_loose.mjs
-rw-r--r-- 1 runner docker    50 Sep 12 19:06 _throw.mjs
-rw-r--r-- 1 runner docker   401 Sep 12 19:06 _to_array.mjs
-rw-r--r-- 1 runner docker   423 Sep 12 19:06 _to_consumable_array.mjs
-rw-r--r-- 1 runner docker   459 Sep 12 19:06 _to_primitive.mjs
-rw-r--r-- 1 runner docker   229 Sep 12 19:06 _to_property_key.mjs
-rw-r--r-- 1 runner docker    46 Sep 12 19:06 _ts_decorate.mjs
-rw-r--r-- 1 runner docker    46 Sep 12 19:06 _ts_metadata.mjs
-rw-r--r-- 1 runner docker    43 Sep 12 19:06 _ts_param.mjs
-rw-r--r-- 1 runner docker   141 Sep 12 19:06 _type_of.mjs
-rw-r--r-- 1 runner docker   509 Sep 12 19:06 _unsupported_iterable_to_array.mjs
-rw-r--r-- 1 runner docker   192 Sep 12 19:06 _wrap_async_generator.mjs
-rw-r--r-- 1 runner docker  1170 Sep 12 19:06 _wrap_native_super.mjs
-rw-r--r-- 1 runner docker  6216 Sep 12 19:06 index.mjs

node_modules/@swc/wasm:
total 20512
drwxr-xr-x 2 runner docker     4096 Sep 12 19:06 .
drwxr-xr-x 6 runner docker     4096 Sep 12 19:07 ..
-rw-r--r-- 1 runner docker      390 Sep 12 19:06 package.json
-rw-r--r-- 1 runner docker    58758 Sep 12 19:06 wasm.d.ts
-rw-r--r-- 1 runner docker    11973 Sep 12 19:06 wasm.js
-rw-r--r-- 1 runner docker 20915745 Sep 12 19:06 wasm_bg.wasm

I noticed that locally on my mac m1 I have an additional:

node_modules/@swc/core-darwin-arm64/

Are these the bindings? Any idea why they could be missing in the github action?

@kwonoj
Copy link
Member

kwonoj commented Sep 12, 2022

Are you running codes in docker?

@nephix
Copy link
Author

nephix commented Sep 12, 2022

I would think the github action runs in some kind of docker container

Locally, I don't use docker

@kwonoj
Copy link
Member

kwonoj commented Sep 12, 2022

github action runs in some kind of docker container

No, not by default. Check your action config and remove docker if it's not explicitly required. Otherwise, this is dupe of #5616. I'll close this issue anyway since there's original issue can be tracked.

@kwonoj kwonoj closed this as completed Sep 12, 2022
@nephix
Copy link
Author

nephix commented Sep 12, 2022

https://gist.github.com/nephix/749cf7159478a59b37e6cbc4f235de7d that's our GH action, I don't think we explicitly require docker anywhere in other github actions, only for deployment

@nephix
Copy link
Author

nephix commented Sep 12, 2022

Ah ok, but funnily enough we compile the code in a docker container in AWS and that works without a problem

@iamjaredwalters
Copy link

iamjaredwalters commented Sep 12, 2022

Are you running codes in docker?

@kwonoj Why would this matter if deps are also installed in the same container and therefore same OS?

@kwonoj
Copy link
Member

kwonoj commented Sep 12, 2022

Why would this matter if deps are also installed in the same container and therefore same OS

We do not know exactly why on certain cases npm fails to install its optional deps for the specific platform when it's inside of docker. That's the reason original issue #5616 is currently bit hanging.

The way install optional deps for the swc is relying on npm's optional depedencies by specifying corresponding platforms, where swc does not controls its detection and installation.

@nephix
Copy link
Author

nephix commented Sep 13, 2022

Btw I switched from npm ci to npm install in our GH action workflow and now it works

Not ideal but at least a ✅

@github-actions
Copy link

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants