Skip to content

[build] Consolidation of build system infrastructure#15560

Merged
coqbot-app[bot] merged 2 commits intorocq-prover:masterfrom
ejgallego:build+coq_dune
Jun 28, 2022
Merged

[build] Consolidation of build system infrastructure#15560
coqbot-app[bot] merged 2 commits intorocq-prover:masterfrom
ejgallego:build+coq_dune

Conversation

@ejgallego
Copy link
Copy Markdown
Contributor

@ejgallego ejgallego commented Jan 27, 2022

We replace both the dune-based (coq.theory ...) and the "legacy"
make-based build systems for .vo into a single setup, based on our own
Dune rule generation using a coq_dune tool.

This requires a bootstrap process to generate the rule files, until
Dune gets support for (include stdlib_rules.sexp) (hopefully soon)

By disabling the (coq.theory ...) stanza on theories/dune we lose
compositional building of .vo libs (for OCaml we are still fine, which
our main use case), this is not really used as of today so we are
fine.

This should supersede #15545 , avoid many troubles that #15220 had
to endure.

PRs for Docker and OPAM that need to be merged after this:

List of relevant bugs that should be closed by this PR:

Legacy makefiles will be removed in the next commit, closing a few
more bugs hopefully.

Todos are:

  • quick and async CI jobs
  • rest of of CI / determine obsolete targets
  • install for documentation [check Dune 3.0]
  • changelog / documentation update
  • should we use coqnative? [not for now maybe?]
  • remove the native hackery for loadpaths now that the build system
    can set that up? Likely for a later PR.

At some point some of this code should be moved to a common loadpath
library to compute native target names, and maybe some other stuff.

Some other changes in Nativelib:

  • We fix incorrect early initialization of Boot.Env.t

  • We extend the path passed to the ocamlc compiler as to search for
    files in the dir where the .vo is.

    That can be reverted if we pass all the explicit -nI paths.

    We could just get rid of .coq-native, additionally.

@ejgallego ejgallego added kind: cleanup Code removal, deprecation, refactorings, etc. part: build The build system. labels Jan 27, 2022
@ejgallego

This comment was marked as outdated.

@ejgallego

This comment was marked as outdated.

@SkySkimmer

This comment was marked as outdated.

@SkySkimmer

This comment was marked as outdated.

@ejgallego

This comment was marked as resolved.

@github-actions github-actions Bot added the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Feb 3, 2022
@coqbot-app
Copy link
Copy Markdown
Contributor

coqbot-app Bot commented Mar 7, 2022

The "needs: rebase" label was set more than 30 days ago. If the PR is not rebased in 30 days, it will be automatically closed.

@coqbot-app coqbot-app Bot added the stale This PR will be closed unless it is rebased. label Mar 7, 2022
@coqbot-app

This comment was marked as outdated.

@coqbot-app coqbot-app Bot closed this Apr 6, 2022
@ejgallego ejgallego reopened this Apr 6, 2022
@coqbot-app coqbot-app Bot removed needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. stale This PR will be closed unless it is rebased. labels Apr 6, 2022
@ejgallego

This comment was marked as resolved.

Comment thread .gitlab-ci.yml
Comment thread default.nix
@ejgallego
Copy link
Copy Markdown
Contributor Author

@erikmd yes, I forgot depopts obviously!!! I always get confused.

@Alizter
Copy link
Copy Markdown
Contributor

Alizter commented Jun 24, 2022

Good catch @erikmd!

@coqbot-app
Copy link
Copy Markdown
Contributor

coqbot-app Bot commented Jun 25, 2022

🏁 Bench results:

┌──────────────────────────────┬─────────────────────────┬───────────────────────────────────────┬───────────────────────────────────────┬──────────────────────────┬─────────────────┐
│                              │      user time [s]      │              CPU cycles               │           CPU instructions            │  max resident mem [KB]   │   mem faults    │
│                              │                         │                                       │                                       │                          │                 │
│         package_name         │   NEW      OLD    PDIFF │      NEW             OLD        PDIFF │      NEW             OLD        PDIFF │   NEW      OLD    PDIFF  │ NEW  OLD  PDIFF │
├──────────────────────────────┼─────────────────────────┼───────────────────────────────────────┼───────────────────────────────────────┼──────────────────────────┼─────────────────┤
│   coq-performance-tests-lite │  798.49   805.06  -0.82 │  3621996301316   3654254188293  -0.88 │  6387518391433   6404677592802  -0.27 │ 2056428  2056488   -0.00 │   0    0    nan │
│                coq-fourcolor │ 1469.26  1480.05  -0.73 │  6706256875181   6755528966277  -0.73 │ 12225944940643  12224712993722   0.01 │  724468   724304    0.02 │   0    0    nan │
│                    coq-color │  227.59   228.99  -0.61 │  1029759354305   1038451568230  -0.84 │  1504402232026   1503969612988   0.03 │ 1137324  1136544    0.07 │   0    0    nan │
│                  coq-bignums │   28.34    28.50  -0.56 │   129016920238    130174726834  -0.89 │   183492558215    184688915059  -0.65 │  467440   469040   -0.34 │   0    0    nan │
│                   coq-geocoq │  699.60   703.09  -0.50 │  3188520139541   3205139565925  -0.52 │  5235368901192   5239916902720  -0.09 │  982720   984776   -0.21 │   0    0    nan │
│                     coq-hott │  166.63   167.45  -0.49 │   756006816110    756849756561  -0.11 │  1205242949911   1203113200904   0.18 │  583420   583352    0.01 │   0    0    nan │
│  coq-rewriter-perf-SuperFast │  878.08   882.30  -0.48 │  4007194351518   4025821697712  -0.46 │  7192818569631   7198849801658  -0.08 │ 1231784  1226728    0.41 │   0    0    nan │
│                  coq-coqutil │   35.51    35.68  -0.48 │   159047338793    160821114704  -1.10 │   232471131971    233309499477  -0.36 │  586140   586228   -0.02 │   0    0    nan │
│             coq-math-classes │   96.21    96.59  -0.39 │   436573321324    437725211573  -0.26 │   638220451554    638828619415  -0.10 │  506316   505920    0.08 │   0    0    nan │
│                 coq-coqprime │   43.33    43.49  -0.37 │   196778132908    197407882529  -0.32 │   303242848699    303755717320  -0.17 │  754908   754628    0.04 │   0    0    nan │
│          coq-metacoq-erasure │  183.62   184.23  -0.33 │   832506293410    834823907454  -0.28 │  1351154091756   1350822069583   0.02 │ 1484852  1520748   -2.36 │   0    0    nan │
│             coq-fiat-parsers │  342.08   343.16  -0.31 │  1539321337867   1545690386264  -0.41 │  2581938335593   2577842538772   0.16 │ 3442748  3444192   -0.04 │   0    0    nan │
│                     coq-corn │  802.71   804.81  -0.26 │  3656822829314   3665541851346  -0.24 │  5810768456483   5810532386553   0.00 │  924196   923408    0.09 │   0    0    nan │
│        coq-engine-bench-lite │  170.12   170.48  -0.21 │   734013114544    736634451425  -0.36 │  1400608780661   1399719098231   0.06 │ 1100156  1228044  -10.41 │   0    0    nan │
│                 coq-rewriter │  330.12   330.78  -0.20 │  1506673456911   1508890094703  -0.15 │  2532299024610   2530737106754   0.06 │  968992   969092   -0.01 │   0    0    nan │
│       coq-mathcomp-ssreflect │   25.84    25.88  -0.15 │   117785369472    117410956596   0.32 │   153744848988    153739360070   0.00 │  531992   530824    0.22 │   0    0    nan │
│                 coq-compcert │  294.15   294.60  -0.15 │  1333464821247   1336950796708  -0.26 │  2058554905276   2062951868669  -0.21 │ 1122320  1123344   -0.09 │   0    0    nan │
│ coq-fiat-crypto-with-bedrock │ 5607.19  5613.48  -0.11 │ 25507066056114  25543592694054  -0.14 │ 46693817257948  46688598915935   0.01 │ 3839236  3839276   -0.00 │   0    0    nan │
│                coq-fiat-core │   57.46    57.50  -0.07 │   247226143379    249409678167  -0.88 │   362242755956    361378907271   0.24 │  478012   477384    0.13 │   0    0    nan │
│     coq-metacoq-translations │   14.25    14.25   0.00 │    63841589663     64271666858  -0.67 │   105309542658    105318172461  -0.01 │  772012   775868   -0.50 │   0    0    nan │
│            coq-metacoq-pcuic │  573.34   572.72   0.11 │  2606895258106   2607381688333  -0.02 │  3850626152280   3848213861013   0.06 │ 1722972  1723476   -0.03 │   0    0    nan │
│        coq-mathcomp-fingroup │   22.61    22.57   0.18 │   102926647648    102970574554  -0.04 │   151978960565    152206618586  -0.15 │  486116   486216   -0.02 │   0    0    nan │
│                    coq-verdi │   48.69    48.54   0.31 │   220002693367    219900836886   0.05 │   337124705896    338467412707  -0.40 │  779012   777212    0.23 │   0    0    nan │
│               coq-coquelicot │   35.61    35.50   0.31 │   159557970352    159565187659  -0.00 │   220948182229    218670209344   1.04 │  749740   749092    0.09 │   0    0    nan │
│         coq-metacoq-template │  137.31   136.83   0.35 │   616720701885    615094721746   0.26 │  1025349201769   1021510144556   0.38 │ 1193888  1191464    0.20 │   0    0    nan │
│                     coq-core │  110.33   109.86   0.43 │   462486245428    463001393163  -0.11 │   483423445871    483944313142  -0.11 │  286392   286092    0.10 │   0    0    nan │
│               coq-verdi-raft │  557.68   555.27   0.43 │  2545441095803   2532940350262   0.49 │  4025892259555   4024544800177   0.03 │ 1199228  1195112    0.34 │   0    0    nan │
│            coq-iris-examples │  442.23   440.03   0.50 │  2009972832312   2000605078352   0.47 │  3075903391612   3075908812483  -0.00 │ 1187072  1187232   -0.01 │   0    0    nan │
│       coq-mathcomp-odd-order │  517.58   514.81   0.54 │  2368861711979   2356733908416   0.51 │  4053062251360   4052886247732   0.00 │  864740   867316   -0.30 │   0    0    nan │
│           coq-mathcomp-field │   98.41    97.85   0.57 │   450073264072    447591245588   0.55 │   744399786084    744558934810  -0.02 │  639136   638496    0.10 │   0    0    nan │
│                 coq-bedrock2 │  375.56   373.32   0.60 │  1715109851035   1706015815768   0.53 │  3311339207971   3311175132679   0.00 │ 1830752  1890304   -3.15 │   0    0    nan │
│      coq-metacoq-safechecker │  214.00   212.67   0.63 │   975402323105    968884731168   0.67 │  1462565572446   1462589923848  -0.00 │ 1424944  1420956    0.28 │   0    0    nan │
│                coq-perennial │ 4048.29  4018.38   0.74 │ 18460133037467  18324304925586   0.74 │ 30256019857930  30246927862869   0.03 │ 2594844  2593112    0.07 │   0    0    nan │
│         coq-mathcomp-algebra │   61.42    60.96   0.75 │   280342881787    277928205857   0.87 │   390691979775    390554307589   0.04 │  553032   554132   -0.20 │   0    0    nan │
│          coq-category-theory │ 1016.29  1007.88   0.83 │  4646461193441   4607281112124   0.85 │  7756888980652   7746425127545   0.14 │ 1319784  1334212   -1.08 │   0    0    nan │
│        coq-mathcomp-solvable │   82.69    81.99   0.85 │   377648213622    374552702873   0.83 │   585581769204    585813237775  -0.04 │  646536   646484    0.01 │   0    0    nan │
│                   coq-stdlib │  414.79   410.33   1.09 │  1784170194051   1760842767298   1.32 │  1513723162166   1523913983574  -0.67 │  695984   615820   13.02 │   0    0    nan │
│                  coq-unimath │ 4998.79  4934.55   1.30 │ 22861830295454  22566650876564   1.31 │ 45457838328604  45427302886756   0.07 │ 4018376  3859980    4.10 │   0    0    nan │
│                   coq-flocq3 │   75.56    74.43   1.52 │   342216796867    338519008021   1.09 │   466034699069    462666753144   0.73 │  991452   991960   -0.05 │   0    0    nan │
│       coq-mathcomp-character │   69.58    68.18   2.05 │   317768755985    311576865570   1.99 │   481074061521    480990399327   0.02 │  728136   725372    0.38 │   0    0    nan │
└──────────────────────────────┴─────────────────────────┴───────────────────────────────────────┴───────────────────────────────────────┴──────────────────────────┴─────────────────┘

🐢 Top 25 slow downs
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                               TOP 25 SLOW DOWNS                                                               │
│                                                                                                                                               │
│   OLD       NEW      DIFF    %DIFF    Ln                     FILE                                                                             │
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 109.8470  121.2860  11.4390  10.41%  1104  coq-unimath/UniMath/Bicategories/PseudoFunctors/Preservation/BiadjunctionPreserveInserters.v.html  │
│  55.6290   57.8490   2.2200   3.99%   857  coq-unimath/UniMath/Bicategories/DisplayedBicats/Examples/DisplayedInserter.v.html                 │
│  44.6640   46.2300   1.5660   3.51%   578  coq-bedrock2/bedrock2/src/bedrock2Examples/insertionsort.v.html                                    │
│  44.6750   46.0570   1.3820   3.09%   464  coq-unimath/UniMath/Bicategories/PseudoFunctors/Examples/CompositionPseudoFunctor.v.html           │
│  26.2880   27.5040   1.2160   4.63%   310  coq-unimath/UniMath/Bicategories/PseudoFunctors/Preservation/BiadjunctionPreserveProducts.v.html   │
│  38.8650   40.0430   1.1780   3.03%   520  coq-perennial/src/program_proof/txn/twophase_refinement_proof.v.html                               │
│ 209.8080  210.9010   1.0930   0.52%   139  coq-fiat-crypto-with-bedrock/src/UnsaturatedSolinasHeuristics/Tests.v.html                         │
│  27.7420   28.8330   1.0910   3.93%  1157  coq-unimath/UniMath/Bicategories/DisplayedBicats/Cartesians.v.html                                 │
│  14.4350   15.4180   0.9830   6.81%  1640  coq-unimath/UniMath/Bicategories/DisplayedBicats/FiberBicategory/FiberBicategory1.v.html           │
│  14.7300   15.6890   0.9590   6.51%   541  coq-unimath/UniMath/Bicategories/PseudoFunctors/Examples/ConstProduct.v.html                       │
│  24.0260   24.9120   0.8860   3.69%  2290  coq-perennial/src/goose_lang/logical_reln_fund.v.html                                              │
│  13.8290   14.7120   0.8830   6.39%  1134  coq-unimath/UniMath/Bicategories/PseudoFunctors/Preservation/BiadjunctionPreserveInserters.v.html  │
│  17.2430   18.1120   0.8690   5.04%   580  coq-unimath/UniMath/Bicategories/PseudoFunctors/Preservation/BiadjunctionPreserveCoproducts.v.html │
│  57.2900   58.1590   0.8690   1.52%    50  coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html               │
│  11.4900   12.2180   0.7280   6.34%  1108  coq-unimath/UniMath/Bicategories/DisplayedBicats/FiberBicategory/FiberBicategory1.v.html           │
│   7.2780    7.9800   0.7020   9.65%   858  coq-fiat-crypto-with-bedrock/src/Fancy/Compiler.v.html                                             │
│  56.4040   57.0970   0.6930   1.23%    50  coq-fiat-crypto-with-bedrock/src/Bedrock/Field/Synthesis/Examples/p224_64_new.v.html               │
│   6.1030    6.7930   0.6900  11.31%   342  coq-unimath/UniMath/Bicategories/DisplayedBicats/Examples/Algebras.v.html                          │
│  11.8670   12.5250   0.6580   5.54%  2081  coq-unimath/UniMath/Bicategories/DisplayedBicats/FiberBicategory/FiberBicategory1.v.html           │
│  19.5310   20.1860   0.6550   3.35%   147  coq-unimath/UniMath/Bicategories/PseudoFunctors/Preservation/BiadjunctionPreserveInserters.v.html  │
│ 120.6880  121.3370   0.6490   0.54%   153  coq-fiat-crypto-with-bedrock/src/UnsaturatedSolinasHeuristics/Tests.v.html                         │
│   3.3880    3.9970   0.6090  17.98%   129  coq-fiat-crypto-with-bedrock/src/Curves/Weierstrass/Projective.v.html                              │
│  11.2610   11.8490   0.5880   5.22%  1518  coq-unimath/UniMath/Bicategories/DisplayedBicats/Examples/DisplayedInserter.v.html                 │
│  16.8310   17.4160   0.5850   3.48%  1884  coq-unimath/UniMath/Bicategories/MonoidalCategories/ActionBasedStrongFunctorsMonoidal.v.html       │
│  11.7160   12.2920   0.5760   4.92%   662  coq-unimath/UniMath/Bicategories/DisplayedBicats/FiberBicategory/CodomainFiber.v.html              │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

🐇 Top 25 speed ups
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                               TOP 25 SPEED UPS                                                                │
│                                                                                                                                               │
│   OLD       NEW      DIFF     %DIFF    Ln                     FILE                                                                            │
├───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│  16.5010   14.9530  -1.5480   -9.38%  1286  coq-unimath/UniMath/Bicategories/PseudoFunctors/Preservation/BiadjunctionPreserveInserters.v.html │
│ 133.5700  132.2640  -1.3060   -0.98%    47  coq-fiat-crypto-with-bedrock/src/Curves/Weierstrass/AffineProofs.v.html                           │
│  16.9080   15.6970  -1.2110   -7.16%    30  coq-performance-tests-lite/src/pattern.v.html                                                     │
│  21.2030   20.1700  -1.0330   -4.87%    48  coq-fiat-crypto-with-bedrock/src/Curves/Weierstrass/AffineProofs.v.html                           │
│  34.6180   33.8640  -0.7540   -2.18%    10  coq-fourcolor/theories/job254to270.v.html                                                         │
│  21.8600   21.2410  -0.6190   -2.83%    10  coq-fourcolor/theories/job490to494.v.html                                                         │
│  33.6270   33.0200  -0.6070   -1.81%    10  coq-fourcolor/theories/job001to106.v.html                                                         │
│  77.2300   76.6930  -0.5370   -0.70%    20  coq-fiat-crypto-with-bedrock/src/Rewriter/Passes/NBE.v.html                                       │
│   3.7490    3.2150  -0.5340  -14.24%    24  coq-fiat-crypto-with-bedrock/src/Rewriter/Passes/MultiRetSplit.v.html                             │
│  26.9490   26.4260  -0.5230   -1.94%    10  coq-fourcolor/theories/job503to506.v.html                                                         │
│  27.6470   27.1270  -0.5200   -1.88%    10  coq-fourcolor/theories/job618to622.v.html                                                         │
│  27.4300   26.9520  -0.4780   -1.74%    10  coq-fourcolor/theories/job227to230.v.html                                                         │
│  10.4250    9.9610  -0.4640   -4.45%    28  coq-unimath/UniMath/Bicategories/DisplayedBicats/DispBuilders.v.html                              │
│  50.6450   50.1890  -0.4560   -0.90%    84  coq-fiat-crypto-with-bedrock/src/Curves/Montgomery/AffineProofs.v.html                            │
│  27.6320   27.2160  -0.4160   -1.51%    10  coq-fourcolor/theories/job291to294.v.html                                                         │
│  26.8140   26.4010  -0.4130   -1.54%    10  coq-fourcolor/theories/job319to322.v.html                                                         │
│  31.4490   31.0570  -0.3920   -1.25%    10  coq-fourcolor/theories/job107to164.v.html                                                         │
│  90.5750   90.1900  -0.3850   -0.43%    22  coq-fiat-crypto-with-bedrock/src/Rewriter/Passes/ArithWithCasts.v.html                            │
│  41.6590   41.2840  -0.3750   -0.90%   235  coq-rewriter-perf-SuperFast/src/Rewriter/Rewriter/Examples/PerfTesting/LiftLetsMap.v.html         │
│  41.6380   41.2720  -0.3660   -0.88%   235  coq-rewriter/src/Rewriter/Rewriter/Examples/PerfTesting/LiftLetsMap.v.html                        │
│  27.7540   27.3880  -0.3660   -1.32%    10  coq-fourcolor/theories/job517to530.v.html                                                         │
│  55.4920   55.1320  -0.3600   -0.65%   820  coq-unimath/UniMath/SubstitutionSystems/LiftingInitial.v.html                                     │
│  31.3800   31.0400  -0.3400   -1.08%    10  coq-fourcolor/theories/job563to588.v.html                                                         │
│  22.0870   21.7570  -0.3300   -1.49%    10  coq-fourcolor/theories/job546to549.v.html                                                         │
│   0.3300    0.0060  -0.3240  -98.18%  1921  coq-perennial/src/program_proof/wal/recovery_proof.v.html                                         │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

@erikmd
Copy link
Copy Markdown
Contributor

erikmd commented Jun 26, 2022

@erikmd yes, I forgot depopts obviously

@ejgallego could you please push another commit that adds

depopts: [
  "coq-native"
]

in coq.opam, coq-core.opam and coq-stdlib.opam ?

Then, I'll re-trigger the build of coqorg/coq:newdev-native, to test everything is OK
before merging PR coq-community/docker-coq#50 then #15560

@ejgallego
Copy link
Copy Markdown
Contributor Author

Done thanks @erikmd , I added it to coq-core.opam only, as I understand that's the only package that checks that value.

coq-stdlib will be rebuilt when coq-core is. Does my reasoning sound correct?

I've also updated the dune-project file, we should start thinking of generating our opam files automatically now that we depend on dune 2.9

@erikmd
Copy link
Copy Markdown
Contributor

erikmd commented Jun 27, 2022

@ejgallego thanks!

I added it to coq-core.opam only, as I understand that's the only package that checks that value.

I wouldn't say that exactly, because coq-stdlib.opam contains this line also:

"-native-compiler" "yes" {coq-native:installed} "no" {!coq-native:installed}

So even if coq-stdlib should normally be automatically/indirectly rebuilt (because coq-stdlib depends on coq-core),
I'd say it would be safer (and maybe more legible?) to also add the depopts in coq-stdlib.opam… WDYT?

But regarding coq.opam I have no objection at all, to skip the depopts clause indeed.

@ejgallego
Copy link
Copy Markdown
Contributor Author

ejgallego commented Jun 27, 2022

So even if coq-stdlib should normally be automatically/indirectly rebuilt (because coq-stdlib depends on coq-core),
I'd say it would be safer (and maybe more legible?) to also add the depopts in coq-stdlib.opam… WDYT?

Yes I think you are right, in the sense that it would be possible for coq-core to actually not depend on coq-native (for example if we would use coqnative binary, and then the rules for coq-stdlib would go that way, and in fact, installing coq-native would only rebuild coq-stdlib

coqnative is too slow tho so I didn't enable it by default.

@erikmd
Copy link
Copy Markdown
Contributor

erikmd commented Jun 27, 2022

coqnative is too slow tho so I didn't enable it by default.

@ejgallego can you be more specific?

do you still confirm that when -native-compiler yes is passed to ./configure, the generation of .coq-native/*.cmxs files behaves the same with this PR w.r.t. before this PR (regarding their availability and their paths) ?

@erikmd
Copy link
Copy Markdown
Contributor

erikmd commented Jun 27, 2022

@Alizter you removed the label needs: fixing but IINM the following detail is still missing:

"…it would be safer (and maybe more legible) to also add the depopts in coq-stdlib.opam…"

@Alizter
Copy link
Copy Markdown
Contributor

Alizter commented Jun 27, 2022

@erikmd I removed the "needs: fixing" label since I added it about the native compilation and that issue specifically has been fixed. I did say I would possibly merge today, however I have decided not to just yet until all these details are fully resolved.

@proux01
Copy link
Copy Markdown
Contributor

proux01 commented Jun 27, 2022

do you still confirm that when -native-compiler yes is passed to ./configure, the generation of .coq-native/*.cmxs files behaves the same with this PR w.r.t. before this PR (regarding their availability and their paths) ?

@erikmd : yes, c.f., the opam:native job in .gitlab-ci.yml

We replace both the dune-based `(coq.theory ...)` and the "legacy"
make-based build systems for .vo into a single setup, based on our own
Dune rule generation using a coq_dune tool.

This requires a bootstrap process to generate the rule files, until
Dune gets support for `(include stdlib_rules.sexp)` (hopefully soon)

By disabling the `(coq.theory ...)` stanza on `theories/dune` we lose
compositional building of .vo libs (for OCaml we are still fine, which
our main use case), this is not really used as of today so we are
fine.

This should supersede rocq-prover#15545 , avoid many troubles that rocq-prover#15220 had
to endure, and close rocq-prover#15482 .

Legacy makefiles will be removed in the next commit, closing a few
more bugs hopefully.

At some point some of this code should be moved to a common loadpath
library to compute native target names, and maybe some other stuff.

Some other changes in `Nativelib`:

- We fix incorrect early initialization of `Boot.Env.t`

- We extend the path passed to the ocamlc compiler as to search for
  files in the dir where the .vo is.

  That can be reverted if we pass all the explicit `-nI` paths.

  We could just get rid of `.coq-native`, additionally.
coqdep was using a mixed separator scheme on Windows, to avoid
makefile quoting bugs. As we want to support non-cygwin envs, we
disable this hack for the Dune build, thus using paths fully native to
windows.
@Alizter
Copy link
Copy Markdown
Contributor

Alizter commented Jun 28, 2022

Merging after rocq-community/docker-coq#50

@Alizter
Copy link
Copy Markdown
Contributor

Alizter commented Jun 28, 2022

Merging when green

@Alizter
Copy link
Copy Markdown
Contributor

Alizter commented Jun 28, 2022

@coqbot merge now

@coqbot-app
Copy link
Copy Markdown
Contributor

coqbot-app Bot commented Jun 28, 2022

@Alizter: Please take care of the following overlays:

  • README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: cleanup Code removal, deprecation, refactorings, etc. kind: infrastructure CI, build tools, development tools. part: build The build system.

Projects

None yet