[odb-users] Using ODB with Bazel

Samuel Littley samuel.littley at toastwaffle.com
Thu Mar 26 19:10:47 EDT 2015


Boris,

Apologies for not saying before, I'm using packages built from the Arch
Linux user repository (https://aur.archlinux.org/packages/odb). I think
the more correct approach for Bazel would actually be to compile odb and
its extensions from source with Bazel, but that would require converting
autoconf/Makefiles to Bazel BUILD files which is obviously not ideal (or
rather, not something I want to commit to immediately).

It appears Bazel completely clears the path, exporting the original path
(/usr/local/bin:/usr/bin:/usr/local/sbin) before running the odb command
makes it work perfectly. Thanks for the hints!

Best Wishes,

Samuel

On 26/03/15 12:44, Boris Kolpackov wrote:
> Hi Samuel,
> 
> Samuel Littley <samuel.littley at toastwaffle.com> writes:
> 
>> "odb: error: unable to resolve ODB driver path" and "/usr/bin/odb:
>> error: unable to obtain GCC plugin directory". [...]
>>
>> For the first error, I assume it's referring to the libodb-xxx database
>> drivers [...]
> 
> No, this error refers to the 'odb' executable. It is the compiler driver
> for ODB (implemented as a GCC plugin) just like, say, g++ is a driver
> for cc1plus, which is the actual C++ compiler.
> 
> The 'odb' driver needs to find its location since it uses it as a
> base to search for the plugin to load. In your case, it looks for
> it in PATH which doesn't work, for some reason.
> 
> 
>> The second error appears only when I call the binary as /usr/bin/odb as
>> opposed to just calling odb and letting it be resolved from the path,
>> but I can't see any options for odb that would let me specify where it
>> should look for the plugin.
> 
> The plugin will be looked for in a directory that is relative to /usr/bin.
> You didn't say what package of ODB you are using (e.g., pre-built binary
> from the website, from your distribution repository, or built it yourself).
> Generally, you shouldn't move the 'odb' binary around. Here is a warning
> from the pre-built binary README file:
> 
> "Note also that while you can move the ODB compiler directory around, you
> cannot move individual sub-directories or files inside it. For example,
> copying or linking the ODB compiler executable to /usr/local/bin/ will
> not work."
> 
> Boris
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
Url : http://codesynthesis.com/pipermail/odb-users/attachments/20150326/db316534/signature.pgp


More information about the odb-users mailing list