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

78 menyxml should be the same when generated on linux and on windows #79

Conversation

JohannesFinsveen
Copy link
Contributor

Slashes and datetime-format should be ok now

What to do with ordering ... see issue ...

@JohannesFinsveen
Copy link
Contributor Author

JohannesFinsveen commented Mar 7, 2024

The mac trailing space:
The trailing space is in the languageless alias file.
The reason it pops up for macos is that that file is applied last on mac, but first on windows

foreach (var item in System.IO.Directory.GetFiles(path)) yields:

windows:
Logged: Readind alias from :Alias
Logged: Readind alias from :Alias_en
Logged: Readind alias from :Alias_sv

macos:
Logged: Readind alias from :Alias_en
Logged: Readind alias from :Alias_sv
Logged: Readind alias from :Alias

Since just alias means alias_defaultLanguage, there are 2 english alias files, and they are applied in different order on windows and macos.

Alternatives:

  1. Declare macos Os non grata :-)
  2. Prune the file list , and log error when there are 2 files for one language
  3. Remove the extra alias file and ignore the issue

One of the two alias files should perhaps be removed or commented that this is not best practice.

@likp @runejo Any opinions?

@runejo
Copy link
Contributor

runejo commented Mar 7, 2024

  1. Declare macos Os non grata :-)
  2. Prune the file list , and log error when there are 2 files for one language
  3. Remove the extra alias file and ignore the issue

One of the two alias files should perhaps be removed or commented that this is not best practice.

@likp @runejo Any opinions?

I lack experience but it may look like it's a common practice to have duplicate files https://github.com/statisticssweden/PxWeb/tree/master/PXWeb/Resources/PX/Databases/Example/alias

Anyway, can't we just sort the files ref https://learn.microsoft.com/en-us/dotnet/api/system.io.directory.getfiles?view=net-6.0

@JohannesFinsveen
Copy link
Contributor Author

I think this is done now. @likp @runejo
The spider sorts alias.txt first so that the default is applied before the language specific.
File-size is ignored in the test. They have small variations between the OSes, but that is ok I think.

Copy link
Contributor

@likp likp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment

@likp likp self-requested a review March 14, 2024 13:42
@JohannesFinsveen JohannesFinsveen merged commit 75aec27 into main Mar 14, 2024
5 checks passed
@JohannesFinsveen JohannesFinsveen deleted the 78-menyxml-should-be-the-same-when-generated-on-linux-and-on-windows branch April 2, 2024 11:49
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.

meny.xml should be the same when generated on linux and on windows , and macos
3 participants