-
Notifications
You must be signed in to change notification settings - Fork 697
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
Filter out files that are not ending in .c from c-sources #9200
Merged
Kleidukos
merged 9 commits into
haskell:3.10
from
Kleidukos:hecate-9190-ignored-files-in-c-sources
Aug 24, 2023
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a275708
Filter out files that are not ending in .c from c-sources
Kleidukos b212885
Add names for libraries
Kleidukos ca584d3
Add name of current component for generic build
Kleidukos d2831d8
Don't build C sources if there are no valid ".c" files
Kleidukos eee9fc9
Rework the warnings strings
Kleidukos af40adb
Add a test
Kleidukos a73d8c3
bleh
Kleidukos 128e56d
Remove extra whitespace
andreabedini 9e79a1f
Finish off CSourcesSanitisation test
andreabedini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule CSourcesSanitisation
deleted from
8980f3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module Main where | ||
|
||
main :: IO () | ||
main = putStrLn "main" |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/CSourcesSanitisation/build.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Test.Cabal.Prelude | ||
|
||
main = cabalTest $ do | ||
cabal "build" |
18 changes: 18 additions & 0 deletions
18
cabal-testsuite/PackageTests/CSourcesSanitisation/cbits/gwinsz.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <sys/ioctl.h> | ||
|
||
unsigned long vty_c_get_window_size(int fd) { | ||
struct winsize w; | ||
if (ioctl (fd, TIOCGWINSZ, &w) >= 0) | ||
return (w.ws_row << 16) + w.ws_col; | ||
else | ||
return 0x190050; | ||
} | ||
|
||
void vty_c_set_window_size(int fd, unsigned long val) { | ||
struct winsize w; | ||
if (ioctl(fd, TIOCGWINSZ, &w) >= 0) { | ||
w.ws_row = val >> 16; | ||
w.ws_col = val & 0xFFFF; | ||
ioctl(fd, TIOCSWINSZ, &w); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
cabal-testsuite/PackageTests/CSourcesSanitisation/cbits/gwinsz.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
unsigned long vty_c_get_window_size(int fd); | ||
unsigned long vty_c_set_window_size(int fd, unsigned long val); |
13 changes: 13 additions & 0 deletions
13
cabal-testsuite/PackageTests/CSourcesSanitisation/cbits/set_term_timing.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <termios.h> | ||
#include <stdio.h> | ||
#include <unistd.h> | ||
#include <stdlib.h> | ||
|
||
void vty_set_term_timing(int fd, int vmin, int vtime) | ||
{ | ||
struct termios trm; | ||
tcgetattr(fd, &trm); | ||
trm.c_cc[VMIN] = vmin; | ||
trm.c_cc[VTIME] = vtime; | ||
tcsetattr(fd, TCSANOW, &trm); | ||
} |
26 changes: 26 additions & 0 deletions
26
cabal-testsuite/PackageTests/CSourcesSanitisation/repro.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
cabal-version: 3.0 | ||
name: repro | ||
version: 0.1.0.0 | ||
build-type: Simple | ||
|
||
library | ||
default-language: Haskell2010 | ||
c-sources: cbits/set_term_timing.c | ||
cbits/gwinsz.h | ||
cbits/gwinsz.c | ||
build-depends: base | ||
|
||
library lib2 | ||
default-language: Haskell2010 | ||
c-sources: cbits/set_term_timing.c | ||
cbits/gwinsz.h | ||
cbits/gwinsz.c | ||
build-depends: base | ||
|
||
executable exec1 | ||
main-is: Main.hs | ||
default-language: Haskell2010 | ||
c-sources: cbits/set_term_timing.c | ||
cbits/gwinsz.h | ||
cbits/gwinsz.c | ||
build-depends: base |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could reproduce with empty files too, if that makes it any easier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sure let's go with it 👍