-
Notifications
You must be signed in to change notification settings - Fork 84
Fix flags for BuckleScript packages so that ppxs binaries can be found #360
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
Conversation
|
Pasting from the convo in Discord: If bsb will generate full path in merlin but if it's just a string without slashes: it generates: From https://bucklescript.github.io/bucklescript/docson/#build-schema.json:
So after understanding that bsb expects the format to be |
|
ok, makes sense :) |
|
@jchavarri looks like the 7.0.1 example is failing on windows |
|
@jaredly hm... the ppx definitely works on windows, we test it with a similar test project as the one here, see this build, windows job, step It seems the ppx can't find the input ast binary file in temp folder, I wonder if this has to do with the rls tests themselves? I originally thought it could be related to Azure setup , but I see how Appveyor ci fails too. Any ideas are more than welcome :) |
|
I managed to run the failing command locally in a Windows machine. It works. I checked the command with # In local machine (success)
c:\Users\IEUser\Downloads\bs-7.0.1\node_modules\@ahrefs\bs-emotion-ppx\bin\bs-emotion-ppx
"C:\Users\IEUser\AppData\Local\Temp\camlppx7cd714"
"C:\Users\IEUser\AppData\Local\Temp\camlppxb65b00"
# In CI machine (Appveyor, failed)
C:\projects\reason-language-server\examples\bs-7.0.1\node_modules\@ahrefs\bs-emotion-ppx\bin\bs-emotion-ppx
"C:\Users\appveyor\AppData\Local\Temp\1\camlppx824bf8"
"C:\Users\appveyor\AppData\Local\Temp\1\camlppx07d31e"
# In CI machine (Azure, failed)
d:\a\1\s\examples\bs-7.0.1\node_modules\@ahrefs\bs-emotion-ppx\bin\bs-emotion-ppx
"C:\Users\VSSADM~1\AppData\Local\Temp\camlppx70408b"
"C:\Users\VSSADM~1\AppData\Local\Temp\camlppxf275e9" |
|
hm, I'm trying to change that so that Azure runs @jaredly It'd be really helpful to get the Azure cache PR reviewed and hopefully merged. It's very slow to debug this Windows stuff, as each build is taking 23+min 🐢 :) |
Narrator: it wasn't that. |
|
@jaredly I rolled back the changes due to new example with ppx, as I couldn't figure out why the builds were failing on Windows. I tried node 8 and node 12, 32 and 64 bits, yarn and npm, windows 2017 and 2019, with and without esy, etc. In the end, I managed to make test fail in both Appveyor and Azure by just The most confusing thing is that we're running similar tests in bs-emotion repo and I haven't seen anything like this. Maybe the changes in #361 will help? |
|
Ok, it's passing now, so I guess we're good to go! |

There seemed to be an issue where
MerlinFile.getFlags(used exclusively for BuckleScript packages as far as I can tell) was indirectly callingfixPpxwhich appears to be a fix for just bs-native, not regular bs.This resulted in RLS erroring where a regular ppx binary
foowas being called withlib/bs/native/foo.nativewhich didn't exist.Also, another issue was that BuckleScript runs ppxs with
node-module/.binin path, which breaks when RLS runsbscmanually just picking the name of the file from merlin.This PR:
fixPpxfromMerlinFile.parseMerlinas it's not needed for BuckleScriptfixPpxtofixPpxBsNativefor clarity to avoid potential issues like the one abovemakePathForPpxBsthat prefixes the ppx binary paths withnode_modules/.bin.As a side note, I found this because we migrated
bs-emotion-ppxfrom bsb-native to esy, and now the binary name is justbs-emotion-ppx(which is added to"bin"field inpackage.json). I'm not sure if other ppxs would be in the same situation.