- Notifications
You must be signed in to change notification settings - Fork 471
Build with esy #3825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build with esy #3825
Conversation
ba4b176 to aa84dd6 Compare | hi @ulrikstrid we are happy to make it build with esy.
|
| Looks like CI is timing out. |
| @bobzhang I have updated the description of the PR, I forgot to add it when I opened the PR. There is something wrong with the CI setup that I can't explain, do you want me to just remove it for now? If this gets merged I would be happy to open a PR for Azure Pipelines setup where we can do corssplatform builds like we do in many other |
| We can just disable the CI for esy stuff, and enable azure pipelines (or github actions) since they have great esy caching integration anyways. Maybe we should move everything to Azure/Actions since you can have all three platforms CI in one place? |
| If -env is not relied on, let’s remove it, it was introduced to allow switching compilers instantly , but in practice, it’s not used that much |
| @bobzhang I'm using If we only had the esy workflow we wouldn't need to have the git submodule since it's modeled as a dependency instead. As soon as the OCaml changes are applied on the 4.06.1+BS branch I should in theory be apple to just add a package.json there and add a resolution to that branch. |
| @ulrikstrid I'm following along the developments here. As the same learning can then be applied here: rescript-association/genType#100. |
| @ulrikstrid so you do rely on -env flag to pick the compiler from esy instead of vendored, right? Edit: what's your goal here? are you trying to make people install bs-platform using esy (I guess it is) or trying to make people develop bucklescript using esy? Btw, how do we know the script is running under esy, by some env variable, and env will inject some PATHs to make ocaml available? |
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.
Does this work on windows?
| @@ -0,0 +1,80 @@ | |||
| { | |||
| "name": "bs-platform", | |||
| "version": "5.2.0-dev.2", | |||
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.
Do we need maintain this, if so, which other fields do we need watch?
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.
Except for "dependencies", "devDependencies", "resolutions" and "esy" it's a copy of the normal package.json, I think we could just remove most fields if we don't want them here.
scripts/buildocaml.js Outdated
| } else { | ||
| file = path.join(__dirname, "..", "ocaml", "VERSION"); | ||
| } | ||
| if (!fs.existsSync(file)) { |
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.
lgtm
| myVersion, | ||
| "bin", | ||
| "ocamlopt.opt" | ||
| ); |
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.
lgtm
| async function runtimeNinja(devmode = true) { | ||
| var ninjaCwd = "runtime"; | ||
| var externalDeps = devmode ? [compilerTarget] : []; | ||
| var ninjaOutput = devmode |
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.
can we keep this file unchanged for this PR
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.
env.ninja is not used and maintained for a while, we may consider removing it and add the corresponding one 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.
I reverted changes to ninja.js
esy.json Outdated
| }, | ||
| "esy": { | ||
| "buildsInSource": true, | ||
| "buildDev": [ |
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.
Should I remove this part as well since the ninja.js file is not working with the setup any more? @bobzhang
15f3cc0 to 9856631 Compare | Rebased on master to fix conflict in |
| Would you provide a doc or guide on how to use bs-platform with esy? Thanks |
| Thank you @ulrikstrid ! |
This PR adds a esy.json to allow a workflow that is just, clone the repo and run 2
esycommands (can be shortened to just 1 if you runesy) and then you build the whole project.It depends on this PR to the ocaml fork which adds a package.json into the repo so that we can depend on the ocaml version via
esy: rescript-lang/ocaml#35The changes in ninja.js where needed since I couldn't get it to work with the
-envflag otherwise, if someone can point me to what I'm doing wrong please let me know and I'll revert those changes. I think the "normal" workflow should still work.