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

detect-libc returns glibc on Linux #203

Closed
cyjake opened this issue Jun 13, 2022 · 10 comments · Fixed by #205
Closed

detect-libc returns glibc on Linux #203

cyjake opened this issue Jun 13, 2022 · 10 comments · Fixed by #205

Comments

@cyjake
Copy link
Contributor

cyjake commented Jun 13, 2022

hence tries to locale package @parcel/css-linux-x64-glibc,

[admin@2445c87ab686 /home/admin]
$node
Welcome to Node.js v16.15.0.
Type ".help" for more information.
> require('detect-libc').familySync()
'glibc'
>

Should @parcel/css-linux-x64-gnu be renamed as @parcel/css-linux-x64-glibc, or both should be published?

@cyjake
Copy link
Contributor Author

cyjake commented Jun 13, 2022

kudos to @killagu

@cyjake
Copy link
Contributor Author

cyjake commented Jun 13, 2022

It looks like npm-install does not validate the ${libc} part, hence both linux-x64-gnu and linux-x64-musl are installed. We use https://github.com/cnpm/cnpm on the other hand, which validates ${libc} part as well, hence skips both -gnu and -musl. uhmmm......

@yisibl
Copy link
Contributor

yisibl commented Jun 13, 2022

@cyjake No need to rename the package name, the error should be introduced by here, not getting the abi correctly.

https://github.com/parcel-bundler/parcel-css/blob/c7545d9c34412bd2dbf3b1977533b6658fd68c4c/scripts/build-npm.js#L36

@cyjake
Copy link
Contributor Author

cyjake commented Jun 13, 2022

https://github.com/parcel-bundler/parcel-css/blob/master/scripts/build-npm.js#L7 changing from -gnu to -glibc seems to be the easiest fix :-/

@Brooooooklyn
Copy link
Contributor

@cyjake

x86_64-unknown-linux-gnu is a well-known word combination, it's used in Rust Clang GCC and many other tools.

There is no x86_64-unknown-linux-glibc word.

@cyjake
Copy link
Contributor Author

cyjake commented Jun 13, 2022

well, guess the only option left is to alias the abi naming in the build script. AFAICT, both cnpm and yarn support that. I can take a look at it tomorrow.

@onigoetz
Copy link
Contributor

Hi, just to be sure, this is related to the change in #188

that can cause Cannot find module '../parcel-css.linux-x64-gnu.node (Node 14 + Yarn 3.2.1 on GitHub Actions) ?

If not I'll open a separate issue.

@cyjake
Copy link
Contributor Author

cyjake commented Jun 14, 2022

@onigoetz Yes it's same issue.

@yisibl
Copy link
Contributor

yisibl commented Jun 14, 2022

A string like x86_64-unknown-linux-gnu is called a Target Triple in cross-compilation, this format is:

<arch><sub>-<vendor>-<sys>-<abi>

We can view the details via rustc:
rustc -Z unstable-options --print target-spec-json --target x86_64-unknown-linux-gnu

So there is no need to rename it, use target_env disambiguating information about the target platform with information about the ABI or libc used.

@cyjake
Copy link
Contributor Author

cyjake commented Jun 17, 2022

[admin@14e2f8a21ed0 /home/admin]
$ll node_modules/@parcel/
total 4
lrwxrwxrwx 1 admin admin 34 Jun 17 09:31 css -> ../_@parcel_css@1.10.1@@parcel/css
lrwxrwxrwx 1 admin admin 62 Jun 17 09:31 css-linux-x64-gnu -> ../_@parcel_css-linux-x64-gnu@1.10.1@@parcel/css-linux-x64-gnu

verified 💯

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

Successfully merging a pull request may close this issue.

4 participants