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

Compile error #1470

Closed
piechade opened this issue Feb 7, 2018 · 5 comments · Fixed by #1487
Closed

Compile error #1470

piechade opened this issue Feb 7, 2018 · 5 comments · Fixed by #1487

Comments

@piechade
Copy link

piechade commented Feb 7, 2018

  • SerialPort Version: 6.1.0
  • NodeJS Version: 9.5.0
  • Operating System and Hardware Platform: Alpine Linux Docker

Summary of Problem

CXX(target) Release/obj.target/serialport/src/serialport_linux.o
../src/serialport_linux.cpp: In function 'int linuxSetCustomBaudRate(int, unsigned int)':
../src/serialport_linux.cpp:10:18: error: 'TCGETS2' was not declared in this scope
if(ioctl(fd, TCGETS2, &t)) {
^~~~~~~
../src/serialport_linux.cpp:18:18: error: 'TCSETS2' was not declared in this scope
if(ioctl(fd, TCSETS2, &t)) {
^~~~~~~
../src/serialport_linux.cpp: In function 'int linuxGetSystemBaudRate(int, int*)':
../src/serialport_linux.cpp:29:16: error: 'TCGETS2' was not declared in this scope
if(ioctl(fd, TCGETS2, &t)) {
^~~~~~~
make: *** [serialport.target.mk:98: Release/obj.target/serialport/src/serialport_linux.o] Error 1

Steps and Code to Reproduce the Issue

npm install

@reconbot
Copy link
Member

reconbot commented Feb 8, 2018

Cc @Fumon

@Fumon
Copy link
Contributor

Fumon commented Feb 15, 2018

Sorry for the delay, notification got filtered. Looks like an easy fix.

Seems to be an issue with musl libc which Alpine Linux is based on. Found a reference and fix in a similar serial based project here which appeared to resolve the issue.

I have a branch for you to try sticking in your package.json to see if it compiles https://github.com/Fumon/node-serialport/tree/fix_musl

If I don't hear from you @piechade, I'll spin up an Alpine VM to test this myself.

@piechade
Copy link
Author

piechade commented Feb 15, 2018

@Fumon i will test it later this day. I need to look how to use GitHub instant of npm.
I had earlier time and used this command to test it:
npm install git+https://github.com/Fumon/node-serialport.git
Unfortunately the same issue.

@Fumon
Copy link
Contributor

Fumon commented Feb 15, 2018

Ah, you need
npm install git+https://github.com/Fumon/node-serialport.git#fix_musl
to get the correct branch.

I just built a docker image using:

FROM gliderlabs/alpine:3.4
RUN apk add --no-cache build-base linux-headers nodejs git python\
  && npm install git+https://github.com/Fumon/node-serialport.git#fix_musl
ENTRYPOINT /bin/sh

Which built successfully.

@piechade
Copy link
Author

Sorry about that, i forgot the branch. For me ist also everything working.

reconbot pushed a commit that referenced this issue Feb 15, 2018
Fixes #1470  After adding the new custom baud rate implementation for Linux, a build breaking bug occurred on Alpine Linux due to musl's handling of the kernel header files involved with ioctls. This patch introduces a fix by using the solution found [here](tio/tio#65) on a similar, serial oriented project.

Tested in an Alpine Linux docker container. Passing all hardware tests.
IvanSanchez pushed a commit to NordicPlayground/node-serialport that referenced this issue Feb 27, 2018
…lport#1487)

Fixes serialport#1470  After adding the new custom baud rate implementation for Linux, a build breaking bug occurred on Alpine Linux due to musl's handling of the kernel header files involved with ioctls. This patch introduces a fix by using the solution found [here](tio/tio#65) on a similar, serial oriented project.

Tested in an Alpine Linux docker container. Passing all hardware tests.
oteku pushed a commit to Cutii/node-serialport that referenced this issue Apr 9, 2018
…lport#1487)

Fixes serialport#1470  After adding the new custom baud rate implementation for Linux, a build breaking bug occurred on Alpine Linux due to musl's handling of the kernel header files involved with ioctls. This patch introduces a fix by using the solution found [here](tio/tio#65) on a similar, serial oriented project.

Tested in an Alpine Linux docker container. Passing all hardware tests.
reconbot pushed a commit that referenced this issue Jul 24, 2018
Fixes #1470  After adding the new custom baud rate implementation for Linux, a build breaking bug occurred on Alpine Linux due to musl's handling of the kernel header files involved with ioctls. This patch introduces a fix by using the solution found [here](tio/tio#65) on a similar, serial oriented project.

Tested in an Alpine Linux docker container. Passing all hardware tests.
@lock lock bot locked as resolved and limited conversation to collaborators Aug 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants