-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add script to create amalgamated build #933
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ef3cd55
Add script to create amalgamated build
bnoordhuis 44034c4
squash! QJS_BUILD_LIBC
bnoordhuis 1d3a358
squash! test amalgamation build on ci
bnoordhuis 95b3711
squash! tweak ci
bnoordhuis e119460
squash! more tweaks
bnoordhuis 57a4823
squash! add amalgamation to release ci, maybe
bnoordhuis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import {loadFile, writeFile} from "qjs:std" | ||
|
||
const cutils_c = loadFile("cutils.c") | ||
const cutils_h = loadFile("cutils.h") | ||
const libbf_c = loadFile("libbf.c") | ||
const libbf_h = loadFile("libbf.h") | ||
const libregexp_c = loadFile("libregexp.c") | ||
const libregexp_h = loadFile("libregexp.h") | ||
const libregexp_opcode_h = loadFile("libregexp-opcode.h") | ||
const libunicode_c = loadFile("libunicode.c") | ||
const libunicode_h = loadFile("libunicode.h") | ||
const libunicode_table_h = loadFile("libunicode-table.h") | ||
const list_h = loadFile("list.h") | ||
const quickjs_atom_h = loadFile("quickjs-atom.h") | ||
const quickjs_c = loadFile("quickjs.c") | ||
const quickjs_c_atomics_h = loadFile("quickjs-c-atomics.h") | ||
const quickjs_h = loadFile("quickjs.h") | ||
const quickjs_libc_c = loadFile("quickjs-libc.c") | ||
const quickjs_libc_h = loadFile("quickjs-libc.h") | ||
const quickjs_opcode_h = loadFile("quickjs-opcode.h") | ||
|
||
let source = "#if defined(QJS_BUILD_LIBC) && defined(__linux__) && !defined(_GNU_SOURCE)\n" | ||
+ "#define _GNU_SOURCE\n" | ||
+ "#endif\n" | ||
+ quickjs_c_atomics_h | ||
+ cutils_h | ||
+ list_h | ||
+ libbf_h | ||
+ libunicode_h // exports lre_is_id_start, used by libregexp.h | ||
+ libregexp_h | ||
+ libunicode_table_h | ||
+ quickjs_h | ||
+ quickjs_c | ||
+ cutils_c | ||
+ libbf_c | ||
+ libregexp_c | ||
+ libunicode_c | ||
+ "#ifdef QJS_BUILD_LIBC\n" | ||
+ quickjs_libc_h | ||
+ quickjs_libc_c | ||
+ "#endif // QJS_BUILD_LIBC\n" | ||
source = source.replace(/#include "quickjs-atom.h"/g, quickjs_atom_h) | ||
source = source.replace(/#include "quickjs-opcode.h"/g, quickjs_opcode_h) | ||
source = source.replace(/#include "libregexp-opcode.h"/g, libregexp_opcode_h) | ||
source = source.replace(/#include "[^"]+"/g, "") | ||
writeFile(execArgv[2] ?? "quickjs-amalgam.c", source) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saghul is this safe? I really have no idea what I'm doing here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be fine since we are doing the upload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fingers crossed then!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently a plain asterisk is invalid syntax? I'm getting CI notifications:
Um... suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe run the step twice with 2 separate patterns?