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

test: fix test-module-loading-error for AlpineLinux #3657

Closed
wants to merge 1 commit into from

Conversation

hmalphettes
Copy link
Member

node's testsuite fails only 3 cases on AlpineLinux: nodejs/docker-iojs#44 (comment)

Please let us know if it is a good idea to tackle this even if we are not officially supporting a musl-libc build of node.

Here is a patch for one of those tests.

Thanks!

@jbergstroem jbergstroem added the test Issues and PRs related to the tests. label Nov 4, 2015
@bnoordhuis
Copy link
Member

LGTM but please see CONTRIBUTING.md on how to format the commit log.

CI: https://ci.nodejs.org/job/node-test-pull-request/670/

@mscdex mscdex added the module Issues and PRs related to the module subsystem. label Nov 5, 2015
@hmalphettes hmalphettes changed the title Fix test/parallel/test-module-loading-error.js on AlpineLinux test: fix test-module-loading-error for AlpineLinux Nov 7, 2015
@hmalphettes
Copy link
Member Author

@bnoordhuis sorry I had missed the guideline on formatting the commit message.
Let me know if I got it right this time.
If it is is easier to make a topic branch and open a new PR please let me know.

@jbergstroem
Copy link
Member

I'd replace references regarding AlpineLinux to musl instead since this isn't really specific to Alpine.

When a compiled library file does not have the proper format,
musl returns the error message ENOEXEC as 'Exec format error' but
glibc returns 'file too short' if the file is under a certain size.

Reference:
http://git.musl-libc.org/cgit/musl/tree/src/errno/__strerror.h#n46

This patch consists of tolerating musl's error.
@hmalphettes
Copy link
Member Author

@jbergstroem Good point! Done.

@jbergstroem
Copy link
Member

LGTM

@@ -20,6 +21,9 @@ if (!dlerror_msg) {
try {
require('../fixtures/module-loading-error.node');
} catch (e) {
if (platform === 'linux' && e.toString().indexOf(musl_errno_enoexec) !== -1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: platform should be process.platfom here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Embarrassed! Sorry about that.

bnoordhuis pushed a commit that referenced this pull request Nov 10, 2015
When a compiled library file does not have the proper format,
musl returns the error message ENOEXEC as 'Exec format error' but
glibc returns 'file too short' if the file is under a certain size.

Reference:
http://git.musl-libc.org/cgit/musl/tree/src/errno/__strerror.h#n46

This patch consists of tolerating musl's error.

PR-URL: #3657
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
@bnoordhuis
Copy link
Member

Okay, landed with a fix-up in 1bacf37. The CI is still down unfortunately but tests and lint pass locally.

@bnoordhuis bnoordhuis closed this Nov 10, 2015
Fishrock123 pushed a commit that referenced this pull request Nov 10, 2015
When a compiled library file does not have the proper format,
musl returns the error message ENOEXEC as 'Exec format error' but
glibc returns 'file too short' if the file is under a certain size.

Reference:
http://git.musl-libc.org/cgit/musl/tree/src/errno/__strerror.h#n46

This patch consists of tolerating musl's error.

PR-URL: #3657
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
This was referenced Nov 10, 2015
MylesBorins pushed a commit that referenced this pull request Nov 17, 2015
When a compiled library file does not have the proper format,
musl returns the error message ENOEXEC as 'Exec format error' but
glibc returns 'file too short' if the file is under a certain size.

Reference:
http://git.musl-libc.org/cgit/musl/tree/src/errno/__strerror.h#n46

This patch consists of tolerating musl's error.

PR-URL: #3657
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
@MylesBorins
Copy link
Contributor

landed in v4.x-staging in 2570cb7

rvagg pushed a commit that referenced this pull request Dec 4, 2015
When a compiled library file does not have the proper format,
musl returns the error message ENOEXEC as 'Exec format error' but
glibc returns 'file too short' if the file is under a certain size.

Reference:
http://git.musl-libc.org/cgit/musl/tree/src/errno/__strerror.h#n46

This patch consists of tolerating musl's error.

PR-URL: #3657
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
@jasnell jasnell mentioned this pull request Dec 17, 2015
jasnell pushed a commit that referenced this pull request Dec 17, 2015
When a compiled library file does not have the proper format,
musl returns the error message ENOEXEC as 'Exec format error' but
glibc returns 'file too short' if the file is under a certain size.

Reference:
http://git.musl-libc.org/cgit/musl/tree/src/errno/__strerror.h#n46

This patch consists of tolerating musl's error.

PR-URL: #3657
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
jasnell pushed a commit that referenced this pull request Dec 23, 2015
When a compiled library file does not have the proper format,
musl returns the error message ENOEXEC as 'Exec format error' but
glibc returns 'file too short' if the file is under a certain size.

Reference:
http://git.musl-libc.org/cgit/musl/tree/src/errno/__strerror.h#n46

This patch consists of tolerating musl's error.

PR-URL: #3657
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module Issues and PRs related to the module subsystem. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants