Skip to content

[Bug]: Error when trying to setup grblsim on Mac #42

Description

@barereef

Bug Description

Several errors exist when trying to get grblsim up and running on Mac 26.2.

  1. Mac sed requires a mandatory argument when using -i. Replacing all calls to sed -i ... with sed -i "" ... resolves errors with pnpm dev:grblsim:setup.
  2. pnpm dev:grblsim:build fails looking for librt which doesn't exist on Mac. Manually updating the Makefile in examples/grbl-sim-build/grbl/grbl-sim to remove -lrt from LINUX_LIBRARIES solves the build issue.
  3. pnpm dev:grblsim:run fails with Operation not permitted when socat tries to create the symlink between tty devices. Modern Mac OS versions with System Integrity Protection (SIP) prevent modification of /dev (even as root). Disabling SIP is not a good idea in general. An alternative would be for socat to create the device link in /tmp then update the Connection UI in Settings to allow the user to specify the path to the device. This would preserve system safety checks while opening up this capability on Mac.

Steps to Reproduce

  1. Run pnpm dev:grblsim:setup
  2. Fix issues in grblsim-fixup.sh and Makefile in examples/grbl-sim/grbl/grbl-sim
  3. Run pnpm dev:grblsim:build
  4. Run pnpm dev:grblsim:run

Screenshots

No response

AxioCNC Version

0.0.88

How Did You Install AxioCNC?

  • Docker
  • Raspberry Pi deb file
  • Linux deb file
  • Downloaded the Desktop Application
  • Other (please specify in additional context)

CNC Controller

Grbl

Operating System

macOS

Logs/Error Messages

> axiocnc@0.0.88 dev:grblsim:setup /Users/greg/Desktop/AxioCNC
> pnpm dev:grblsim:clone && pnpm dev:grblsim:fixup && pnpm dev:grblsim:build && pnpm dev:grblsim:enable


> axiocnc@0.0.88 dev:grblsim:clone /Users/greg/Desktop/AxioCNC
> bash developers/scripts/grblsim/grblsim-clone.sh

📦 Cloning grbl and grbl-sim repositories...
📥 Cloning grbl...
Cloning into 'examples/grbl-sim-build/grbl'...
remote: Enumerating objects: 3829, done.
remote: Total 3829 (delta 0), reused 0 (delta 0), pack-reused 3829 (from 1)
Receiving objects: 100% (3829/3829), 2.23 MiB | 5.52 MiB/s, done.
Resolving deltas: 100% (2754/2754), done.
📥 Cloning grbl-sim as sibling to grbl source directory...
Cloning into 'grbl-sim'...
remote: Enumerating objects: 177, done.
remote: Total 177 (delta 0), reused 0 (delta 0), pack-reused 177 (from 1)
Receiving objects: 100% (177/177), 66.26 KiB | 1.38 MiB/s, done.
Resolving deltas: 100% (91/91), done.
✅ Repositories cloned successfully to examples/grbl-sim-build/grbl/grbl-sim

> axiocnc@0.0.88 dev:grblsim:fixup /Users/greg/Desktop/AxioCNC
> bash developers/scripts/grblsim/grblsim-fixup.sh

🔧 Applying build fixes to grbl-sim...
   Fixing Makefile paths...
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
   Fixing config.h include path...
sed: 1: "config.h
": command c expects \ followed by text
   Fixing grbl_interface.c...
sed: 1: "grbl_interface.c
": extra characters at the end of g command
sed: 1: "grbl_interface.c
": extra characters at the end of g command
sed: 1: "grbl_interface.c
": extra characters at the end of g command
sed: 1: "grbl_interface.c
": extra characters at the end of g command
   Fixing validator.c include paths...
sed: 1: "validator.c
": invalid command code v
sed: 1: "validator.c
": invalid command code v
sed: 1: "validator.c
": invalid command code v
sed: 1: "validator.c
": invalid command code v
sed: 1: "validator.c
": invalid command code v
sed: 1: "validator.c
": invalid command code v
sed: 1: "validator.c
": invalid command code v
sed: 1: "validator.c
": invalid command code v
   Fixing avr/eeprom.h include path...
sed: 1: "avr/eeprom.h
": command a expects \ followed by text
   Fixing planner_inject_accessors.c include path...
sed: 1: "planner_inject_accessor ...": extra characters at the end of p command
   Fixing serial.c include path...
sed: 1: "serial.c
": unterminated substitute pattern
✅ Build fixes applied successfully
   (Backups saved as *.bak files)

> axiocnc@0.0.88 dev:grblsim:build /Users/greg/Desktop/AxioCNC
> bash developers/scripts/grblsim/grblsim-build.sh

🔨 Building grbl-sim...
   Detected platform: MACOS
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
sed: 1: "/Users/greg/Desktop/Axi ...": extra characters at the end of g command
   Running 'make new'...
rm -f grbl_sim.exe grbl_interface.o  ../protocol.o ../planner.o ../settings.o ../print.o ../nuts_bolts.o  ../stepper.o ../gcode.o ../spindle_control.o ../motion_control.o ../limits.o ../coolant_control.o ../probe.o ../system.o ../jog.o  ../main.o ../serial.o ../report.o main.o simulator.o serial.o util/delay.o util/floatunsisf.o platform_LINUX.o system_declares.o avr/interrupt.o avr/pgmspace.o  avr/io.o  avr/eeprom.o grbl_eeprom_extensions.o gvalidate.exe validator.o overridden_report.o ../protocol.o ../planner.o ../settings.o ../print.o ../nuts_bolts.o  ../stepper.o ../gcode.o ../spindle_control.o ../motion_control.o ../limits.o ../coolant_control.o ../probe.o ../system.o ../jog.o  avr/interrupt.o avr/pgmspace.o  avr/io.o  avr/eeprom.o grbl_eeprom_extensions.o system_declares.o
cc -Wall -g -O3 -DF_CPU=16000000  -include config.h -I. -DPLAT_LINUX -c grbl_interface.c -o grbl_interface.o
In file included from <built-in>:1:
./config.h:28:10: fatal error: '../system.h' file not found
   28 | #include "../system.h"
      |          ^~~~~~~~~~~~~
1 error generated.
make: *** [grbl_interface.o] Error 1
❌ Build failed
 ELIFECYCLE  Command failed with exit code 1.
 ELIFECYCLE  Command failed with exit code 1.

Additional Context

Cloned repository from GitHub

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions