Cannot build: sqlcipher/sqlite3.c missing

RESOLVED FIXED

Status

()

Firefox for iOS
Build & Test
--
critical
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Boris Dušek, Unassigned)

Tracking

unspecified
All
iOS 8

Firefox Tracking Flags

(fxios+)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Building latest code (ddea35aeb120e9b3649f92fdeedaf27bba7a3251) results in build error:

clang: error: no such file or directory: '/path/to/firefox-ios/ThirdParty/sqlcipher/sqlite3.c'

I tried even again doing Steps 1.-6. from "Building the code" in README.md from scratch, but got the same error.
(Reporter)

Comment 1

3 years ago
Please note that this happened after (among other things) I did "git clean -xffd" in my checkout that I checked out months ago (and then only updated using git pull and ./checkout.sh) - maybe some stuff that was earlier present got removed but no-one would not notice unless doing a new checkout (or git clean -xffd)?
(Reporter)

Comment 2

3 years ago
Managed to overcome it by running manually commands from the amalgamation target of sqlcipher:

./configure --enable-tempstore=yes --with-crypto-lib=commoncrypto CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2"
make sqlite3.c

But now hitting another error:

/path/to/Library/Developer/Xcode/DerivedData/Client-ddsfbzjydxjurcfycsxnaekdjddj/Build/Intermediates/Client.build/Debug-iphoneos/Storage.build/module.modulemap:2:12: error: header 'Storage-Swift.h' not found
    header "Storage-Swift.h"
           ^
/path/to/firefox-ios/Sync/TabsPayload.swift:7:8: error: could not build Objective-C module 'Storage'
import Storage
       ^
(Reporter)

Comment 3

3 years ago
(In reply to Boris Dušek from comment #2)
> Managed to overcome it by running manually commands from the amalgamation
> target of sqlcipher:
> 
> ./configure --enable-tempstore=yes --with-crypto-lib=commoncrypto
> CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2"
> make sqlite3.c
> 
> But now hitting another error:
> 
> /path/to/Library/Developer/Xcode/DerivedData/Client-
> ddsfbzjydxjurcfycsxnaekdjddj/Build/Intermediates/Client.build/Debug-iphoneos/
> Storage.build/module.modulemap:2:12: error: header 'Storage-Swift.h' not
> found
>     header "Storage-Swift.h"
>            ^
> /path/to/firefox-ios/Sync/TabsPayload.swift:7:8: error: could not build
> Objective-C module 'Storage'
> import Storage
>        ^

This was actually with an earlier commit (I tried that to see if the original error would still be reproducible - it was), when updating to ddea35aeb120e9b3649f92fdeedaf27bba7a3251, I am no longer getting the quoted error.
Severity: normal → critical
Flags: needinfo?(wjohnston)
Flags: needinfo?(sarentz)
Is this still happening? I don't see build errors on the CI server.

Did a Clean Build Folder help? (option-shift-command-k)
Flags: needinfo?(sarentz)
(Reporter)

Comment 5

3 years ago
(In reply to Stefan Arentz [:st3fan] from comment #4)
> Is this still happening? I don't see build errors on the CI server.

For some reason, this is no longer happening (I did update to latest code, not sure if that did it).
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WORKSFORME
Flags: needinfo?(wjohnston)
tracking-fxios: --- → +
Marking this as tracking. :sleroux and i just spent like 30 minutes to get this working for a production build to get past this.

We ended up running the amalgamation script manually like :dusek did. After that the build worked.

I think we may want to run the amalgamation manually once and then simply add the generated sqlite3*.[ch] files to the project and never run that build phase again.

Or even include a precompiled .a in the project?
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
(Reporter)

Comment 7

3 years ago
Not being an Xcode expert, but looking at the amalgamation target's Run script build phase - is it correct that is has sqlite3.c as its input and libsqlcipher.a as its output, when in fact sqlite3.c seems to me like an *output* (not input) of the step? (i.e. make sqlite3.c I suppose generates sqlite3.c).

So maybe just the build phase' inputs and outputs are not correctly specified?
Created attachment 8635286 [details] [review]
PR: https://github.com/mozilla/firefox-ios/pull/763

This simplifies the sqlcipher target by removing all unused files, adding the generated sqlite3.c, sqlite3.h and sqlite3ext.h files to the project and removing the amalgamation step from the project.
Attachment #8635286 - Flags: review?(sleroux)
Attachment #8635286 - Flags: feedback?(dusek)
Summary: Cannot build: sqlcipher/sqlite3.c missing → Simplify the sqlcipher build
Summary: Simplify the sqlcipher build → Cannot build: sqlcipher/sqlite3.c missing
Comment on attachment 8635286 [details] [review]
PR: https://github.com/mozilla/firefox-ios/pull/763

Fresh clone -> checkout -> archive works for me!
Attachment #8635286 - Flags: review?(sleroux) → review+
Added some documentation about updating sqlcipher in the project's BUILDING.md
Status: REOPENED → RESOLVED
Last Resolved: 3 years ago3 years ago
Resolution: --- → FIXED
(Reporter)

Comment 11

3 years ago
Comment on attachment 8635286 [details] [review]
PR: https://github.com/mozilla/firefox-ios/pull/763

Works for me on clean checkout.
Attachment #8635286 - Flags: feedback?(dusek) → feedback+
You need to log in before you can comment on or make changes to this bug.