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

Inconsistencies detected when cross-compiling #27

Closed
gcarreno opened this issue Feb 19, 2021 · 14 comments
Closed

Inconsistencies detected when cross-compiling #27

gcarreno opened this issue Feb 19, 2021 · 14 comments

Comments

@gcarreno
Copy link
Collaborator

Hey Werner(@wp-xyz),

I'm opening this issue primarily to list the inconsistencies and secondly for us to have a chat about it.

x86_64-linux:

  • Nothing to report here since it's what I'm testing on IDE

i386-linux:

  • TComboBox has very squary corners and the rest of the UI is also strange.
    corona-square-combobox
  • Does not update TProgressBar, only TLabel.
  • I still need to compare with lazbuild from trunk, as I'm building with stable 2.0.10 for releases. Maybe I have gremlins somewhere.

x86_64-win64:

  • Is misbehaving on downloads, but I'm aware that my wine install does not work well with HTTPS and win64.

i386-win32:

  • Does not have an issue with HTTPS. The initial code I sent you was doing well here.
  • Somehow it gets stuck. Dunno where though, need to investigate.

This is where I'm at.
I have to admit that my cross-compiling now seems to be less healthy than I thought. Maybe need to refresh my stuff with a full install from fpcupdeluxe on the cross-compile. Don has made some changes quite recently...

Cheers,
Gus

@gcarreno gcarreno changed the title Inconsistencies detected whe cross-compiling Inconsistencies detected when cross-compiling Feb 19, 2021
@wp-xyz
Copy link
Owner

wp-xyz commented Feb 19, 2021

Checked it myself ("real" or virtual systems, no cross-compiling):

  • Linux Mint LMDE (notebook)/gtk2 and qt, 32 bit: Progressbar ok, UI looks correct (the same on the other systems below, but I'm not a hard-core Linux user). Had to update Laz from 2.06 to 2.0.10 because the fpc 3.0.4 failed with the opensslsockets unit. This notebook has problems with internet access sometimes, here already in this Laz/FPC download, later in corona for getting the RKI files. No problems any more after reboot.
  • LMDE3 VM/gtk2 64 bit: no download problems. Scrollbar ok. Autosizing of clbCases not correct.
  • Lubuntu 20.10, VM/64 bit, gtk2 and qt5: no problems. cbDataType item spacing could be larger in qt5. Text underlengths (e.g. in "g") truncated in gtk2 (well-known issue with some Ubuntu-based distributions).,
  • macOS Mojave 10.14 VM/64 bit: Have Laz 2.0.6/FPC 3.0.4 only. Before installing 2.010/3.2.0 I had the idea to replace the "opensslsockets" unit by "openssl", and this was accepted. Download ok (slow, though, a VM issue?). The cmbDataType combobox has display issues when the list is dropped down: text seems to be truncated to the width of the combo in the lfm file, no update when later the combobox is resized for autosizing. Should be reported.

@gcarreno
Copy link
Collaborator Author

gcarreno commented Feb 19, 2021

Hey Werner(@wp-xyz),

That's awesome!! Well, for the most of the "works fine" and "known issue" 😃

Could I ask you a favour and test my cross-compiled binaries please?

corona-v1.0.0-i386-linux.tar.gz
corona-v1.0.0-i386-win32.zip
corona-v1.0.0-x86_64-linux.tar.gz
corona-v1.0.0-x86_64-win64.zip

Thanks!!!

BTW, I think we need a better communication line. What do you think about these option:

  • Telegram
  • Signal (Will not do WhatsApp NOR Slack :P )
  • EDIT: Discord?
  • IRC

Cheers,
Gus

wp-xyz added a commit that referenced this issue Feb 19, 2021
… (Fix dropdown painting issue on macOS - github issue #27
wp-xyz added a commit that referenced this issue Feb 19, 2021
* Set cmbDataType.Style to csDropDownList (instead of csOwnerDrawFixed). This fixes the dropdown painting issue on macOS (github isse #27)
@wp-xyz
Copy link
Owner

wp-xyz commented Feb 19, 2021

Could I ask you a favour and test my cross-compiled binaries please?

corona-v1.0.0-i386-linux.tar.gz
corona-v1.0.0-i386-win32.zip
corona-v1.0.0-x86_64-linux.tar.gz
corona-v1.0.0-x86_64-win64.zip

All of them are working correctly: no download error, progressbars ok during download. Only the 32bit Linux version on my notebook had a hickup - saw the grid partly in black where the chart should be; download was ok, but when I clicked a treenode no chart was created; restarted the app and everything was ok. hard to reproduce. Could be that my notebook has some config issues. Maybe I put in another SSD and try to install Manjaro which is famous in our community for its up-to-date Lazarus, and it would expand my set of tools with a Linux more different from the Ubuntu world.

I ran the 64bit version also in an old Ubuntu 16.04 - it has the drop-down color issue that was discussed in the forum some time ago: black text on back background...

There's one minor issue in all versions: the About box displays a black square where the application icon should be. Probably because I removed the corona.res from the repo. Now i added the corona.res to be on the safe side.

The most important issue, however, is Windows: not the program, but the OS. My antivirus system is the Microsoft Defender, and when I ran your exe it told me that I got infected by the Trojan:Script/Wacatac.B!ml trojan. I uploaded both exes to virustotal.com and only 1 out of 70 scanners reported the files to be unsafe. I never doubted that you'd send me a trojan, but I think this is a serious issue. When Defender, and probably all other scanners which are even more aggressive than Defender, see a program which performs a download from the internet, it "thinks" this program is going to download malware. I am unexperienced here, I never offered binaries in the internet. What we probably need is a certificate - no idea how to get one (I do not intend to pay anything for it) and how to modify the program such that it is respected...

I made another commit which fixes the macOS painting issue with the dropdown. For some reason (left-over from an older version of the program?) the combobox style was selected as csOwnerDrawFixed. After changing it to csDropDownFixed everything is ok.

BTW, I think we need a better communication line. What do you think about these option:

* Telegram

* Signal (Will not do WhatsApp NOR Slack :P )

* **EDIT**: Discord?

* IRC

Hmmm, sorry, I'm not a fan of chatting. Too much distraction.

@gcarreno
Copy link
Collaborator Author

Hey Werner(@wp-xyz),

No issues on progress bar on all

YAY, thanks!!
I still have i386-linux not moving the progress bar and the windows versions under wine, being stupid. But don't fret because it's on my side of running. From what you say my Ubuntu is the culprit! That's why I asked you to confirm that I was seeing the wrong picture of things.
On a side note: I also need to remind myself to bundle the *.dll you provide on the README.md for HTTPS with the Windows *.zip.

Missing about icon

It has absolutely nothing to do with the *.res unfortunately. (We can safely remove the *.res, uff!!)
It's due to the fact that I copied corona.lpi to corona_release.lpi.
Looks like, in this case, if the *,lpi doesn't match either the binary name or the *.res name, some resources are not linked in.
I added my Build Modes to corona.lpi and the image was not a black square.
Something to discuss with the Laz dev people?
Until we decide on the build modes, I'll copy my corona_release.lpi onto corona.lpi when I want to build.

The antivirus thing

Thanks for the leap of faith with the Windows binaries!!

Well, this is unavoidable. There are many forums full of unresolved issues about this.
I'm not even sure that if we signed the binaries it would even make a diff.
What baffles me the most is that you don't get that issue when coding in your windows box, only with linux cross-compiled windows binaries, right?

Ubuntu 16.04

I think that that one is WAY to old. We should test it with 18.04, since it's the before last LTS from 20.04.
We can drop some textual information that it's a known issue that is resolved in newer versions.

macOS painting issue solved

I'm glad that the fix was so easy!!!

New issue

The dreaded DATES and formatting ARGGGGHHHH
Windows, no issues:
corona-dates-windows
Linux, issues:
corona-dates-linux
You'll need to add a FormatDatetime() somewhere...
I have English-UK on Linux but I'm not sure what the defaults are under wine. Could be English-US, or not since the dates have dd/mm/yyyy and not mm/dd/yyyy.

The chat thing

My intention on using a real time chat app is not to discuss the weather or ask what's your favourite colour.
My intention is to discuss matters of the app in a quicker and more interactive way.

I understand your position and will respect it.

Cheers,
Gus

@wp-xyz
Copy link
Owner

wp-xyz commented Feb 20, 2021 via email

@gcarreno
Copy link
Collaborator Author

Hey Werner(@wp-xyz),

Lazarus and all my project folders are on the white list of the scanner.

DUH!!! Imma so dumb!! Completely forgot about white listing...

I could imagine that the "artifical intelligence" of a virus scanner can be fooled this way...

I'm not sure it would. InnoSetup just copies the file you create. I don't see it modifying the *.exe. The heuristic side of the Anti Virus will still go mad...
I really need to do some Googling to have a look if there is a solution that doesn't involve signing the *.exe.
Hummm... Maybe using the windows API for download... Need to have a re look at how I did it to prove the dev of HeidiSQL that it was going boom under wine 5.0. That may solve it!!
This, of course, means a bit fat {$IFDEF} around the windows code...
Will give you a sample app for you to munch away... And I hope I didn't erase that code!!

It has the same issue. I have a VM with 18.04, too. Only v20 is fine

Uuhh crap. Well, we'll put that on the warning, eheheh

Dates should be handled in a locale independent way.

They are! So I decided to go and have a look at how Ubuntu had the locale formatting.
I HATE THE BRITS(not all of them, some are actually quite nice), they have to be diff from everybody in EVERYTHING!!
From all the locales I can choose on my Ubuntu, English-UK is the only one with yy instead of yyyy!!!!! All the other ones have century, but heyyyy, not us, we have to be diff, no century for use, f*ck Y2K !!

So disregard my dates issue. I was just under the impression that the Brits weren't this daft!!

My opinion on this is that I just force yyyy/mm/dd on all the dates cuz it's ISO and it just makes BLOODY SENSE!!

I just noticed that I've caused you to run around like a headless chicken for two issues that are my complete fault.
I'm really sorry for the *.res and the dates snaffu!! I think I need to go to bed and rest my brain!!

Cheers,
Gus

@wp-xyz
Copy link
Owner

wp-xyz commented Feb 20, 2021

Saw your message in my mail client before which did not show the attachments. I see now that you are talking about the dates in the grid.

My "philosophy" behind date formatting is:

  • Use the system settings in the date shown by the GUI and which are visible to the user. The date column in the grid is created by calling DateToStr(), and this uses the DefaultFormatSettings of the sysutils unit. This is correct. The same with the dates displayed in the chart's statusbar when the mouse is over a datapoint. What are the language settings in your Linux system? According to your screenshot above it should be 'd-m-yy'.
  • Use an internal date format when data are used internally. The JHU data files, for example, contain dates in the format 'm/d/yy'. These strings are converted to TDate values, but in some cases re-converted to strings the be stored in the series data item Text fields; this uses the format "mm/dd/yyyy" not visible to the user (see cFormatSettings in unit cGlobal).
  • When the grid data are stored to a csv file I had first used the DefaultFormatSettings, but then noticed issues when reading back by other applications; now I use the SAVE_DATE_FORMAT = 'yyyy-mm-dd' from unit cGlobal.

@wp-xyz
Copy link
Owner

wp-xyz commented Feb 20, 2021

There is another issue with Windows: You plan to provide a setup.exe for Windows which "officially" installs corona into "c:\program files". corona, however, writes its download data as well as its cfg file into the exe directory. The folder "c:\program files", however, is read-only for normal users, and even admins will be interrupted by popping up CUA messages --> we must rewrite these routines to use the offical storage locations.

@gcarreno
Copy link
Collaborator Author

Hey Werner(@wp-xyz),

My "philosophy" behind date formatting is:

Your philosophy is absolutely right. And if I was employed doing professional work, that's how I'd do it.
It's just a pet peeve of mine: Why isn't everybody on yyyy/mm/dd? It just makes so much sense with number going up from right-to-left.
But again, in a professional environment I would always let the system wide defaults take place.
And yes, my Ubuntu default, which is English-UK, is d-m-yy to my utter chagrin!!

There is another issue with Windows

Yeah, I completely forgot about that change. I read about it recently, well ish, and it slipped my mind.

So yeah, we will have to use GetAppConfigDir() and/or GetAppConfigFile(), or you can also use GetUserDir(). Which, you're already using for the Windows/Component state state, right?
And when I'm creating the InnoSetup, I'll have to take that into consideration.

If you'll allow me to suggest:

var
  DataFolder: String;
begin
{$IFDEF WINDOWS}
  DataFolder:= GetUserDir+'CoronaData';
{$ELSE}
  DataFolder:= GetUserDir+'.coronadata';
{$ENDIF}
end;

Unless you're more inclined it being under %APPDATA% / $HOME/.config.
Your call!!

Cheers,
Gus

@wp-xyz
Copy link
Owner

wp-xyz commented Feb 21, 2021

Returning to the "antivirus thing", I downloaded your win 32-bit zip again. However, this time i did not run the exe out of the zip, but extracted the zip into some directory and started corona.exe from there --> no issue!

@gcarreno
Copy link
Collaborator Author

Hey Werner(@wp-xyz),

That's rather odd. So what prompted the antivirus to bark at you in the other test?

Cheers,
Gus

@wp-xyz
Copy link
Owner

wp-xyz commented Feb 21, 2021

Now I repeated exactly what I did the first time. Downloaded your zip again, opened it in PowerArchiver and ran the corona.exe from there - no issue this time.

There were several antivirus updates since that event but in their release notes I cannot find anything indicating that this false alarm could have been fixed in the meantime. So, it remains to be rather mysterious.

@gcarreno
Copy link
Collaborator Author

Hi Werner(@wp-xyz),

Very mysterious indeed!!
I've always seen loads of forum posts of people saying that Delphi and Laz/FPC made apps trigger anti-virus, but I never read of this case: It comes and then goes... LOL!!

Cheers,
Gus

@gcarreno
Copy link
Collaborator Author

Closing.
I think that your tests have proven that my viewing of things is warped by Ubuntu, but all appears fine once ran under other hosts.

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

No branches or pull requests

2 participants