Skip to content

Commit

Permalink
Merge remote-tracking branch 'jsoo/master' into jsoo
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon committed Oct 24, 2024
2 parents eba73eb + 9315996 commit 36f2a08
Show file tree
Hide file tree
Showing 126 changed files with 20,299 additions and 19,247 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ jobs:
skip-effects: false
skip-test: false
skip-doc: false
# Note this OCaml compiler is bytecode only
- os: ubuntu-latest
ocaml-compiler: "ocaml-variants.5.2.0+options,ocaml-option-32bit"
skip-effects: true # disabled for the same reason than `skip-test`
skip-test: true # the `time_now.0.17` package is pulled and doesn't work in 32 bits :(
skip-doc: true
- os: macos-latest
ocaml-compiler: "5.2"
skip-effects: true
Expand All @@ -82,7 +88,7 @@ jobs:
# getting much better, but no luck yet, c.f:
# https://github.com/ocaml/opam-repository/pull/26626
- name: Install apt 32-bit dependencies
if: matrix.ocaml-compiler == 'ocaml-variants.4.14.2+options,ocaml-option-32bit'
if: contains( matrix.ocaml-compiler, 'ocaml-option-32bit')
run: |
sudo apt-get install aptitude
sudo dpkg --add-architecture i386
Expand Down
7 changes: 6 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,21 @@
* Compiler: introduce a Targetint module
that follows the semantic of the backend (js or wasm)
* Compiler: warn on joo_global_object
* Compiler: revisit static env handling (#1708)
* Compiler: Emit index source_map to avoid changing mappings (#1714, #1715)
* Compiler: improved source map generation (#1716)
* Runtime: change Sys.os_type on windows (Cygwin -> Win32)
* Runtime: backtraces are really expensive, they need to be be explicitly
requested at compile time (--enable with-js-error) or at startup (OCAMLRUNPARAM=b=1)
* Runtime: allow dynlink of precompiled js with separate compilation (#1676)
* Runtime: reimplement the runtime of weak and ephemeron (#1707)
* Lib: Modify Typed_array API for compatibility with WebAssembly

* Toplevel: no longer set globals for toplevel initialization

## Bug fixes
* Runtime: fix parsing of unsigned integers (0u2147483648) (#1633, #1666)
* Runtime: fix incorrect pos_in after unmarshalling
* Runtime: make float_of_string stricter (#1609)
* Toplevel: fix missing primitives with separate compilation
* Compiler: fix link of packed modules with separate compilation
* Compiler: Fixed the static evaluation of some equalities (#1659)
Expand Down
11 changes: 3 additions & 8 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
"noSwitchDeclarations": "off"
},
"nursery": {
"noUselessEscapeInRegex": "error"
},
"security": {
"noGlobalEval": "off"
"noUselessEscapeInRegex": "error",
"noSubstr": "error"
},
"style": {
"noArguments": "off",
Expand All @@ -39,10 +37,7 @@
},
"suspicious": {
"noAssignInExpressions": "off",
"noDoubleEquals": "off",
"noFallthroughSwitchClause": "off",
"noRedeclare": "off",
"noSelfCompare": "off",
"noRedeclare": "off"
"noRedundantUseStrict": "off"
}
}
Expand Down
7 changes: 4 additions & 3 deletions compiler/bin-js_of_ocaml/build_fs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ function jsoo_create_file_extern(name,content){
if(globalThis.jsoo_create_file)
globalThis.jsoo_create_file(name,content);
else {
if(!globalThis.caml_fs_tmp) globalThis.caml_fs_tmp = [];
globalThis.caml_fs_tmp.push({name:name,content:content});
if(!globalThis.jsoo_fs_tmp) globalThis.jsoo_fs_tmp = [];
globalThis.jsoo_fs_tmp.push({name:name,content:content});
}
return 0;
}
Expand All @@ -74,12 +74,13 @@ function jsoo_create_file_extern(name,content){
let code = Code.prepend Code.empty instr in
Filename.gen_file output_file (fun chan ->
let pfs_fmt = Pretty_print.to_out_channel chan in
let (_ : Source_map.t option) =
let (_ : Source_map.info) =
Driver.f
~standalone:true
~wrap_with_fun:`Iife
~link:`Needed
~formatter:pfs_fmt
~source_map:false
(Parse_bytecode.Debug.create ~include_cmis:false false)
code
in
Expand Down
32 changes: 13 additions & 19 deletions compiler/bin-js_of_ocaml/cmd_arg.ml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type t =
{ common : Jsoo_cmdline.Arg.t
; (* compile option *)
profile : Driver.profile option
; source_map : (string option * Source_map.t) option
; source_map : (string option * Source_map.Standard.t) option
; runtime_files : string list
; no_runtime : bool
; include_runtime : bool
Expand Down Expand Up @@ -280,6 +280,7 @@ let options =
input_file
js_files
keep_unit_names =
let inline_source_content = not sourcemap_don't_inline_content in
let chop_extension s = try Filename.chop_extension s with Invalid_argument _ -> s in
let runtime_files = js_files in
let fs_external = fs_external || (toplevel && no_cmis) in
Expand All @@ -302,19 +303,15 @@ let options =
then
let file, sm_output_file =
match output_file with
| `Name file, _ when sourcemap_inline_in_js -> file, None
| `Name file, _ -> file, Some (chop_extension file ^ ".map")
| `Stdout, _ -> "STDIN", None
| `Name file, _ when sourcemap_inline_in_js -> Some file, None
| `Name file, _ -> Some file, Some (chop_extension file ^ ".map")
| `Stdout, _ -> None, None
in
Some
( sm_output_file
, { Source_map.version = 3
; file
, { (Source_map.Standard.empty ~inline_source_content) with
file
; sourceroot = sourcemap_root
; sources = []
; sources_content = (if sourcemap_don't_inline_content then None else Some [])
; names = []
; mappings = Source_map.Mappings.empty
} )
else None
in
Expand Down Expand Up @@ -519,6 +516,7 @@ let options_runtime_only =
target_env
output_file
js_files =
let inline_source_content = not sourcemap_don't_inline_content in
let chop_extension s = try Filename.chop_extension s with Invalid_argument _ -> s in
let runtime_files = js_files in
let output_file =
Expand All @@ -531,19 +529,15 @@ let options_runtime_only =
then
let file, sm_output_file =
match output_file with
| `Name file, _ when sourcemap_inline_in_js -> file, None
| `Name file, _ -> file, Some (chop_extension file ^ ".map")
| `Stdout, _ -> "STDIN", None
| `Name file, _ when sourcemap_inline_in_js -> Some file, None
| `Name file, _ -> Some file, Some (chop_extension file ^ ".map")
| `Stdout, _ -> None, None
in
Some
( sm_output_file
, { Source_map.version = 3
; file
, { (Source_map.Standard.empty ~inline_source_content) with
file
; sourceroot = sourcemap_root
; sources = []
; sources_content = (if sourcemap_don't_inline_content then None else Some [])
; names = []
; mappings = Source_map.Mappings.empty
} )
else None
in
Expand Down
2 changes: 1 addition & 1 deletion compiler/bin-js_of_ocaml/cmd_arg.mli
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type t =
{ common : Jsoo_cmdline.Arg.t
; (* compile option *)
profile : Driver.profile option
; source_map : (string option * Source_map.t) option
; source_map : (string option * Source_map.Standard.t) option
; runtime_files : string list
; no_runtime : bool
; include_runtime : bool
Expand Down
Loading

0 comments on commit 36f2a08

Please sign in to comment.