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

allow on combinations of GHC 8.2 & Windows #407

Merged
merged 3 commits into from
Feb 24, 2022

Conversation

kakkun61
Copy link
Contributor

Combinations of GHC 8.2 & Windows were prohibited by #404. But text package can be built on the combinations with some CPP changes.

It seems that __get_cpuid_count was introduced at GCC 6.3.

@Bodigrim
Copy link
Contributor

@kakkun61 sorry for delay. Could you please add Windows + GHC 8.2 job to CI? Edit https://github.com/haskell/text/blob/master/.github/workflows/windows_and_macOS.yml

      matrix:
        os: ['windows-latest', 'macOS-latest']
        ghc: ['latest']
        include:
        - os: windows-latest
          ghc: '8.2'

@kakkun61
Copy link
Contributor Author

I am checking the CI result.

Hmm, the test passed on my machine.

C:\Users\kazuki\Projects\haskell\text [23:21:03] [allow-8.2-win ≡]
> cabal clean
C:\Users\kazuki\Projects\haskell\text [23:21:46] [allow-8.2-win ≡]
> cabal build pkg:text:tests
Resolving dependencies...
Build profile: -w ghc-8.2.2 -O1
In order, the following will be built (use -v for more details):
 - text-2.0 (lib) (first run)
 - text-2.0 (test:tests) (first run)
Configuring library for text-2.0..
Preprocessing library for text-2.0..
Building library for text-2.0..
[ 1 of 44] Compiling Data.Text.Encoding.Error ( src\Data\Text\Encoding\Error.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Encoding\Error.o )
[ 2 of 44] Compiling Data.Text.Internal.Builder.Int.Digits ( src\Data\Text\Internal\Builder\Int\Digits.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Builder\Int\Digits.o )
[ 3 of 44] Compiling Data.Text.Internal.Builder.RealFloat.Functions ( src\Data\Text\Internal\Builder\RealFloat\Functions.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Builder\RealFloat\Functions.o )
[ 4 of 44] Compiling Data.Text.Internal.ByteStringCompat ( src\Data\Text\Internal\ByteStringCompat.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\ByteStringCompat.o )
[ 5 of 44] Compiling Data.Text.Internal.Encoding.Utf32 ( src\Data\Text\Internal\Encoding\Utf32.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Encoding\Utf32.o )
[ 6 of 44] Compiling Data.Text.Internal.Fusion.CaseMapping ( src\Data\Text\Internal\Fusion\CaseMapping.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Fusion\CaseMapping.o )
[ 7 of 44] Compiling Data.Text.Internal.PrimCompat ( src\Data\Text\Internal\PrimCompat.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\PrimCompat.o )
[ 8 of 44] Compiling Data.Text.Internal.Encoding.Utf8 ( src\Data\Text\Internal\Encoding\Utf8.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Encoding\Utf8.o )
[ 9 of 44] Compiling Data.Text.Internal.Encoding.Utf16 ( src\Data\Text\Internal\Encoding\Utf16.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Encoding\Utf16.o )
[10 of 44] Compiling Data.Text.Internal.Read ( src\Data\Text\Internal\Read.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Read.o )
[11 of 44] Compiling Data.Text.Internal.Unsafe ( src\Data\Text\Internal\Unsafe.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Unsafe.o )
[12 of 44] Compiling Data.Text.Array  ( src\Data\Text\Array.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Array.o )
[13 of 44] Compiling Data.Text.Internal.Unsafe.Char ( src\Data\Text\Internal\Unsafe\Char.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Unsafe\Char.o )
[14 of 44] Compiling Data.Text.Internal ( src\Data\Text\Internal.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal.o )
[15 of 44] Compiling Data.Text.Internal.Fusion.Size ( src\Data\Text\Internal\Fusion\Size.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Fusion\Size.o )
[16 of 44] Compiling Data.Text.Internal.Fusion.Types ( src\Data\Text\Internal\Fusion\Types.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Fusion\Types.o )
[17 of 44] Compiling Data.Text.Internal.Fusion.Common ( src\Data\Text\Internal\Fusion\Common.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Fusion\Common.o )
[18 of 44] Compiling Data.Text.Unsafe ( src\Data\Text\Unsafe.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Unsafe.o )
[19 of 44] Compiling Data.Text.Internal.Search ( src\Data\Text\Internal\Search.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Search.o )
[20 of 44] Compiling Data.Text.Internal.Private ( src\Data\Text\Internal\Private.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Private.o )
[21 of 44] Compiling Data.Text.Internal.Fusion ( src\Data\Text\Internal\Fusion.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Fusion.o )
[22 of 44] Compiling Data.Text.Show   ( src\Data\Text\Show.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Show.o )
[23 of 44] Compiling Data.Text.Internal.Encoding.Fusion.Common ( src\Data\Text\Internal\Encoding\Fusion\Common.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Encoding\Fusion\Common.o )
[24 of 44] Compiling Data.Text.Internal.Lazy.Encoding.Fusion ( src\Data\Text\Internal\Lazy\Encoding\Fusion.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Lazy\Encoding\Fusion.o )
[25 of 44] Compiling Data.Text.Internal.Encoding.Fusion ( src\Data\Text\Internal\Encoding\Fusion.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Encoding\Fusion.o )
[26 of 44] Compiling Data.Text.Encoding ( src\Data\Text\Encoding.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Encoding.o )
[27 of 44] Compiling Data.Text.Foreign ( src\Data\Text\Foreign.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Foreign.o )
[28 of 44] Compiling Data.Text        ( src\Data\Text.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text.o )
[29 of 44] Compiling Data.Text.Read   ( src\Data\Text\Read.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Read.o )
[30 of 44] Compiling Data.Text.Internal.Lazy ( src\Data\Text\Internal\Lazy.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Lazy.o )
[31 of 44] Compiling Data.Text.Lazy.Internal ( src\Data\Text\Lazy\Internal.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Lazy\Internal.o )
[32 of 44] Compiling Data.Text.Internal.Lazy.Search ( src\Data\Text\Internal\Lazy\Search.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Lazy\Search.o )
[33 of 44] Compiling Data.Text.Internal.Lazy.Fusion ( src\Data\Text\Internal\Lazy\Fusion.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Lazy\Fusion.o )
[34 of 44] Compiling Data.Text.Lazy.Encoding ( src\Data\Text\Lazy\Encoding.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Lazy\Encoding.o )
[35 of 44] Compiling Data.Text.Lazy   ( src\Data\Text\Lazy.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Lazy.o )
[36 of 44] Compiling Data.Text.Lazy.Read ( src\Data\Text\Lazy\Read.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Lazy\Read.o )
[37 of 44] Compiling Data.Text.Internal.IO ( src\Data\Text\Internal\IO.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\IO.o )
[38 of 44] Compiling Data.Text.Internal.Builder ( src\Data\Text\Internal\Builder.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Builder.o )
[39 of 44] Compiling Data.Text.Lazy.Builder ( src\Data\Text\Lazy\Builder.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Lazy\Builder.o )
[40 of 44] Compiling Data.Text.Internal.Builder.Functions ( src\Data\Text\Internal\Builder\Functions.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Internal\Builder\Functions.o )
[41 of 44] Compiling Data.Text.Lazy.Builder.Int ( src\Data\Text\Lazy\Builder\Int.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Lazy\Builder\Int.o )
[42 of 44] Compiling Data.Text.Lazy.Builder.RealFloat ( src\Data\Text\Lazy\Builder\RealFloat.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Lazy\Builder\RealFloat.o )
[43 of 44] Compiling Data.Text.IO     ( src\Data\Text\IO.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\IO.o )
[44 of 44] Compiling Data.Text.Lazy.IO ( src\Data\Text\Lazy\IO.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\build\Data\Text\Lazy\IO.o )
Configuring test suite 'tests' for text-2.0..
Warning: The package has an extraneous version range for a dependency on an
internal library: text >=0 && ==2.0, text >=0 && ==2.0. This version range
includes the current package but isn't needed as the current package's library
will always be used.
Preprocessing test suite 'tests' for text-2.0..
Building test suite 'tests' for text-2.0..
[ 1 of 16] Compiling Tests.Lift       ( tests\Tests\Lift.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Tests\Lift.o )
[ 2 of 16] Compiling Tests.SlowFunctions ( tests\Tests\SlowFunctions.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Tests\SlowFunctions.o )
[ 3 of 16] Compiling Tests.Utils      ( tests\Tests\Utils.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Tests\Utils.o )
[ 4 of 16] Compiling Tests.Regressions ( tests\Tests\Regressions.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Tests\Regressions.o )
[ 5 of 16] Compiling Tests.QuickCheckUtils ( tests\Tests\QuickCheckUtils.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Tests\QuickCheckUtils.o )
[ 6 of 16] Compiling Tests.Properties.Transcoding ( tests\Tests\Properties\Transcoding.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Tests\Properties\Transcoding.o )
[ 7 of 16] Compiling Tests.Properties.Text ( tests\Tests\Properties\Text.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Tests\Properties\Text.o )
[ 8 of 16] Compiling Tests.Properties.Substrings ( tests\Tests\Properties\Substrings.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Tests\Properties\Substrings.o )
[ 9 of 16] Compiling Tests.Properties.Read ( tests\Tests\Properties\Read.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Tests\Properties\Read.o )
[10 of 16] Compiling Tests.Properties.Instances ( tests\Tests\Properties\Instances.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Tests\Properties\Instances.o )
[11 of 16] Compiling Tests.Properties.Folds ( tests\Tests\Properties\Folds.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Tests\Properties\Folds.o )
[12 of 16] Compiling Tests.Properties.Builder ( tests\Tests\Properties\Builder.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Tests\Properties\Builder.o )
[13 of 16] Compiling Tests.Properties.Basics ( tests\Tests\Properties\Basics.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Tests\Properties\Basics.o )
[14 of 16] Compiling Tests.Properties.LowLevel ( tests\Tests\Properties\LowLevel.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Tests\Properties\LowLevel.o )
[15 of 16] Compiling Tests.Properties ( tests\Tests\Properties.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Tests\Properties.o )
[16 of 16] Compiling Main             ( tests\Tests.hs, C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests-tmp\Main.o )
Linking C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\build\tests\tests.exe ...
C:\Users\kazuki\Projects\haskell\text [23:23:32] [allow-8.2-win ≡]
> cabal test
Build profile: -w ghc-8.2.2 -O1
In order, the following will be built (use -v for more details):
 - text-2.0 (test:tests) (ephemeral targets)
Preprocessing test suite 'tests' for text-2.0..
Building test suite 'tests' for text-2.0..
Running 1 test suites...
Test suite tests: RUNNING...
Test suite tests: PASS
Test suite logged to:
C:\Users\kazuki\Projects\haskell\text\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\test\text-2.0-tests.log
1 of 1 test suites (1 of 1 test cases) passed.

@Bodigrim
Copy link
Contributor

I don't have a local Windows machine, unfortunately, to investigate further.

However, I can take (__GNUC__ >= 7 || __GNUC__ == 6 && __GNUC_MINOR__ >= 3) patch on its own, this should be a right thing to fix anyway.

@Lysxia
Copy link
Contributor

Lysxia commented Jan 23, 2022

I got a windows machine and I can reproduce the failure with GHC 8.2.2. The log file is below. I'm not sure what to make of it.

> cat .\dist-newstyle\build\x86_64-windows\ghc-8.2.2\text-2.0\t\tests\test\text-2.0.log
PackageLog {package = PackageIdentifier {pkgName = PackageName "text", pkgVersion = mkVersion [2,0]}, compiler = CompilerId GHC (mkVersion [8,2,2]), platform = Platform X86_64 Windows, testSuites = [TestSuiteLog {testSuiteName = UnqualComponentName "tests", testLogs = TestLog {testName = "tests", testOptionsReturned = [], testResult = Fail "exit code: -1073741511"}, logFile = "C:\\Users\\sam\\Documents\\Projects\\text\\dist-newstyle\\build\\x86_64-windows\\ghc-8.2.2\\text-2.0\\t\\tests\\test\\text-2.0-tests.log"}]}
> gcc --version
gcc.exe (MinGW-W64 x86_64-posix-seh, built by Brecht Sanders) 11.2.0

The test is actually not running at all. main = return () in Test.hs yields the same failure. It happens only with 8.2 (for example 8.4 works).


Something is causing tests to be dynamically linked in GHC 8.2:

$ ldd ./dist-newstyle/build/x86_64-windows/ghc-8.2.2/text-2.0/t/tests/build/tests/tests.exe |grep ming
        libgcc_s_seh-1.dll => /mingw64/bin/libgcc_s_seh-1.dll (0x7fff701a0000)
        libstdc++-6.dll => /mingw64/bin/libstdc++-6.dll (0x7fff34bb0000)

@Bodigrim
Copy link
Contributor

Bodigrim commented Feb 1, 2022

@kakkun61 I suspect that your Windows environment might be different from one provided by CI, e. g., different MinGW or something. Could you possibly submit (__GNUC__ >= 7 || __GNUC__ == 6 && __GNUC_MINOR__ >= 3) patch on its own, so that we can merge 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