janet-lang / janet-lang/sqlite3

jpm build fails when using system SQLite library

Open
#22 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
62
Forks
16
PR merge metrics
No merged PRs in 30d

Description

I wanted to build the version with my system's SQLite library.
As far as I have debugged, the compilation steps do not create the output object files in the *build/* directory.
If I run each `cc` command by hand, I will succeed.
But I have no idea and experiences with `jpm` why it did not create the intermediate object files.
Other `jpm build` steps with other packages work fine though.

Here is my issue in detail:
```
$ jpm --verbose build
cc -c main.c -DUSE_SYSTEM_SQLITE -DJANET_BUILD_TYPE=release -I/usr/include/janet -I/usr/lib/janet -O2 -fPIC -o build/main.o
generating meta file build/sqlite3.meta.janet...
cc: warning: : linker input file unused because linking not done
cc: error: : linker input file not found: No such file or directory
error: error: command failed with non-zero exit code 1
in os/execute [src/core/os.c] on line 1362
in shell [/usr/lib/janet/jpm/shutil.janet] (tailcall) on line 143, column 5
in [/usr/lib/janet/jpm/rules.janet] on line 20, column 22
error: build fail
in pdag [/usr/lib/janet/jpm/dagbuild.janet] (tailcall) on line 79, column 23
in run [/usr/lib/janet/jpm/cli.janet] (tailcall) on line 88, column 9
in run-main [boot.janet] on line 3951, column 16
in cli-main [boot.janet] on line 4104, column 17
$ # build/main.o is missing, it was not created!
$ ls build
sqlite3.meta.janet
$ # but running above compilation by hand works just fine:
$ cc -c main.c -DUSE_SYSTEM_SQLITE -DJANET_BUILD_TYPE=release -I/usr/include/janet -I/usr/lib/janet -O2 -fPIC -o build/main.o
$ ls build
main.o sqlite3.meta.janet
$ # now I could continue, every `cc` command only outputs its targets when run manually…
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with main.c and the verbose jpm build output, reproducing the build with USE_SYSTEM_SQLITE. Compare the failing jpm invocation with the manual cc command and inspect why build/main.o is not created. Done means jpm build completes and generates the expected object files without manual commands.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, sqlite
Domain
build-system, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.