Skip to content
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

Update deps and builtins #16

Merged
merged 3 commits into from
Dec 1, 2024
Merged

Conversation

lukewilliamboswell
Copy link
Contributor

Partially completed. I'm stuck a little on updating the Parser, but thought I would share progress so far.

I was updating this as it's it may be related to this issue lukewilliamboswell/roc-htmx-tailwindcss-demo#3

@igray
Copy link

igray commented Dec 1, 2024

I arrived here from lukewilliamboswell/roc-htmx-tailwindcss-demo#3 and wasn't sure if it was more appropriate to post here or there, but these seem to be specific to rtl:

While #16 does compile, this line needs to be changed to File.writeUtf8 (compile templates extension) filePath because the parameter order has changed.

Also, maybe this is a linux thing, but when I build rtl optimized with roc build rtl.roc --optimize --linker=legacy, the cli arguments seem to be ignored completely:

../rtl/rtl -e "html" -i ./templates/ -o ./src/Views/
INFO: Searching for templates in . with extension .rtl
INFO: No templates found

... I must roc run ../rtl/rtl.roc -- -e "html" -i ./templates/ -o ./src/Views before it will start recognizing CLI arguments. Once I've run roc run once, the resulting binary also recognizes the CLI arguments: ../rtl/rtl -e "html" -i ./templates/ -o ./src/Views.

There is one more issue, but it seems to be harmless since I can build the project with the resulting Pages.roc:

../rtl/rtl -e "html" -i ./templates/ -o ./src/Views
INFO: Searching for templates in ./templates/ with extension .html
INFO: Compiling templates
INFO: Generated ./src/Views/Pages.roc in 42ms
INFO: Running `roc check` on ./src/Views/Pages.roc
An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: <https://github.com/roc-lang/roc/issues/new/choose>
Outstanding references to the derived module
Location: crates/compiler/load_internal/src/file.rs:3310:29

@isaacvando isaacvando merged commit 825f08d into isaacvando:main Dec 1, 2024
1 check passed
@isaacvando
Copy link
Owner

isaacvando commented Dec 1, 2024

Thanks for reporting those issues and sorry you ran into them @igray!

I just merged this PR so you can build from main now FYI @lukewilliamboswell.

Also, maybe this is a linux thing, but when I build rtl optimized with roc build rtl.roc --optimize --linker=legacy, the cli arguments seem to be ignored completely:

Hm that's odd, I haven't run into that before. Unfortunately I don't have a linux machine accessible to test on right now. Does that happen if you build rtl without adding --optimize?

There is one more issue, but it seems to be harmless since I can build the project with the resulting Pages.roc:

I believe that is this issue roc-lang/roc#7127.

@igray
Copy link

igray commented Dec 2, 2024

Thanks for looking into this @isaacvando! I can confirm main builds and runs now.

I realize this cli/args issue likely has nothing to do with this project and rather belongs to the basic-cli repository, so I will put together an MRE and submit an issue there, but to follow up to your question:

No, building without --optimize does not change anything. Here's a more concise example:

❯ roc build rtl.roc --linker=legacy --optimize
0 errors and 0 warnings found in 37684 ms
 while successfully building:

    rtl

❯ ./rtl -i examples/basePage
INFO: Searching for templates in . with extension .rtl
INFO: No templates found

❯ roc build rtl.roc --linker=legacy
0 errors and 0 warnings found in 964 ms
 while successfully building:

    rtl

❯ ./rtl -i examples/basePage
INFO: Searching for templates in . with extension .rtl
INFO: No templates found

❯ roc run rtl.roc -- -i examples/basePage
INFO: Searching for templates in examples/basePage with extension .rtl
INFO: Compiling templates
INFO: Generated ./Pages.roc in 0ms
INFO: Running `roc check` on ./Pages.roc
0 errors and 0 warnings found in 16 ms

❯ ./rtl -i examples/basePage
INFO: Searching for templates in examples/basePage with extension .rtl
INFO: Compiling templates
INFO: Generated ./Pages.roc in 1ms
INFO: Running `roc check` on ./Pages.roc
0 errors and 0 warnings found in 17 ms

Note: roc-lang/roc#7127 is not happening in the above example, but still does when running from roc-htmx-tailwindcss-demo via ../rtl/rtl -e "html" -i ./templates/ -o ./src/Views-- I'm guessing that has to do with the contents of the templates in that project.

@isaacvando
Copy link
Owner

Thanks @igray! Can you link the basic-cli issue here once you open it?

@igray
Copy link

igray commented Dec 3, 2024

@isaacvando After reproducing locally, I'm convinced this is roc-lang/basic-cli#82 . It happens every time with --linker=legacy, regardless of whether --optimize is included or not. Anyway, I'm glad it's a known issue.

@isaacvando
Copy link
Owner

Ah okay, glad to hear it's known. Thanks for looking into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants