| cyeh ( @ 2005-04-22 17:09:00 |
open source rant today: bison
When has it ever been a good idea to hardcode paths in your binary?
I was trying to solve a tool config issue where multiple versions of bison would hose the build. Since we already have a mechanism for distributing tool updates, I did what I thought was the right thing: I built bison statically and added it to the tool chain.
Except that it didn't work.
As it turns out bison depends on m4. But not in a library kind of way. No. It actually execs out a process to the local m4 in order to do some preprocessing work. I found this by doing a 'strings bison' and discovering hardcoded entries to /usr/local/bin/m4.
WTF?
You can override the compiled path by setting an M4 environment variable that points to your local M4, but this wasn't spelled out anywhere in the man page. The only way I discovered this little gem was by reading the source.
Thanks GNU.
When has it ever been a good idea to hardcode paths in your binary?
I was trying to solve a tool config issue where multiple versions of bison would hose the build. Since we already have a mechanism for distributing tool updates, I did what I thought was the right thing: I built bison statically and added it to the tool chain.
Except that it didn't work.
As it turns out bison depends on m4. But not in a library kind of way. No. It actually execs out a process to the local m4 in order to do some preprocessing work. I found this by doing a 'strings bison' and discovering hardcoded entries to /usr/local/bin/m4.
WTF?
You can override the compiled path by setting an M4 environment variable that points to your local M4, but this wasn't spelled out anywhere in the man page. The only way I discovered this little gem was by reading the source.
Thanks GNU.