From 4bf0e6d9c4a9723f6ac2ce9f6eba105d9c7b90a4 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Thu, 14 Mar 2024 14:58:44 +0100 Subject: [PATCH 01/16] Restore tracing instrucions ; debugging still needed --- src/mlang/backend_compilers/bir_to_dgfip_c.ml | 5 +++-- src/mlang/backend_compilers/decoupledExpr.ml | 10 ++++++---- src/mlang/backend_compilers/decoupledExpr.mli | 2 +- src/mlang/backend_compilers/dgfip_gen_files.ml | 5 +++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/mlang/backend_compilers/bir_to_dgfip_c.ml b/src/mlang/backend_compilers/bir_to_dgfip_c.ml index 7e82b9746..9280d0e1f 100644 --- a/src/mlang/backend_compilers/bir_to_dgfip_c.ml +++ b/src/mlang/backend_compilers/bir_to_dgfip_c.ml @@ -288,8 +288,9 @@ let generate_m_assign (dgfip_flags : Dgfip_options.flags) def def_var (D.format_assign dgfip_flags var_indexes val_var) value val_var; - if dgfip_flags.flg_trace then - let var = Bir.var_to_mir var in + (* If the trace flag is set, we print the value of all non-temp variables *) + let var = Bir.var_to_mir var in + if dgfip_flags.flg_trace && not var.Mir.Variable.is_temp then Format.fprintf oc "@;aff2(\"%s\", irdata, %s);" (Pos.unmark var.Mir.Variable.name) (Dgfip_varid.gen_access_pos_from_start var_indexes var) diff --git a/src/mlang/backend_compilers/decoupledExpr.ml b/src/mlang/backend_compilers/decoupledExpr.ml index 8b2d669c4..7c7d11d7a 100644 --- a/src/mlang/backend_compilers/decoupledExpr.ml +++ b/src/mlang/backend_compilers/decoupledExpr.ml @@ -6,7 +6,7 @@ type offset = | None let rec generate_variable (vm : Dgfip_varid.var_id_map) (offset : offset) - ?(def_flag = false) ?(debug_flag = false) (var : Bir.variable) : string = + ?(def_flag = false) ?(trace_flag = false) (var : Bir.variable) : string = let mvar = Bir.var_to_mir var in try match offset with @@ -25,7 +25,9 @@ let rec generate_variable (vm : Dgfip_varid.var_id_map) (offset : offset) if def_flag then Dgfip_varid.gen_access_def vm mvar offset else let access_val = Dgfip_varid.gen_access_val vm mvar offset in - if debug_flag then + (* When the trace flag is present, we print the value of the + non-temporary variable being used *) + if trace_flag && not mvar.Mir.Variable.is_temp then let vn = Pos.unmark mvar.Mir.Variable.name in let pos_tgv = Dgfip_varid.gen_access_pos_from_start vm mvar in Format.asprintf "(aff3(\"%s\",irdata, %s), %s)" vn pos_tgv @@ -429,7 +431,7 @@ let format_expr_var (dgfip_flags : Dgfip_options.flags) | M (var, offset, df) -> let def_flag = df = Def in Format.fprintf fmt "%s" - (generate_variable ~debug_flag:dgfip_flags.flg_trace vm offset ~def_flag + (generate_variable ~trace_flag:dgfip_flags.flg_trace vm offset ~def_flag var) let rec format_dexpr (dgfip_flags : Dgfip_options.flags) @@ -488,7 +490,7 @@ let rec format_dexpr (dgfip_flags : Dgfip_options.flags) | Daccess (var, dflag, de) -> Format.fprintf fmt "(%s[(int)%a])" (generate_variable ~def_flag:(dflag = Def) - ~debug_flag:dgfip_flags.flg_trace vm PassPointer var) + ~trace_flag:dgfip_flags.flg_trace vm PassPointer var) format_dexpr de | Dite (dec, det, dee) -> Format.fprintf fmt "@[(%a ?@ %a@ : %a@])" format_dexpr dec diff --git a/src/mlang/backend_compilers/decoupledExpr.mli b/src/mlang/backend_compilers/decoupledExpr.mli index 8b5100b4c..4904bf5e8 100644 --- a/src/mlang/backend_compilers/decoupledExpr.mli +++ b/src/mlang/backend_compilers/decoupledExpr.mli @@ -9,7 +9,7 @@ val generate_variable : Dgfip_varid.var_id_map -> offset -> ?def_flag:bool -> - ?debug_flag:bool -> + ?trace_flag:bool -> Bir.variable -> string diff --git a/src/mlang/backend_compilers/dgfip_gen_files.ml b/src/mlang/backend_compilers/dgfip_gen_files.ml index 413d3a1fd..f4c5e5b29 100644 --- a/src/mlang/backend_compilers/dgfip_gen_files.ml +++ b/src/mlang/backend_compilers/dgfip_gen_files.ml @@ -1679,10 +1679,11 @@ let gen_mlang_h fmt cprog flags vars stats_varinfos rules verifs chainings pr "\n"; gen_annee fmt flags; pr "\n"; - gen_dbg fmt; - pr "\n"; gen_const fmt; pr "\n"; + (* The debug functions need T_irdata to be defined so we put them after *) + gen_dbg fmt; + pr "\n"; gen_decl_varinfos fmt stats_varinfos; pr "\n"; gen_lib fmt flags vars rules verifs chainings errors; From d297587ce4d7d7ada618e37e59d02ca507aac603 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Thu, 14 Mar 2024 15:30:34 +0100 Subject: [PATCH 02/16] Remove apt dependencies for gmp and mpfr in release mode To be sure we use the custom built ones with musl-gcc --- .github/workflows/binary-releases.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/binary-releases.yml b/.github/workflows/binary-releases.yml index 2d464fd20..48ef6fc8b 100644 --- a/.github/workflows/binary-releases.yml +++ b/.github/workflows/binary-releases.yml @@ -100,7 +100,9 @@ jobs: - name: Install dependencies run: | sudo apt update - sudo apt install m4 perl python3 clang git build-essential lzip libgmp-dev libmpfr-dev + sudo apt install m4 perl python3 clang git build-essential lzip + # We pull GMP and MPFR from their sources and build them with MUSL + # in order to get a static. wget https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.lz && tar xaf gmp-6.2.1.tar.lz ( cd gmp-6.2.1; CC=musl-gcc ./configure --prefix /tmp/gmp-prefix && make && make install ) wget https://www.mpfr.org/mpfr-4.1.0/mpfr-4.1.0.tar.xz && tar xaf mpfr-4.1.0.tar.xz From ee8ecd8bd9f955b95d894f07005186f09005ad1d Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Thu, 14 Mar 2024 16:24:31 +0100 Subject: [PATCH 03/16] Try fix for binary release Suggested by https://github.com/nberth/ez-conf-lib/issues/4#issuecomment-1997699177 --- .github/workflows/binary-releases.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/binary-releases.yml b/.github/workflows/binary-releases.yml index 48ef6fc8b..d31a8e499 100644 --- a/.github/workflows/binary-releases.yml +++ b/.github/workflows/binary-releases.yml @@ -109,7 +109,7 @@ jobs: ( cd mpfr-4.1.0; CC=musl-gcc ./configure --prefix /tmp/gmp-prefix -with-gmp=/tmp/gmp-prefix && make && make install ) eval $(opam env) opam update - MPFR_PREFIX=/tmp/gmp-prefix GMP_PREFIX=/tmp/gmp-prefix make init-without-switch + CPPFLAGS=-I/tmp/gmp-prefix/include LDFLAGS=-L/tmp/gmp-prefix/lib make init-without-switch - name: Make mlang binary run: | From fb79d0281db567a359d3951fc9932c365f2146d3 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Thu, 14 Mar 2024 16:29:27 +0100 Subject: [PATCH 04/16] Manually trigger workflow --- .github/workflows/binary-releases.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/binary-releases.yml b/.github/workflows/binary-releases.yml index d31a8e499..a0c1680b1 100644 --- a/.github/workflows/binary-releases.yml +++ b/.github/workflows/binary-releases.yml @@ -1,8 +1,9 @@ name: binary-releases on: - push: + - push: branches: [master] + - workflow_dispatch jobs: From 0fa07111b4fb7eadbf0707092a61028b012db3bb Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Thu, 14 Mar 2024 16:31:13 +0100 Subject: [PATCH 05/16] Fix YAML --- .github/workflows/binary-releases.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/binary-releases.yml b/.github/workflows/binary-releases.yml index a0c1680b1..9522ad95a 100644 --- a/.github/workflows/binary-releases.yml +++ b/.github/workflows/binary-releases.yml @@ -1,9 +1,9 @@ name: binary-releases on: - - push: + push: branches: [master] - - workflow_dispatch + workflow_dispatch: jobs: From 2d0ee4ad49f530d1532e7d691d525bd7b3dbf4b1 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Thu, 14 Mar 2024 18:25:36 +0100 Subject: [PATCH 06/16] Handle colors in trace --- compare_traces.sh | 8 ++ .../ml_primitif/c_driver_inline_4/var.c | 12 --- .../ml_primitif/c_driver_inline_4/var.h | 4 - .../ml_primitif/c_driver_with_macro/var.c | 13 --- .../ml_primitif/c_driver_with_macro/var.h | 3 - src/mlang/backend_compilers/bir_to_dgfip_c.ml | 4 +- .../backend_compilers/dgfip_gen_files.ml | 82 ++++++++++++++----- 7 files changed, 72 insertions(+), 54 deletions(-) create mode 100755 compare_traces.sh diff --git a/compare_traces.sh b/compare_traces.sh new file mode 100755 index 000000000..715d9f8cc --- /dev/null +++ b/compare_traces.sh @@ -0,0 +1,8 @@ +#! /bin/bash +DGFIP_TARGET_FLAGS=-g,-O,-k4,-t YEAR=2022 make compile_dgfip_c_backend -B +~/fuzzing-calculette/calculette/trunk/2022/AIT \ + -f tests/2022/fuzzing/fuzzer_3469.m_test |& \ + sed -e 's/\x1b\[[0-9;]*m//g' &> aif_trace.txt +NO_BINARY_COMPARE=1 ./examples/dgfip_c/ml_primitif/cal \ + tests/2022/fuzzing/fuzzer_3469.m_test &> mlang_trace.txt +diff aif_trace.txt mlang_trace.txt -u > diff_trace.txt diff --git a/examples/dgfip_c/ml_primitif/c_driver_inline_4/var.c b/examples/dgfip_c/ml_primitif/c_driver_inline_4/var.c index 00f2d26f7..a0260eda4 100644 --- a/examples/dgfip_c/ml_primitif/c_driver_inline_4/var.c +++ b/examples/dgfip_c/ml_primitif/c_driver_inline_4/var.c @@ -16,9 +16,6 @@ int nb_penalite = NB_PENALITE; int nb_restituee = NB_RESTITUEE; int nb_enchaine = NB_ENCH; -int color = 37; -int typo = 0; - #ifdef FLG_DEBUG int nb_err = NB_ERR; #if NB_DEBUG_C <= 0 @@ -54,15 +51,6 @@ T_discord * une_verif(T_irdata *irdata, struct S_discord *(*proc)(T_irdata *irda #endif /* FLG_MULTITHREAD */ } -int change_couleur(int couleur, int typographie) { - color = couleur; - typo = typographie; - return 0; -} - -int get_couleur(void) { - return color; -} struct S_discord * verif_saisie_cohe_primitive_isf(T_irdata *irdata, int appel) { #ifdef FLG_MULTITHREAD diff --git a/examples/dgfip_c/ml_primitif/c_driver_inline_4/var.h b/examples/dgfip_c/ml_primitif/c_driver_inline_4/var.h index b142ec724..357f30065 100644 --- a/examples/dgfip_c/ml_primitif/c_driver_inline_4/var.h +++ b/examples/dgfip_c/ml_primitif/c_driver_inline_4/var.h @@ -44,9 +44,5 @@ extern int nb_verif; #endif /* FLG_DEBUG || FLG_CONTROLE_IMMEDIAT */ extern T_discord *une_verif _PROTS((T_irdata *irdata, struct S_discord *(*proc)(T_irdata *irdata))); - -extern int change_couleur(int couleur, int typographie); -extern int get_couleur(void); - #endif diff --git a/examples/dgfip_c/ml_primitif/c_driver_with_macro/var.c b/examples/dgfip_c/ml_primitif/c_driver_with_macro/var.c index 00f2d26f7..924567032 100644 --- a/examples/dgfip_c/ml_primitif/c_driver_with_macro/var.c +++ b/examples/dgfip_c/ml_primitif/c_driver_with_macro/var.c @@ -16,9 +16,6 @@ int nb_penalite = NB_PENALITE; int nb_restituee = NB_RESTITUEE; int nb_enchaine = NB_ENCH; -int color = 37; -int typo = 0; - #ifdef FLG_DEBUG int nb_err = NB_ERR; #if NB_DEBUG_C <= 0 @@ -54,16 +51,6 @@ T_discord * une_verif(T_irdata *irdata, struct S_discord *(*proc)(T_irdata *irda #endif /* FLG_MULTITHREAD */ } -int change_couleur(int couleur, int typographie) { - color = couleur; - typo = typographie; - return 0; -} - -int get_couleur(void) { - return color; -} - struct S_discord * verif_saisie_cohe_primitive_isf(T_irdata *irdata, int appel) { #ifdef FLG_MULTITHREAD init_erreur(irdata); diff --git a/examples/dgfip_c/ml_primitif/c_driver_with_macro/var.h b/examples/dgfip_c/ml_primitif/c_driver_with_macro/var.h index b142ec724..6337418d6 100644 --- a/examples/dgfip_c/ml_primitif/c_driver_with_macro/var.h +++ b/examples/dgfip_c/ml_primitif/c_driver_with_macro/var.h @@ -45,8 +45,5 @@ extern int nb_verif; extern T_discord *une_verif _PROTS((T_irdata *irdata, struct S_discord *(*proc)(T_irdata *irdata))); -extern int change_couleur(int couleur, int typographie); -extern int get_couleur(void); - #endif diff --git a/src/mlang/backend_compilers/bir_to_dgfip_c.ml b/src/mlang/backend_compilers/bir_to_dgfip_c.ml index 9280d0e1f..4f3e62f1e 100644 --- a/src/mlang/backend_compilers/bir_to_dgfip_c.ml +++ b/src/mlang/backend_compilers/bir_to_dgfip_c.ml @@ -632,11 +632,13 @@ let generate_target (dgfip_flags : Dgfip_options.flags) (program : Bir.program) (var_indexes : Dgfip_varid.var_id_map) (oc : Format.formatter) ((f, ret_type) : Bir.function_name * bool) = let { tmp_vars; stmts; is_verif; _ } = Mir.TargetMap.find f program.targets in - Format.fprintf oc "@[%a{@,%a%a%s@]@,}@," + Format.fprintf oc "@[%a{@,%a%s@\n%a%s@\n%s@]@,}@," (generate_target_prototype false is_verif) f generate_var_tmp_decls tmp_vars + (if dgfip_flags.flg_trace then "aff1(\"debut " ^ f ^ "\\n\") ;" else "") (generate_stmts dgfip_flags program var_indexes) stmts + (if dgfip_flags.flg_trace then "aff1(\"fin " ^ f ^ "\\n\") ;" else "") (if ret_type then {| #ifdef FLG_MULTITHREAD diff --git a/src/mlang/backend_compilers/dgfip_gen_files.ml b/src/mlang/backend_compilers/dgfip_gen_files.ml index f4c5e5b29..d09965b00 100644 --- a/src/mlang/backend_compilers/dgfip_gen_files.ml +++ b/src/mlang/backend_compilers/dgfip_gen_files.ml @@ -1412,9 +1412,17 @@ let gen_conf_h fmt flags vars = let gen_dbg fmt = Format.fprintf fmt - {|#ifdef FLG_TRACE + {|#ifdef FLG_COLORS +int change_couleur (int couleur,int typographie); +int get_couleur ( ); +int get_typo ( ); +#endif + +#ifdef FLG_TRACE extern int niv_trace; +extern void aff1(char *nom); + extern void aff_val(const char *nom, const T_irdata *irdata, int indice, int niv, const char *chaine, int is_tab, int expr, int maxi); #define aff2(nom, irdata, indice) aff_val(nom, irdata, indice, 2, "<-", 0, 0, 1) @@ -1698,6 +1706,28 @@ let gen_mlang_c fmt = #include "mlang.h" +#ifdef FLG_COLORS +int color = 37; +int typo = 0; + +int change_couleur (int couleur,int typographie) +{ + color = couleur; + typo = typographie; + return 0 ; +} + +int get_couleur ( ) +{ + return color ; +} + +int get_typo ( ) +{ + return typo ; +} +#endif + double floor_g(double a) { if (fabs(a) <= (double)LONG_MAX) { return floor(a); @@ -1899,28 +1929,38 @@ int niv_trace = 3; #define TRACE_FILE stderr #endif /* FLG_API */ +void aff1(nom) +char *nom ; +{ +#ifdef FLG_COLORS +if (niv_trace >= 1) fprintf(stderr, "\033[%d;%dm%s\033[0m", color, typo, nom) ; +#else +if (niv_trace >= 1) fprintf(stderr, "%s \n", nom) ; +#endif +} + void aff_val(const char *nom, const T_irdata *irdata, int indice, int niv, const char *chaine, int is_tab, int expr, int maxi) { double valeur; int def; if (expr < 0) { if (niv_trace >= niv) { -#ifdef FLG_COLOR +#ifdef FLG_COLORS fprintf(TRACE_FILE, "\033[%d;%dm%s[%d] %s 0\033[0m\n", color, typo, nom, expr, chaine); #else fprintf(TRACE_FILE, "%s[%d] %s 0m\n", nom, expr, chaine); -#endif /* FLG_COLOR */ +#endif /* FLG_COLORS */ } return; } else if (expr >= maxi) { -#ifdef FLG_COLOR +#ifdef FLG_COLORS fprintf(TRACE_FILE, "\033[%d;%dmerreur: indice (%d) superieur au maximum (%d)\033[0m\n", color, typo, expr, maxi); #else fprintf(TRACE_FILE, "erreur: indice (%d) superieur au maximum (%d)\n", expr, maxi); -#endif /* FLG_COLOR */ +#endif /* FLG_COLORS */ expr = 0; } #ifdef FLG_COMPACT @@ -1945,66 +1985,66 @@ void aff_val(const char *nom, const T_irdata *irdata, int indice, int niv, const if (is_tab) { if (def == 0) { if (valeur != 0) { -#ifdef FLG_COLOR +#ifdef FLG_COLORS fprintf(TRACE_FILE, "\033[%d;%dm%s[%d] : erreur undef = %lf\033[0m\n", color, typo, nom, expr, valeur); #else fprintf(TRACE_FILE, "%s[%d] : erreur undef = %lf\n", nom, expr, valeur); -#endif /* FLG_COLOR */ +#endif /* FLG_COLORS */ } else if (niv_trace >= niv) { -#ifdef FLG_COLOR +#ifdef FLG_COLORS fprintf(TRACE_FILE, "\033[%d;%dm%s[%d] %s undef\033[0m\n", color, typo, nom, expr, chaine); #else fprintf(TRACE_FILE, "%s[%d] %s undef\n", nom, expr, chaine); -#endif /* FLG_COLOR */ +#endif /* FLG_COLORS */ } } else if (def != 1) { -#ifdef FLG_COLOR +#ifdef FLG_COLORS fprintf(TRACE_FILE, "\033[%d;%dm%s[%d] : erreur flag def = %d\033[0m\n", color, typo, nom, expr, def); #else fprintf(TRACE_FILE, "%s[%d] : erreur flag def = %d\n", nom, expr, def); -#endif /* FLG_COLOR */ +#endif /* FLG_COLORS */ } else if (niv_trace >= niv) { -#ifdef FLG_COLOR +#ifdef FLG_COLORS fprintf(TRACE_FILE, "\033[%d;%dm%s[%d] %s %lf\033[0m\n", color, typo, nom, expr, chaine, valeur); #else fprintf(TRACE_FILE, "%s[%d] %s %lf\n", nom, expr, chaine, valeur); -#endif /* FLG_COLOR */ +#endif /* FLG_COLORS */ } } else { if (def == 0) { if (valeur != 0) { -#ifdef FLG_COLOR +#ifdef FLG_COLORS fprintf(TRACE_FILE, "\033[%d;%dm%s : erreur undef = %lf\033[0m\n", color, typo, nom, valeur); #else fprintf(TRACE_FILE, "%s : erreur undef = %lf\n", nom, valeur); -#endif /* FLG_COLOR */ +#endif /* FLG_COLORS */ } else if (niv_trace >= niv) { -#ifdef FLG_COLOR +#ifdef FLG_COLORS fprintf(TRACE_FILE, "\033[%d;%dm%s %s undef\033[0m\n", color, typo, nom, chaine); #else fprintf(TRACE_FILE, "%s %s undef\n", nom, chaine); -#endif /* FLG_COLOR */ +#endif /* FLG_COLORS */ } } else if (def != 1) { -#ifdef FLG_COLOR +#ifdef FLG_COLORS fprintf(TRACE_FILE, "\033[%d;%dm%s : erreur flag def = %d\033[0m\n", color, typo, nom, def); #else fprintf(TRACE_FILE, "%s : erreur flag def = %d\n", nom, def); -#endif /* FLG_COLOR */ +#endif /* FLG_COLORS */ } else if (niv_trace >= niv) { -#ifdef FLG_COLOR +#ifdef FLG_COLORS fprintf(TRACE_FILE, "\033[%d;%dm%s %s %lf\033[0m\n", color, typo, nom, chaine, valeur); #else fprintf(TRACE_FILE, "%s %s %lf\n", nom, chaine, valeur); -#endif /* FLG_COLOR */ +#endif /* FLG_COLORS */ } } } From d53268c72297c90dfdd7231d9f125c8905bc75bd Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Wed, 20 Mar 2024 10:09:58 +0100 Subject: [PATCH 07/16] Trying to debug binary build --- .github/workflows/binary-releases.yml | 66 +++++++++++++-------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/binary-releases.yml b/.github/workflows/binary-releases.yml index 9522ad95a..c963d0936 100644 --- a/.github/workflows/binary-releases.yml +++ b/.github/workflows/binary-releases.yml @@ -7,24 +7,24 @@ on: jobs: - create-release: - runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.create-new-release.outputs.upload_url }} - steps: - - name: Create GitHub release - id: create-new-release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.run_number }} - release_name: Release ${{ github.run_number }} +# create-release: +# runs-on: ubuntu-latest +# outputs: +# upload_url: ${{ steps.create-new-release.outputs.upload_url }} +# steps: +# - name: Create GitHub release +# id: create-new-release +# uses: actions/create-release@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# tag_name: ${{ github.run_number }} +# release_name: Release ${{ github.run_number }} macos-build: runs-on: macos-latest - needs: create-release + # needs: create-release steps: - uses: actions/checkout@v2 @@ -57,20 +57,20 @@ jobs: eval $(opam env) make build - - name: Upload release asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-release.outputs.upload_url }} - asset_path: ./_build/default/src/main.exe - asset_name: mlang-macos-v${{ github.run_number }}.exe - asset_content_type: application/octet-stream + # - name: Upload release asset + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ needs.create-release.outputs.upload_url }} + # asset_path: ./_build/default/src/main.exe + # asset_name: mlang-macos-v${{ github.run_number }}.exe + # asset_content_type: application/octet-stream linux-build: # The type of runner that the job will run on runs-on: ubuntu-latest - needs: create-release + # needs: create-release # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -117,12 +117,12 @@ jobs: eval $(opam env) make build-static - - name: Upload release asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-release.outputs.upload_url }} - asset_path: ./_build/default/src/main.exe - asset_name: mlang-linux-v${{ github.run_number }}.exe - asset_content_type: application/octet-stream + # - name: Upload release asset + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ needs.create-release.outputs.upload_url }} + # asset_path: ./_build/default/src/main.exe + # asset_name: mlang-linux-v${{ github.run_number }}.exe + # asset_content_type: application/octet-stream From 491f50cb24a353b139ea66f9998edb5a7869a65a Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Wed, 20 Mar 2024 10:25:24 +0100 Subject: [PATCH 08/16] Trying to fix the static build --- .github/workflows/binary-releases.yml | 88 +++++++++++++-------------- src/dune | 2 +- src/mlang/dune | 2 +- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/.github/workflows/binary-releases.yml b/.github/workflows/binary-releases.yml index c963d0936..aa5402220 100644 --- a/.github/workflows/binary-releases.yml +++ b/.github/workflows/binary-releases.yml @@ -22,50 +22,50 @@ jobs: # release_name: Release ${{ github.run_number }} - macos-build: - runs-on: macos-latest - # needs: create-release - - steps: - - uses: actions/checkout@v2 - - - name: Opam modules cache - uses: actions/cache@v1 - env: - cache-name: cache-opam-modules - with: - path: ~/.opam - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('mlang.opam', 'Makefile') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - name: Set up OCaml - uses: ocaml/setup-ocaml@v2 - with: - ocaml-compiler: 4.11.2 - - - name: Install dependencies - run: | - brew install gmp mpfr - opam update - make init-without-switch - - - name: Make mlang binary - run: | - eval $(opam env) - make build - - # - name: Upload release asset - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ needs.create-release.outputs.upload_url }} - # asset_path: ./_build/default/src/main.exe - # asset_name: mlang-macos-v${{ github.run_number }}.exe - # asset_content_type: application/octet-stream +# macos-build: +# runs-on: macos-latest +# needs: create-release +# +# steps: +# - uses: actions/checkout@v2 +# +# - name: Opam modules cache +# uses: actions/cache@v1 +# env: +# cache-name: cache-opam-modules +# with: +# path: ~/.opam +# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('mlang.opam', 'Makefile') }} +# restore-keys: | +# ${{ runner.os }}-build-${{ env.cache-name }}- +# ${{ runner.os }}-build- +# ${{ runner.os }}- +# +# - name: Set up OCaml +# uses: ocaml/setup-ocaml@v2 +# with: +# ocaml-compiler: 4.11.2 +# +# - name: Install dependencies +# run: | +# brew install gmp mpfr +# opam update +# make init-without-switch +# +# - name: Make mlang binary +# run: | +# eval $(opam env) +# make build +# +# - name: Upload release asset +# uses: actions/upload-release-asset@v1 +# env: +# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# with: +# upload_url: ${{ needs.create-release.outputs.upload_url }} +# asset_path: ./_build/default/src/main.exe +# asset_name: mlang-macos-v${{ github.run_number }}.exe +# asset_content_type: application/octet-stream linux-build: # The type of runner that the job will run on diff --git a/src/dune b/src/dune index 507725d64..1224701d0 100644 --- a/src/dune +++ b/src/dune @@ -1,7 +1,7 @@ (env (static (ocamlopt_flags - (-ccopt -static -O3))) + (-ccopt -static -O3 -cclib -static -cclib -no-pie))) (dev (flags (:standard -warn-error -A)))) diff --git a/src/mlang/dune b/src/mlang/dune index 2473ec989..ed6dba273 100644 --- a/src/mlang/dune +++ b/src/mlang/dune @@ -1,7 +1,7 @@ (env (static (ocamlopt_flags - (-O3 -ccopt -static)))) + (-O3 -ccopt -static -cclib -static -cclib -no-pie)))) (include_subdirs unqualified) From 5cd2346215e89944c9546815c80170638098339b Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Wed, 20 Mar 2024 14:48:42 +0100 Subject: [PATCH 09/16] Trying to make progress on static build --- .github/workflows/binary-releases.yml | 11 ++++++++++- src/dune | 4 ++-- src/mlang/dune | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/binary-releases.yml b/.github/workflows/binary-releases.yml index aa5402220..81f065478 100644 --- a/.github/workflows/binary-releases.yml +++ b/.github/workflows/binary-releases.yml @@ -77,6 +77,15 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 + - uses: jirutka/setup-alpine@v1 + with: + branch: v3.15 + packages: > + findutils + gmp-dev + mpfr-dev + perl + - name: Opam modules cache uses: actions/cache@v1 env: @@ -96,7 +105,7 @@ jobs: uses: ocaml/setup-ocaml@v2 with: # Version of the OCaml compiler to initialise - ocaml-compiler: ocaml-variants.4.12.0+options,ocaml-option-flambda,ocaml-option-musl,ocaml-option-static + ocaml-compiler: ocaml-variants.4.11.2+options,ocaml-option-flambda,ocaml-option-musl,ocaml-option-static - name: Install dependencies run: | diff --git a/src/dune b/src/dune index 1224701d0..681a23952 100644 --- a/src/dune +++ b/src/dune @@ -1,7 +1,7 @@ (env (static - (ocamlopt_flags - (-ccopt -static -O3 -cclib -static -cclib -no-pie))) + (flags + (:standard -cclib -static))) (dev (flags (:standard -warn-error -A)))) diff --git a/src/mlang/dune b/src/mlang/dune index ed6dba273..cf1b2cd07 100644 --- a/src/mlang/dune +++ b/src/mlang/dune @@ -1,7 +1,7 @@ (env (static - (ocamlopt_flags - (-O3 -ccopt -static -cclib -static -cclib -no-pie)))) + (flags + (:standard -cclib -static)))) (include_subdirs unqualified) From a464cb235ae2d504139d43b46fa6350247cd5815 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Wed, 20 Mar 2024 15:10:09 +0100 Subject: [PATCH 10/16] Progress towards static build --- .github/workflows/binary-releases.yml | 41 +++++++++++++-------------- src/dune | 2 +- src/mlang/dune | 2 +- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/.github/workflows/binary-releases.yml b/.github/workflows/binary-releases.yml index 81f065478..5bc5f5342 100644 --- a/.github/workflows/binary-releases.yml +++ b/.github/workflows/binary-releases.yml @@ -81,10 +81,20 @@ jobs: with: branch: v3.15 packages: > - findutils + findutils + make + curl + git + sudo + patch + rsync + m4 + gcc + libc-dev gmp-dev mpfr-dev perl + coreutils - name: Opam modules cache uses: actions/cache@v1 @@ -99,32 +109,21 @@ jobs: ${{ runner.os }}-build- ${{ runner.os }}- - # TODO : Cache gmp and mpfr builds - - - name: Set up OCaml - uses: ocaml/setup-ocaml@v2 - with: - # Version of the OCaml compiler to initialise - ocaml-compiler: ocaml-variants.4.11.2+options,ocaml-option-flambda,ocaml-option-musl,ocaml-option-static - - name: Install dependencies run: | - sudo apt update - sudo apt install m4 perl python3 clang git build-essential lzip - # We pull GMP and MPFR from their sources and build them with MUSL - # in order to get a static. - wget https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.lz && tar xaf gmp-6.2.1.tar.lz - ( cd gmp-6.2.1; CC=musl-gcc ./configure --prefix /tmp/gmp-prefix && make && make install ) - wget https://www.mpfr.org/mpfr-4.1.0/mpfr-4.1.0.tar.xz && tar xaf mpfr-4.1.0.tar.xz - ( cd mpfr-4.1.0; CC=musl-gcc ./configure --prefix /tmp/gmp-prefix -with-gmp=/tmp/gmp-prefix && make && make install ) - eval $(opam env) - opam update - CPPFLAGS=-I/tmp/gmp-prefix/include LDFLAGS=-L/tmp/gmp-prefix/lib make init-without-switch - + curl -L https://github.com/ocaml/opam/releases/download/2.1.5/opam-2.1.5-x86_64-linux > opam + install opam /usr/local/bin/opam + rm -rf opam + opam init --yes --disable-sandboxing --compiler=4.11.2 --shell-setup + eval $(opam env --switch=4.11.2) + opam install . --deps-only + shell: alpine.sh {0} + - name: Make mlang binary run: | eval $(opam env) make build-static + shell: alpine.sh {0} # - name: Upload release asset # uses: actions/upload-release-asset@v1 diff --git a/src/dune b/src/dune index 681a23952..cdb60ba83 100644 --- a/src/dune +++ b/src/dune @@ -1,7 +1,7 @@ (env (static (flags - (:standard -cclib -static))) + (:standard -cclib -static -cclib -no-pie))) (dev (flags (:standard -warn-error -A)))) diff --git a/src/mlang/dune b/src/mlang/dune index cf1b2cd07..24dc06ab7 100644 --- a/src/mlang/dune +++ b/src/mlang/dune @@ -1,7 +1,7 @@ (env (static (flags - (:standard -cclib -static)))) + (:standard -cclib -static -cclib -no-pie)))) (include_subdirs unqualified) From 53e0c400c531957e077240881021541be084870c Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Wed, 20 Mar 2024 15:14:28 +0100 Subject: [PATCH 11/16] Static flags everywhere --- src/mlang/m_frontend/dune | 5 +++++ src/mlang/test_framework/dune | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/mlang/m_frontend/dune b/src/mlang/m_frontend/dune index 994196619..857e6b220 100644 --- a/src/mlang/m_frontend/dune +++ b/src/mlang/m_frontend/dune @@ -1,3 +1,8 @@ +(env + (static + (flags + (:standard -cclib -static -cclib -no-pie)))) + (ocamllex mlexer) (menhir diff --git a/src/mlang/test_framework/dune b/src/mlang/test_framework/dune index 5ed93bb7e..f6be5c127 100644 --- a/src/mlang/test_framework/dune +++ b/src/mlang/test_framework/dune @@ -1,3 +1,8 @@ +(env + (static + (flags + (:standard -cclib -static -cclib -no-pie)))) + (ocamllex irj_lexer) (menhir From 1388eb03719ed41903110570ab82e11a554681ff Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Wed, 20 Mar 2024 15:20:53 +0100 Subject: [PATCH 12/16] Remove unused flags --- src/mlang/dune | 5 ----- src/mlang/m_frontend/dune | 5 ----- src/mlang/test_framework/dune | 5 ----- 3 files changed, 15 deletions(-) diff --git a/src/mlang/dune b/src/mlang/dune index 24dc06ab7..abd143a80 100644 --- a/src/mlang/dune +++ b/src/mlang/dune @@ -1,8 +1,3 @@ -(env - (static - (flags - (:standard -cclib -static -cclib -no-pie)))) - (include_subdirs unqualified) (library diff --git a/src/mlang/m_frontend/dune b/src/mlang/m_frontend/dune index 857e6b220..994196619 100644 --- a/src/mlang/m_frontend/dune +++ b/src/mlang/m_frontend/dune @@ -1,8 +1,3 @@ -(env - (static - (flags - (:standard -cclib -static -cclib -no-pie)))) - (ocamllex mlexer) (menhir diff --git a/src/mlang/test_framework/dune b/src/mlang/test_framework/dune index f6be5c127..5ed93bb7e 100644 --- a/src/mlang/test_framework/dune +++ b/src/mlang/test_framework/dune @@ -1,8 +1,3 @@ -(env - (static - (flags - (:standard -cclib -static -cclib -no-pie)))) - (ocamllex irj_lexer) (menhir From 8ffadb33bdee833451581500ee9d2d440db139f1 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Wed, 20 Mar 2024 16:21:41 +0100 Subject: [PATCH 13/16] Give flag --- src/dune | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dune b/src/dune index cdb60ba83..1152a9459 100644 --- a/src/dune +++ b/src/dune @@ -1,7 +1,4 @@ (env - (static - (flags - (:standard -cclib -static -cclib -no-pie))) (dev (flags (:standard -warn-error -A)))) @@ -10,4 +7,9 @@ (name main) (package mlang) (public_name mlang) - (libraries mlang)) + (libraries mlang) + (flags + (:standard -verbose -noautolink -cclib -Wl,-Bstatic -cclib -lgmp_caml + -cclib -lmpfr -cclib -lgmp -cclib -lcamlidl -cclib -lnums -cclib + -lthreadsnat -cclib -lparmap_stubs -cclib -lANSITerminal_stubs -cclib + -Wl,-Bdynamic -cclib -lpthread -cclib -lunix -cclib -ldl))) From d6986674b03cf3a0786ffdf56ef5e1d4279d3212 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Wed, 20 Mar 2024 17:12:41 +0100 Subject: [PATCH 14/16] Proper linking flags! --- makefiles/mlang.mk | 5 ++--- src/dune | 14 +++++++++----- src/gen-linking-flags.sh | 41 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 8 deletions(-) create mode 100755 src/gen-linking-flags.sh diff --git a/makefiles/mlang.mk b/makefiles/mlang.mk index 1f3cd2592..d38db6576 100644 --- a/makefiles/mlang.mk +++ b/makefiles/mlang.mk @@ -48,13 +48,12 @@ dune: FORCE ifeq ($(call is_in,),) $(call make_in,,$@) else - dune build $(DUNE_OPTIONS) + LINKING_MODE=$(LINKING_MODE) dune build $(DUNE_OPTIONS) endif build: FORCE | format dune -# Run only in an opam switch with musl and static options activated -build-static: DUNE_OPTIONS+=--profile=static +build-static: LINKING_MODE=static build-static: FORCE build ################################################## diff --git a/src/dune b/src/dune index 1152a9459..713e50ff4 100644 --- a/src/dune +++ b/src/dune @@ -3,13 +3,17 @@ (flags (:standard -warn-error -A)))) +(rule + (with-stdout-to + linking-flags-mlang.sexp + (run ./gen-linking-flags.sh %{env:LINKING_MODE=dynamic} + %{ocaml-config:system}))) + (executable (name main) (package mlang) (public_name mlang) - (libraries mlang) (flags - (:standard -verbose -noautolink -cclib -Wl,-Bstatic -cclib -lgmp_caml - -cclib -lmpfr -cclib -lgmp -cclib -lcamlidl -cclib -lnums -cclib - -lthreadsnat -cclib -lparmap_stubs -cclib -lANSITerminal_stubs -cclib - -Wl,-Bdynamic -cclib -lpthread -cclib -lunix -cclib -ldl))) + (:standard + (:include linking-flags-mlang.sexp))) + (libraries mlang)) diff --git a/src/gen-linking-flags.sh b/src/gen-linking-flags.sh new file mode 100755 index 000000000..bb7170e57 --- /dev/null +++ b/src/gen-linking-flags.sh @@ -0,0 +1,41 @@ +#!/bin/sh +set -ue + +# Copied on https://ocamlpro.com/fr/blog/2021_09_02_generating_static_and_portable_executables_with_ocaml/ + +LINKING_MODE="$1" +OS="$2" +FLAGS= +CCLIB= + +case "$LINKING_MODE" in + '') + ;; # No extra flags needed + static) + case "$OS" in + linux) + FLAGS="-noautolink" + CCLIB="-Wl,-Bstatic -lgmp_caml -lmpfr -lgmp -lnums \ + -lthreadsnat -lparmap_stubs -lANSITerminal_stubs \ + -Wl,-Bdynamic -lpthread -lunix" + LIBS="" + OCAML_LIBS="camlidl" + for lib in $LIBS; do + CCLIB="$CCLIB $(pkg-config $lib --variable libdir)/$lib.a" + done + for lib in $OCAML_LIBS; do + CCLIB="$CCLIB $(ocamlfind query $lib)/lib$lib.a" + done;; + *) + echo "No known static compilation flags for '$OS'" >&2 + exit 1 + esac;; + *) + echo "Invalid linking mode '$LINKING_MODE'" >&2 + exit 2 +esac + +echo '(' +for f in $FLAGS; do echo " $f"; done +for f in $CCLIB; do echo " -cclib $f"; done +echo ')' From f10bc64da52695560dbca0ad4728ac1e4859dfef Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Wed, 20 Mar 2024 17:14:33 +0100 Subject: [PATCH 15/16] Simpler github action that works --- .github/workflows/binary-releases.yml | 180 ++++++++++++-------------- 1 file changed, 82 insertions(+), 98 deletions(-) diff --git a/.github/workflows/binary-releases.yml b/.github/workflows/binary-releases.yml index 5bc5f5342..0baefc43b 100644 --- a/.github/workflows/binary-releases.yml +++ b/.github/workflows/binary-releases.yml @@ -6,96 +6,75 @@ on: workflow_dispatch: jobs: + create-release: + runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.create-new-release.outputs.upload_url }} + steps: + - name: Create GitHub release + id: create-new-release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.run_number }} + release_name: Release ${{ github.run_number }} + + macos-build: + runs-on: macos-latest + needs: create-release -# create-release: -# runs-on: ubuntu-latest -# outputs: -# upload_url: ${{ steps.create-new-release.outputs.upload_url }} -# steps: -# - name: Create GitHub release -# id: create-new-release -# uses: actions/create-release@v1 -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# with: -# tag_name: ${{ github.run_number }} -# release_name: Release ${{ github.run_number }} - - -# macos-build: -# runs-on: macos-latest -# needs: create-release -# -# steps: -# - uses: actions/checkout@v2 -# -# - name: Opam modules cache -# uses: actions/cache@v1 -# env: -# cache-name: cache-opam-modules -# with: -# path: ~/.opam -# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('mlang.opam', 'Makefile') }} -# restore-keys: | -# ${{ runner.os }}-build-${{ env.cache-name }}- -# ${{ runner.os }}-build- -# ${{ runner.os }}- -# -# - name: Set up OCaml -# uses: ocaml/setup-ocaml@v2 -# with: -# ocaml-compiler: 4.11.2 -# -# - name: Install dependencies -# run: | -# brew install gmp mpfr -# opam update -# make init-without-switch -# -# - name: Make mlang binary -# run: | -# eval $(opam env) -# make build -# -# - name: Upload release asset -# uses: actions/upload-release-asset@v1 -# env: -# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# with: -# upload_url: ${{ needs.create-release.outputs.upload_url }} -# asset_path: ./_build/default/src/main.exe -# asset_name: mlang-macos-v${{ github.run_number }}.exe -# asset_content_type: application/octet-stream + steps: + - uses: actions/checkout@v2 + + - name: Opam modules cache + uses: actions/cache@v1 + env: + cache-name: cache-opam-modules + with: + path: ~/.opam + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('mlang.opam', 'Makefile') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + + - name: Set up OCaml + uses: ocaml/setup-ocaml@v2 + with: + ocaml-compiler: 4.11.2 + + - name: Install dependencies + run: | + brew install gmp mpfr + opam update + make init-without-switch + + - name: Make mlang binary + run: | + eval $(opam env) + make build + + - name: Upload release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create-release.outputs.upload_url }} + asset_path: ./_build/default/src/main.exe + asset_name: mlang-macos-v${{ github.run_number }}.exe + asset_content_type: application/octet-stream linux-build: # The type of runner that the job will run on runs-on: ubuntu-latest - # needs: create-release + needs: create-release # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - - uses: jirutka/setup-alpine@v1 - with: - branch: v3.15 - packages: > - findutils - make - curl - git - sudo - patch - rsync - m4 - gcc - libc-dev - gmp-dev - mpfr-dev - perl - coreutils - - name: Opam modules cache uses: actions/cache@v1 env: @@ -109,28 +88,33 @@ jobs: ${{ runner.os }}-build- ${{ runner.os }}- + # TODO : Cache gmp and mpfr builds + + - name: Set up OCaml + uses: ocaml/setup-ocaml@v2 + with: + # Version of the OCaml compiler to initialise + ocaml-compiler: 4.11.2 + - name: Install dependencies run: | - curl -L https://github.com/ocaml/opam/releases/download/2.1.5/opam-2.1.5-x86_64-linux > opam - install opam /usr/local/bin/opam - rm -rf opam - opam init --yes --disable-sandboxing --compiler=4.11.2 --shell-setup - eval $(opam env --switch=4.11.2) - opam install . --deps-only - shell: alpine.sh {0} - + sudo apt update + sudo apt install m4 perl python3 clang git build-essential lzip libgmp-dev libmpfr-dev + eval $(opam env) + opam update + make init-without-switch + - name: Make mlang binary run: | eval $(opam env) make build-static - shell: alpine.sh {0} - - # - name: Upload release asset - # uses: actions/upload-release-asset@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # upload_url: ${{ needs.create-release.outputs.upload_url }} - # asset_path: ./_build/default/src/main.exe - # asset_name: mlang-linux-v${{ github.run_number }}.exe - # asset_content_type: application/octet-stream + + - name: Upload release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ needs.create-release.outputs.upload_url }} + asset_path: ./_build/default/src/main.exe + asset_name: mlang-linux-v${{ github.run_number }}.exe + asset_content_type: application/octet-stream From 237724f3fe1403776fc13d5c65f778f075cdb5d1 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Wed, 20 Mar 2024 17:19:19 +0100 Subject: [PATCH 16/16] Correct default value --- src/dune | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/dune b/src/dune index 713e50ff4..0dc5ca563 100644 --- a/src/dune +++ b/src/dune @@ -6,8 +6,7 @@ (rule (with-stdout-to linking-flags-mlang.sexp - (run ./gen-linking-flags.sh %{env:LINKING_MODE=dynamic} - %{ocaml-config:system}))) + (run ./gen-linking-flags.sh %{env:LINKING_MODE=} %{ocaml-config:system}))) (executable (name main)