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

BagLinterTest fails under MacOs #102

Open
ThomasJejkal opened this issue Jan 15, 2018 · 8 comments
Open

BagLinterTest fails under MacOs #102

ThomasJejkal opened this issue Jan 15, 2018 · 8 comments

Comments

@ThomasJejkal
Copy link
Contributor

Given

  • bagit-java 5.0.4
  • MacOs High Sierra 10.13.2

When

  • I build with tests under MacOs

Then

  • BagLinterTest fails in line 43: assertEquals("Warnings missing: " + diff.toString() + "\n", expectedWarnings, warnings);

Obviously, removing BagitWarning.DIFFERENT_NORMALIZATION from the list of expected warnings is not longer necessary.

@johnscancella
Copy link
Contributor

I also run MacOs High Sierra 10.13.2 and it does not fail for me. How is your hard drive formatted? Mine is APFS (Encrypted)

@ThomasJejkal
Copy link
Contributor Author

ThomasJejkal commented Jan 17, 2018

Indeed, this is strange. I'm using APFS (Unencrypted), too. Currently, I'm encrypting my filesystem to see if this has any influence, but I don't think so. Maybe the German system language causes this issue?

I've played around a bit with ManifestChecker#checkNormalization and I found out, that during BagLintTest#testLintBag 'src/test/resources/linterTestBag/data/Núñez' is normalized to 'src/test/resources/linterTestBag/data/Nu´n~ez' unless I'm using Normalizer.Form.NFC

Edit:
Are you sure that your hard drive is APFS formatted and not HFS+, maybe your source code directory is on a separate disk? In this issue vgough/encfs#316 there is a comment on how to check for NFD or NFC from 5 May 2017 and in my case, the NFD normalized form applies.

Edit2:

Ok, it seems that the different behaviour is indeed caused by the German locale settings. Obviously, NFD as well as NFC normalization have to be supported somehow.

@johnscancella
Copy link
Contributor

Do you still get this error if you change the Locale to english in the test?

@ThomasJejkal
Copy link
Contributor Author

Changing the locale in the code doesn't change anything. Also changing the system language to English has no influence. According to this article it seems that this issue is related to APFS and indeed, the colleague running her iMac with an English Locale is still not using High Sierra and therefore also no APFS but HFS+. However, the fact that the tests are succeeding on your machine running APFS is now even more confusing.

@johnscancella
Copy link
Contributor

What is the output from the diskutil? Mine is

diskutil info /
   Device Identifier:        disk1s1
   Device Node:              /dev/disk1s1
   Whole:                    No
   Part of Whole:            disk1

   Volume Name:              Macintosh HD
   Mounted:                  Yes
   Mount Point:              /

   Partition Type:           41504653-0000-11AA-AA11-00306543ECAC
   File System Personality:  APFS
   Type (Bundle):            apfs
   Name (User Visible):      APFS
   Owners:                   Enabled

   OS Can Be Installed:      Yes
   Booter Disk:              disk1s2
   Recovery Disk:            disk1s3
   Media Type:               Generic
   Protocol:                 PCI
   SMART Status:             Not Supported
   Volume UUID:              D3DE8A4A-DD48-3064-84F8-01019B0A7E68
   Disk / Partition UUID:    D3DE8A4A-DD48-3064-84F8-01019B0A7E68

   Disk Size:                500.1 GB (500068036608 Bytes) (exactly 976695384 512-Byte-Units)
   Device Block Size:        4096 Bytes

   Volume Total Space:       500.1 GB (500068036608 Bytes) (exactly 976695384 512-Byte-Units)
   Volume Used Space:        307.0 GB (307038670848 Bytes) (exactly 599684904 512-Byte-Units) (61.4%)
   Volume Available Space:   193.0 GB (193029365760 Bytes) (exactly 377010480 512-Byte-Units) (38.6%)
   Allocation Block Size:    4096 Bytes

   Read-Only Media:          No
   Read-Only Volume:         No

   Device Location:          Internal
   Removable Media:          Fixed

   Solid State:              Yes

@ThomasJejkal
Copy link
Contributor Author

For me this looks quite similar:

   Device Identifier:        disk1s1
   Device Node:              /dev/disk1s1
   Whole:                    No
   Part of Whole:            disk1

   Volume Name:              Macintosh HD
   Mounted:                  Yes
   Mount Point:              /

   Partition Type:           41504653-0000-11AA-AA11-00306543ECAC
   File System Personality:  APFS
   Type (Bundle):            apfs
   Name (User Visible):      APFS
   Owners:                   Enabled

   OS Can Be Installed:      Yes
   Booter Disk:              disk1s2
   Recovery Disk:            disk1s3
   Media Type:               Generic
   Protocol:                 PCI
   SMART Status:             Not Supported
   Volume UUID:              8A462F06-62F8-3520-BCAE-0F7146B1DCB9
   Disk / Partition UUID:    8A462F06-62F8-3520-BCAE-0F7146B1DCB9

   Disk Size:                436.0 GB (435969568768 Bytes) (exactly 851503064 512-Byte-Units)
   Device Block Size:        4096 Bytes

   Volume Total Space:       436.0 GB (435969568768 Bytes) (exactly 851503064 512-Byte-Units)
   Volume Used Space:        311.1 GB (311056560128 Bytes) (exactly 607532344 512-Byte-Units) (71.3%)
   Volume Available Space:   124.9 GB (124913008640 Bytes) (exactly 243970720 512-Byte-Units) (28.7%)
   Allocation Block Size:    4096 Bytes

   Read-Only Media:          No
   Read-Only Volume:         No

   Device Location:          Internal
   Removable Media:          Fixed

   Solid State:              Yes
   Device Location:          "SSD"

@johnscancella
Copy link
Contributor

Yeah doing a diff, the only difference is the size and UUIDs. I am running on a old macbook air, so I have upgraded several times. Did you always have APFS, or like me did you upgrade?

@ThomasJejkal
Copy link
Contributor Author

I'm not totally sure, but I think that I've upgraded it with macOS High Sierra.

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

Successfully merging a pull request may close this issue.

2 participants