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

[WINDOWS] On startup from the zip distrubtion main.R is not run #264

Open
gjwgit opened this issue Aug 8, 2024 · 17 comments · Fixed by #458
Open

[WINDOWS] On startup from the zip distrubtion main.R is not run #264

gjwgit opened this issue Aug 8, 2024 · 17 comments · Fixed by #458
Assignees
Labels
bug Something isn't working

Comments

@gjwgit
Copy link
Owner

gjwgit commented Aug 8, 2024

Description

For the zip distribution of the rattlng package for Windows, when running the rattle.exe on Windows, after R starts up in the CONSOLE it does not run the main.R script. On Linux and MacOS the main.R script is run on startup.

This task is to investigate why main.R is not run on starting up rattle.exe on Windows.

@gjwgit
Copy link
Owner Author

gjwgit commented Aug 8, 2024

Note that I can paste the contents of main.R into the CONSOLE to have it run and then rattle will operate for that session as expected.

Perhaps it just needs main.R to be loaded later on - perhaps on the first (or every) loading of the dataset

@gjwgit gjwgit added the bug Something isn't working label Aug 8, 2024
@gjwgit gjwgit changed the title WINDOWS: On startup from the zip distrubtion main.R is not run [WINDOWS] On startup from the zip distrubtion main.R is not run Aug 8, 2024
@gjwgit
Copy link
Owner Author

gjwgit commented Aug 9, 2024

Unfortunately this fix causes the following error for Linux:

flutter run --device-id linux
Launching lib/main.dart on Linux in debug mode...
Building Linux application...                                   
/home/gjw/git/github/gjwgit/rattleng/linux/flutter/ephemeral/.plugin_symlinks/flutter_pty/src/flutter_pty_unix.c:114:5: error: call to undeclared function 'waitpid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
Error: Build process failed

Reverting for now.

@Lutra-Fs
Copy link
Collaborator

Lutra-Fs commented Aug 9, 2024

See TerminalStudio/flutter_pty#16. not test for linux so sorry for the issue introduced. I could create a fork with those fix and then we depend on that repo if you agree.

@gjwgit
Copy link
Owner Author

gjwgit commented Aug 9, 2024

Let's give it a go.

@gjwgit
Copy link
Owner Author

gjwgit commented Aug 9, 2024

Does this solve the issue for you @Lutra-Fs? I still do not have main.R being pushed into the Terminal on startup in Windows.

@gjwgit
Copy link
Owner Author

gjwgit commented Aug 9, 2024

To investigate

  • Copy and paste in the Console no longer functional?
  • Move main.R into dataset_prep.R instead

@gjwgit
Copy link
Owner Author

gjwgit commented Aug 9, 2024

I will stick with the main.R inside dataset_prep.R for now - there is a small delay after loading the dataset before the pages are populated but might be okay.

@gjwgit gjwgit closed this as completed Aug 9, 2024
@Lutra-Fs
Copy link
Collaborator

Lutra-Fs commented Aug 9, 2024

Does this solve the issue for you @Lutra-Fs? I still do not have main.R being pushed into the Terminal on startup in Windows.

I didn't have that version in my pc so far. Will checkout the commit and see what happened here.

@Lutra-Fs
Copy link
Collaborator

Lutra-Fs commented Aug 9, 2024

Does this solve the issue for you @Lutra-Fs? I still do not have main.R being pushed into the Terminal on startup in Windows.

Just have a quick check and I could confirm that in my build main.R works fine even the loading is in start stage.

@Lutra-Fs
Copy link
Collaborator

Lutra-Fs commented Aug 9, 2024

image

@gjwgit
Copy link
Owner Author

gjwgit commented Aug 9, 2024

We need to fix the version number problem on Windows so I can see the version in the screenshots - #273 - perhaps you could debug that. Thanks.

Can you share the screenshot of the Console tab - that is where the code is executed. It is simply displayed in the Script tab so there is no indication there that it has run.

On Linux and MacOS I see this:

Image

@Lutra-Fs
Copy link
Collaborator

We need to fix the version number problem on Windows so I can see the version in the screenshots - #273 - perhaps you could debug that. Thanks.

Can you share the screenshot of the Console tab - that is where the code is executed. It is simply displayed in the Script tab so there is no indication there that it has run.

On Linux and MacOS I see this:

Image

Just have a deeper test and you're right. The pty received the start.R first, then the R console is ready to go, so there should be some issue between flutter-pty ConPty and R

@Lutra-Fs Lutra-Fs reopened this Aug 10, 2024
@gjwgit
Copy link
Owner Author

gjwgit commented Aug 10, 2024

Thanks. Yes I suspect the async/sync needs work. In Linux I see the contents of main.R in the console before the R process starts, yet it gets executed anyhow. Same for MacOS I think. Seems like on Windows it does not end up getting executed or gets pushed to the Console before the console is ready. The process needs to be corrected to work under these scenarios.

@Lutra-Fs
Copy link
Collaborator

link to #298

@Lutra-Fs
Copy link
Collaborator

Looks like I got it fixed by adding extra measure to ensure Pty is correctly initialised then some extra delay.
image

@gjwgit
Copy link
Owner Author

gjwgit commented Sep 23, 2024

This update did not seem to fix the problem for me on my Windows test machine. Plus running the test suite caused other tests to now fail. I have reverted the change.

@gjwgit gjwgit reopened this Sep 23, 2024
@Lutra-Fs
Copy link
Collaborator

Lutra-Fs commented Oct 5, 2024

Sry for the delayed reply, the video is available at https://filesender.aarnet.edu.au/?s=download&token=d1a5d60a-cf57-41bc-b075-82b20b0f442b and will expire at 26/10/2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants