Fossil Forum

Build error; sqlite3.o.json
Login

Build error; sqlite3.o.json

Build error; sqlite3.o.json

(1) By Jan Danielsson (jan) on 2023-06-23 16:28:59 [source]

I just checked out the latest tip of trunk and tried to build it, but I'm getting:

clang: error: compilation database '../../../checkout/fossil/bld/sqlite3.o.json' could not be opened: No such file or directory

Is this related to the compile_commands.json updates? I don't see any updated build instructions in BUILD.txt, so I assume this is a bug?

(2) By Stephan Beal (stephan) on 2023-06-23 16:36:37 in reply to 1 [link] [source]

Is this related to the compile_commands.json updates? I don't see any updated build instructions in BUILD.txt, so I assume this is a bug?

It is part of those updates and it is a bug.

What platform are you seeing this on?

You can work around these in the meantime by using:

$ ./configure --no-compile-commands

(3) By Jan Danielsson (jan) on 2023-06-23 17:05:56 in reply to 2 [link] [source]

This is on Ubuntu/x64 20.04 using clang-12.

The --no-compile-commands workaround works -- thank you!

(4) By Stephan Beal (stephan) on 2023-06-23 17:21:57 in reply to 3 [link] [source]

This is on Ubuntu/x64 20.04 using clang-12.

Are you per chance doing an out-of-tree build or something exotic like that?

i suspect the problem is not really clang, but path resolution. Your output:

clang: error: compilation database '../../../checkout/fossil/bld/sqlite3.o.json' could not be opened: No such file or directory

Looks considerably different than mine on an Ubuntu system with clang-12:

clang-12 -I. -I./src -I./extsrc -Ibld -Wall -Wdeclaration-after-statement -DFOSSIL_DYNAMIC_BUILD=1 -g -O2 -DHAVE_AUTOCONFIG_H -MJ ./bld/sqlite3.o.json ...

i will try to rig the build to detect and out-of-tree build and simply leave off the compile_commands.json stuff (which are only useful for folks actually working on the code).

(5) By Stephan Beal (stephan) on 2023-06-23 17:45:24 in reply to 4 [link] [source]

... rig the build to detect and out-of-tree build and simply leave off the compile_commands.json stuff (which are only useful for folks actually working on the code).

Assuming that you were actually running an out-of-tree build, please try the latest trunk, which disables that feature for such builds. (Noting that it works fine for me on out-of-tree without that hack, but that feature isn't of much use except for the developers.)

If it's still happening for you... then... well, just toss out any info which comes to mind as potentially relevant for explaining the difference between our two Ubuntu systems (mine is 22.04.2, btw, not 20.04, but that "shouldn't" make a difference).

(6) By Jan Danielsson (jan) on 2023-06-23 18:33:12 in reply to 4 [link] [source]

Yeah, I do out-of-tree builds. I want to avoid unnecessary wear and tear of my flash storage so I build everything in an tmpfs.

The out-of-tree detection change seems to have fixed the issue -- thank you again!