pcb

sed Error when building on OSX

Bug #1542859 reported by Chad Parker on 2016-02-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Low
Unassigned

Bug Description

Building on OSX produces a sed error

mv hid/ps/ps_lists.h.tmp hid/ps/ps_lists.h
echo '/* AUTOMATICALLY GENERATED FROM pcb-menu.res.in DO NOT EDIT */' > pcb-menu.res
cat ./pcb-menu.res.in >> pcb-menu.res
echo '/* AUTOMATICALLY GENERATED FROM pcb-menu.res DO NOT EDIT */' > pcb-menu.h
echo 'const char *pcb_menu_default[] = {' >> pcb-menu.h
sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$/",/' < pcb-menu.res >> pcb-menu.h
sed: RE error: illegal byte sequence
make[2]: *** [pcb-menu.h] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Running make again seems to proceed as normal and pcb builds and seems to run properly.

Tags: osx Edit Tag help
Chad Parker (parker-charles) wrote :

I should add that this was building from git on Feb 5, 2016.

Chad Parker (parker-charles) wrote :

When I experienced this the first time, I was able to reproduce it by running 'make clean' and then building again.

I'm not sure what's changed or when, but I'm no longer able to produce this error. Since it has not been reported by anyone else, I recommend we close this issue.

Changed in pcb:
status: New → Triaged
importance: Undecided → Low
milestone: none → future-bug-release
status: Triaged → Incomplete
tags: added: osx
Chad Parker (parker-charles) wrote :

I've figured out where this bug comes from, and how I've gotten around it. It has to do with sed and locale

There is a "degree" symbol in the pcb-menu.res file which is UTF-8, not standard ascii. The osx version of sed doesn't handle this properly, see this reference:

http://stackoverflow.com/questions/19242275/re-error-illegal-byte-sequence-on-mac-os-x

pcb/$ iconv -f ASCII --byte-subst='\x{%02x}' < src/pcb-menu.res | grep '\\x'
   {"Spin 180\x{b0}" SwapSides(R) a={"Ctrl-Tab" "Ctrl<Key>Tab"}}

One solution would be to remove the degree symbol. Another is to set the environment variable LANG=C when building on osx (what I'm doing apparently).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers