Skip to content

Commit

Permalink
DEBUG printenv
Browse files Browse the repository at this point in the history
  • Loading branch information
Rufflewind committed Jan 6, 2025
1 parent 6780dc1 commit e9280e9
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ jobs:
fail-fast: false
matrix:
include:
- { os: macOS-13, stack: lts-15.3, stack-extra-deps: "bytestring-0.11.3.0, file-io-0.1.4, filepath-1.4.100.0, unix-2.8.0.0" }
- { os: macos-latest, stack: lts-22.7, stack-extra-deps: "bytestring-0.11.5.3, file-io-0.1.4, filepath-1.5.2.0, os-string-2.0.2, unix-2.8.5.1", stack-package-flags: "{directory: {os-string: true}, file-io: {os-string: true}, unix: {os-string: true}}", ghc-flags: -Werror=deprecations }
- { os: ubuntu-latest, ghc: 8.10.7, cabal: 3.8.1.0 }
- { os: ubuntu-latest, ghc: 9.0.2, cabal: 3.8.1.0 }
- { os: ubuntu-latest, ghc: 9.2.4, cabal: 3.8.1.0 }
# - { os: macOS-13, stack: lts-15.3, stack-extra-deps: "bytestring-0.11.3.0, file-io-0.1.4, filepath-1.4.100.0, unix-2.8.0.0" }
# - { os: macos-latest, stack: lts-22.7, stack-extra-deps: "bytestring-0.11.5.3, file-io-0.1.4, filepath-1.5.2.0, os-string-2.0.2, unix-2.8.5.1", stack-package-flags: "{directory: {os-string: true}, file-io: {os-string: true}, unix: {os-string: true}}", ghc-flags: -Werror=deprecations }
# - { os: ubuntu-latest, ghc: 8.10.7, cabal: 3.8.1.0 }
# - { os: ubuntu-latest, ghc: 9.0.2, cabal: 3.8.1.0 }
# - { os: ubuntu-latest, ghc: 9.2.4, cabal: 3.8.1.0 }
- { os: ubuntu-latest, ghc: 9.4.3, cabal: 3.8.1.0 }
- { os: ubuntu-latest, ghc: latest, cabal: latest, cabal-package-flags: +os-string, ghc-flags: -Werror=deprecations }
- { os: windows-latest, stack: lts-15.3, stack-extra-deps: "bytestring-0.11.3.0, file-io-0.1.4, filepath-1.4.100.0, time-1.9.3, Win32-2.13.3.0", overrides: "before_prepare() { sed -i.bak -e /CreateSymbolicLinkW/d -e /GetFinalPathNameByHandleW/d configure.ac; }" }
- { os: windows-latest, stack: lts-17.5, stack-extra-deps: "bytestring-0.11.3.0, file-io-0.1.4, filepath-1.4.100.0, time-1.9.3, Win32-2.13.3.0" }
- { os: windows-latest, stack: lts-22.7, stack-extra-deps: "bytestring-0.11.5.3, file-io-0.1.4, filepath-1.5.2.0, os-string-2.0.2, time-1.14, Win32-2.14.0.0", stack-package-flags: "{directory: {os-string: true}, file-io: {os-string: true}, Win32: {os-string: true}}", ghc-flags: -Werror=deprecations }
# - { os: windows-latest, stack: lts-15.3, stack-extra-deps: "bytestring-0.11.3.0, file-io-0.1.4, filepath-1.4.100.0, time-1.9.3, Win32-2.13.3.0", overrides: "before_prepare() { sed -i.bak -e /CreateSymbolicLinkW/d -e /GetFinalPathNameByHandleW/d configure.ac; }" }
# - { os: windows-latest, stack: lts-17.5, stack-extra-deps: "bytestring-0.11.3.0, file-io-0.1.4, filepath-1.4.100.0, time-1.9.3, Win32-2.13.3.0" }
# - { os: windows-latest, stack: lts-22.7, stack-extra-deps: "bytestring-0.11.5.3, file-io-0.1.4, filepath-1.5.2.0, os-string-2.0.2, time-1.14, Win32-2.14.0.0", stack-package-flags: "{directory: {os-string: true}, file-io: {os-string: true}, Win32: {os-string: true}}", ghc-flags: -Werror=deprecations }
runs-on: ${{ matrix.os }}
env:
CABAL_PACKAGE_FLAGS: ${{ matrix.cabal-package-flags }}
Expand Down
4 changes: 4 additions & 0 deletions print_envs.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Main where
import System.Environment

main = print =<< fmap (fmap fst) getEnvironment
11 changes: 11 additions & 0 deletions printenvs.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <stdio.h>
#include <string.h>

extern char **environ;

int main(void) {
int i;
for (i = 0; environ[i]; ++i) {
printf("printenvs: %s\n", strtok(environ[i], "="));
}
}
8 changes: 8 additions & 0 deletions tests/Main.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module Main (main) where
import System.Environment
import Data.List
import qualified Util as T
import qualified CanonicalizePath
import qualified CopyFile001
Expand Down Expand Up @@ -34,6 +36,8 @@ import qualified Xdg

main :: IO ()
main = T.testMain $ \ _t -> do
print "!!!!!!!!!!!! 1"

Check failure on line 39 in tests/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.4.3, 3.8.1.0)

• Defaulting the type variable ‘a0’ to type ‘String’ in the following constraints

Check failure on line 39 in tests/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, latest, latest, +os-string, -Werror=deprecations)

• Defaulting the type variable ‘a0’ to type ‘[Char]’ in the following constraints
print =<< fmap (sort . fmap fst) getEnvironment
T.isolatedRun _t "CanonicalizePath" CanonicalizePath.main
T.isolatedRun _t "CopyFile001" CopyFile001.main
T.isolatedRun _t "CopyFile002" CopyFile002.main
Expand All @@ -46,6 +50,8 @@ main = T.testMain $ \ _t -> do
T.isolatedRun _t "DoesPathExist" DoesPathExist.main
T.isolatedRun _t "FileTime" FileTime.main
T.isolatedRun _t "FindFile001" FindFile001.main
print "!!!!!!!!!!!! 2"

Check failure on line 53 in tests/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.4.3, 3.8.1.0)

• Defaulting the type variable ‘a0’ to type ‘String’ in the following constraints

Check failure on line 53 in tests/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, latest, latest, +os-string, -Werror=deprecations)

• Defaulting the type variable ‘a0’ to type ‘[Char]’ in the following constraints
print =<< fmap (sort . fmap fst) getEnvironment
T.isolatedRun _t "GetDirContents001" GetDirContents001.main
T.isolatedRun _t "GetDirContents002" GetDirContents002.main
T.isolatedRun _t "GetFileSize" GetFileSize.main
Expand All @@ -64,4 +70,6 @@ main = T.testMain $ \ _t -> do
T.isolatedRun _t "Simplify" Simplify.main
T.isolatedRun _t "T8482" T8482.main
T.isolatedRun _t "WithCurrentDirectory" WithCurrentDirectory.main
print "!!!!!!!!!!!! 3"

Check failure on line 73 in tests/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 9.4.3, 3.8.1.0)

• Defaulting the type variable ‘a0’ to type ‘String’ in the following constraints

Check failure on line 73 in tests/Main.hs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, latest, latest, +os-string, -Werror=deprecations)

• Defaulting the type variable ‘a0’ to type ‘[Char]’ in the following constraints
print =<< fmap (sort . fmap fst) getEnvironment
T.isolatedRun _t "Xdg" Xdg.main

0 comments on commit e9280e9

Please sign in to comment.