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

Lots of updates, mostly focusing on the CI & build system, take 2 #15

Open
wants to merge 91 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
2e213b5
update gitignores
cooljeanius Aug 11, 2022
1c00295
Update .gitignore
cooljeanius Aug 21, 2023
9397bf4
Add workflow cooljeanius/scotty
cooljeanius Aug 21, 2023
779dcd9
Update scotty.yml
cooljeanius Aug 21, 2023
5c1d0b7
Update scotty.yml
cooljeanius Aug 21, 2023
2d1df08
Merge pull request #1 from cooljeanius/convert-cooljeanius-scotty-to-…
cooljeanius Aug 21, 2023
577ce3f
Update scotty.yml
cooljeanius Sep 21, 2023
9f97020
Update scotty.yml
cooljeanius Sep 21, 2023
27a9c87
Update scotty.yml
cooljeanius Sep 21, 2023
ec8df63
Update scotty.yml
cooljeanius Sep 21, 2023
19179a9
Update scotty.yml
cooljeanius Sep 21, 2023
fa9cc6e
Update scotty.yml
cooljeanius Sep 21, 2023
f1129d8
update some autotools stuff
cooljeanius Sep 21, 2023
8159fe5
Update scotty.yml
cooljeanius Sep 21, 2023
2eb2edb
try making sure install-sh gets found
cooljeanius Sep 21, 2023
d8cc357
Update .travis.yml
cooljeanius Sep 21, 2023
06b8b8d
Update .travis.yml
cooljeanius Sep 21, 2023
33afab9
Update .gitignore
cooljeanius Sep 22, 2023
bfb25be
Update .travis.yml
cooljeanius Sep 22, 2023
0383539
Update .travis.yml
cooljeanius Sep 29, 2023
356ee4e
Update .travis.yml
cooljeanius Sep 29, 2023
e035bc0
Update .travis.yml
cooljeanius Sep 30, 2023
2589fb8
Update .travis.yml
cooljeanius Sep 30, 2023
7716b2d
update tnm configury
cooljeanius Sep 30, 2023
281f90b
Update configure.ac
cooljeanius Sep 30, 2023
955e589
config.h: can't do with it, can't do without it
cooljeanius Sep 30, 2023
f4142eb
Update configure.ac
cooljeanius Sep 30, 2023
37b5577
tinker tinker tinker
cooljeanius Sep 30, 2023
0989f7d
Update scotty.yml
cooljeanius Sep 30, 2023
d4b378a
Update scotty.yml
cooljeanius Sep 30, 2023
ba4b181
Update scotty.yml
cooljeanius Oct 1, 2023
935585d
Update scotty.yml
cooljeanius Oct 2, 2023
e1f0b90
Update scotty.yml
cooljeanius Oct 9, 2023
cbbe97a
Update scotty.yml
cooljeanius Oct 9, 2023
23e0051
Update scotty.yml
cooljeanius Oct 9, 2023
bd50a70
Create dependabot.yml
cooljeanius Oct 10, 2023
fdf5408
Bump actions/checkout from 3.5.0 to 4.1.0
dependabot[bot] Oct 10, 2023
095df55
Merge pull request #5 from cooljeanius/dependabot/github_actions/acti…
cooljeanius Oct 10, 2023
7bcc782
Update scotty.yml
cooljeanius Oct 10, 2023
bca284c
Update scotty.yml
cooljeanius Oct 10, 2023
5418c2b
Makefile updates
cooljeanius Oct 10, 2023
d71f8c9
Update scotty.yml
cooljeanius Oct 10, 2023
42fd558
Update scotty.yml
cooljeanius Oct 10, 2023
9891eea
Update scotty.yml
cooljeanius Oct 10, 2023
f5feb8f
Update scotty.yml
cooljeanius Oct 10, 2023
4dce0ee
Bump actions/checkout from 4.1.0 to 4.1.1
dependabot[bot] Oct 23, 2023
8664bf4
Merge pull request #6 from cooljeanius/dependabot/github_actions/acti…
cooljeanius Oct 23, 2023
58ac50f
Update scotty.yml
cooljeanius Oct 31, 2023
478ed77
Update scotty.yml
cooljeanius Oct 31, 2023
0f6235a
Update scotty.yml
cooljeanius Oct 31, 2023
1fe7f0f
Update scotty.yml
cooljeanius Oct 31, 2023
58e83a8
Update scotty.yml
cooljeanius Oct 31, 2023
e5e5ed5
Update scotty.yml
cooljeanius Oct 31, 2023
daec367
Update scotty.yml
cooljeanius Oct 31, 2023
8c1a913
Update scotty.yml
cooljeanius Oct 31, 2023
e35d19e
Update scotty.yml
cooljeanius Oct 31, 2023
a607649
Create codeql.yml
cooljeanius Nov 1, 2023
c6d7fbe
try actually building
cooljeanius Nov 1, 2023
e2d6769
Update codeql.yml
cooljeanius Nov 1, 2023
719f10c
Update codeql.yml
cooljeanius Nov 1, 2023
12147a1
Update codeql.yml
cooljeanius Nov 1, 2023
b59c08f
Update codeql.yml
cooljeanius Nov 1, 2023
7883352
Update codeql.yml
cooljeanius Nov 1, 2023
a9ef581
Update codeql.yml
cooljeanius Nov 1, 2023
e59bb33
Update codeql.yml
cooljeanius Nov 1, 2023
8114022
Update codeql.yml
cooljeanius Nov 1, 2023
3a2b600
Update codeql.yml
cooljeanius Nov 1, 2023
6c1515f
Update codeql.yml
cooljeanius Nov 1, 2023
6827f65
Update codeql.yml
cooljeanius Nov 1, 2023
793b2ee
Update codeql.yml
cooljeanius Nov 1, 2023
3a3a7e5
Update codeql.yml
cooljeanius Nov 1, 2023
a2b69ff
Update codeql.yml
cooljeanius Nov 1, 2023
d29b1ef
Update codeql.yml
cooljeanius Nov 1, 2023
ce3c227
Update codeql.yml
cooljeanius Nov 1, 2023
fbb404a
Update codeql.yml
cooljeanius Nov 1, 2023
c190707
Update codeql.yml
cooljeanius Nov 1, 2023
d70be6c
Update codeql.yml
cooljeanius Nov 1, 2023
71c3ecf
Update codeql.yml
cooljeanius Nov 1, 2023
b6b7b62
Update codeql.yml
cooljeanius Nov 1, 2023
886dbb9
Update codeql.yml
cooljeanius Nov 1, 2023
8870671
Update codeql.yml
cooljeanius Nov 1, 2023
c52178f
Update codeql.yml
cooljeanius Nov 1, 2023
6d721fd
Update codeql.yml
cooljeanius Nov 1, 2023
c65a969
Update codeql.yml
cooljeanius Nov 1, 2023
ac28e33
try adding a few additional include directories
cooljeanius Nov 1, 2023
59c45cb
try getting some extra warnings
cooljeanius Nov 1, 2023
c896964
Bump actions/checkout from 3 to 4
dependabot[bot] Nov 6, 2023
0603509
Merge pull request #7 from cooljeanius/dependabot/github_actions/acti…
cooljeanius Nov 6, 2023
613099e
Bump github/codeql-action from 2 to 3
dependabot[bot] Dec 18, 2023
75472bf
Merge pull request #8 from cooljeanius/dependabot/github_actions/gith…
cooljeanius Dec 18, 2023
d34d67a
squash 10 commits
cooljeanius Aug 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
t*/config.h.in linguist-generated
t*/configure.scan linguist-generated
t*/tclconfig/config.guess linguist-vendored
t*/tclconfig/config.sub linguist-vendored
t*/tclconfig/install-sh linguist-vendored
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions" # See docs for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
172 changes: 172 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
---
# scotty/.github/workflows/codeql.yml: GitHub Actions codeql workflow for scotty
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches:
- master
- multicast
- base
- dependabot/*
pull_request:
# The branches below must be a subset of the branches above:
branches:
- master
- multicast
- base
- dependabot/*
schedule:
- cron: '42 11 * * 5'

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: 'ubuntu-latest'
timeout-minutes: 360
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ['c-cpp']
# CodeQL supports:
# 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript',
# 'python', 'ruby', 'swift'
# Use 'java-kotlin' to analyze code written in Java, Kotlin, or both
# Use 'javascript-typescript' to analyze code written in JavaScript,
# TypeScript, or both
# Learn more about CodeQL language support at:
# https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a
# config file.
# By default, queries listed here will override any specified in a
# config file.
# Prefix the list here with "+" to use these queries and those in the
# config file.

# For more details on CodeQL's query packs, refer to:
# https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

- name: Dependencies
run: |
sudo apt-get -qq update
sudo apt-get -q install tcl-dev tcl8.6-dev libtcl-perl tk-dev \
tk8.6-dev perl-tk libtk-img libtk-img-dev libtk-filedialog-perl \
libtk-tablematrix-perl libtirpc-common libtirpc-dev libntirpc-dev \
mingw-w64 wine wine64 wine64-preloader rpcsvc-proto libsmi2ldbl \
libsmi2-dev libieee1284-3 libieee1284-3-dev snmp-mibs-downloader \
libwine winbind winetricks wine-binfmt dosbox libnss-winbind \
libpam-winbind traceroute libnet-traceroute-perl snmp libsnmp-dev \
libnetsnmptrapd40 libntirpc3.5 libsnmp-perl smistrip
if test -x /home/linuxbrew/.linuxbrew/bin/brew; then \
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"; \
brew install --verbose tcl-tk libtirpc sqlite-analyzer; \
fi
if test -x "$(which gem)"; then \
echo "using $(which gem) to install some things..."; \
sudo gem install tcl-msgcat tcl-ruby; \
fi
if test -x "$(which npm)"; then \
echo "using $(which npm) to install some things..."; \
npm install tcl tcl-js; \
fi
if test -x "$(which conda)"; then \
echo "using $(which conda) to install something..."; \
conda -v install r-tcltk2; \
fi
if test -x "$(which vcpkg)"; then \
echo "giving $(which vcpkg) a try..."; \
vcpkg install tcl; \
fi
if test -x "$(which yarn)"; then \
echo "using $(which yarn) to install some things..."; \
yarn add tcl tcl-js; \
fi
if test -x "$(which cpan)"; then \
echo "using $(which cpan) to install some things..."; \
sudo cpan i Tcl Test::Tk Tk::Tree Tk::Trace Tk::FileTree; \
fi

# Autobuild attempts to build any compiled languages
# (C/C++, C#, Go, Java, or Swift).
- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Actually build
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then \
make ubuntu CFLAGS="-Wno-error -I/usr/include/tirpc -fPIC"; \
elif [[ "${{ runner.os }}" == "macOS" ]]; then \
make macosx CFLAGS="-Wno-error"; \
fi
if test -d /usr/include/tirpc; then \
make -ki build CFLAGS="-Wno-error -I/usr/include/tirpc -fPIC"; \
else \
make -ki build CFLAGS="-Wno-error -fPIC"; \
fi
sudo make -ki install CFLAGS="-Wno-error -fPIC"

- name: Extra coverage build (C)
if: success()
run: |
# shellcheck disable=SC2001
for subdir in tkined/generic tkined/unix tkined/win tnm tnm/compat \
tnm/generic tnm/snmp tnm/unix tnm/win; do \
pushd "${subdir}"; \
for srcfile in *.c; do \
echo "attempting to use $(which make) to compile ${srcfile} in ${subdir}"; \
make "$(echo "${srcfile}" | sed "s/\.c/.o/g")" CFLAGS="-w -Wno-error -Wfatal-errors -I. -I.. -I../generic -I/usr/include/tirpc" || \
stat -t "${srcfile}"; \
done; \
popd; \
done
find . -name '*.o' -exec cp -v {} . ";" || echo "ofile copying failed"
# shellcheck disable=SC2001,SC2044
for cfile in $(find . -name '*.c' -type f); do \
cobjfile="$(echo "${cfile}" | sed "s/\.c/.o/g")"; \
if test ! -e "${cobjfile}"; then \
echo "One last attempt at compiling ${cfile}..."; \
gcc -c -I. -I.. "${cfile}" || \
stat "${cfile}" || echo "cfile is ${cfile}"; \
else \
echo "object file ${cobjfile} already exists for ${cfile}."; \
cp -v "${cobjfile}" "$(dirname "${cfile}")" || \
cp -v "${cobjfile}" . || cp -v "${cobjfile}" ..; \
fi; \
done

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
124 changes: 124 additions & 0 deletions .github/workflows/scotty.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
name: cooljeanius/scotty
on:
push:
branches:
- "**/*"
pull_request:
jobs:
test:
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v4
# 'sudo' was not transformed because there is no suitable equivalent in
# GitHub Actions
- name: Dependencies 1
run: |
echo "Updating package lists..."
if [[ "${{ runner.os }}" == "macOS" ]]; then \
brew update; \
elif [[ "${{ runner.os }}" == "Linux" ]]; then \
sudo apt-get update; fi
- name: Dependencies 2
run: |
echo "Installing dependencies..."
# Be careful here: libtirpc is listed on Homebrew's package list, but
# it's only available via Linuxbrew...
if [[ "${{ runner.os }}" == "macOS" ]]; then \
brew install autoconf pkg-config findutils tcl-tk rpcsvc-proto; \
elif [[ "${{ runner.os }}" == "Linux" ]]; then \
sudo apt-get install tcl libtcl-perl pkg-config findutils \
libtirpc-common libtirpc-dev libntirpc-dev mingw-w64 wine wine64 \
rpcsvc-proto libc-dev; \
fi
- name: Dependencies 3
run: |
if test -d /opt && test -r /opt; then ls /opt; fi
if [[ "${{ runner.os }}" == "macOS" ]]; then \
brew link --force --overwrite tcl-tk; \
elif [[ "${{ runner.os }}" == "Linux" ]]; then \
sync && find . -name arpa/nameser.h; fi
- name: Dependencies 4
run: |
sync && pwd
if test -x /home/linuxbrew/.linuxbrew/bin/brew; then \
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"; \
brew install --verbose tcl-tk libtirpc; \
else \
echo "Linuxbrew unavailable, so skipping attempting to use it to try to install anything"; \
sync && sleep 1; \
fi
- run: cd tnm && autoreconf -vi -Wno-obsolete
- name: Configure
run: |
cd tnm
if [ -f /usr/lib/tclConfig.sh ]; then \
./configure --with-tcl=/usr/lib; \
elif [ -f /usr/local/lib/tclConfig.sh ]; then \
./configure --with-tcl=/usr/local/lib; \
elif [ -f /home/linuxbrew/.linuxbrew/lib/tclConfig.sh ]; then \
./configure --with-tcl=/home/linuxbrew/.linuxbrew/lib; \
elif [ -f /usr/share/miniconda/lib/tclConfig.sh ]; then \
touch miniconda_build.txt; \
./configure --with-tcl=/usr/share/miniconda/lib; \
elif [ -f /opt/homebrew/lib/tclConfig.sh ]; then \
./configure --with-tcl=/opt/homebrew/lib; \
else \
echo "Unsure where to find tcl; this may fail" && ./configure; \
fi
- name: Build
run: |
cd tnm
if [[ "${{ runner.os }}" == "Linux" ]]; then \
if test -e miniconda_build.txt; then \
stat compat; \
make -ki CFLAGS="-Wno-error=implicit-function-declaration -Wno-attributes -Icompat -D__TNM_CONFIG_H__ -DINET_ADDRSTRLEN=16"; \
else \
make CFLAGS="-Wno-error=implicit-function-declaration -Wno-attributes -I/usr/include/tirpc -fPIC"; \
fi; \
else \
make CFLAGS="-Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types -Wno-attributes"; \
fi
- name: Install 1
shell: bash
run: |
pushd tnm
if [[ $(uname -s) == "Linux" ]]; then \
if test -e miniconda_build.txt; then \
sudo make -ki install; \
else \
sudo make install CFLAGS="-Wno-error"; \
fi; \
else \
sync && echo "Skipping first install step for '$(uname -s)'"; \
fi
popd
- name: Install 2
shell: bash
run: |
pushd tnm
if [[ $(uname -s) == "Linux" ]]; then \
sudo make sinstall; \
else \
sync && echo "Skipping second install step for '$(uname -s)'"; \
fi
popd
- name: Debug failure
if: "${{ failure() }}"
run: |
ls -AR
sleep 1
if test -x "$(which clear)" -a -n "${TERM}" -a "${TERM}" != "dumb"; then \
echo "clear is $(which clear) and TERM is ${TERM}" && clear; \
else \
echo "(end of file listing output)"; \
fi
echo "whoami? $(whoami)"
sleep 1
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
autom4te.cache/
configure
confdefs.h
conftest*
*.o
*.o.tmp
*.n
*.so
tnm/scotty
*.dylib
.env.local
autoscan.log
log/valet-*.log
19 changes: 16 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
---
language: c
dist: xenial

sudo: true
cache:
directories:
- /usr/local

env:
global:
- MAKEFLAGS="-j2"

os:
- linux
- osx

osx_image: xcode10.1

before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install tcl-tk; fi
- export HOMEBREW_NO_EMOJI=1 HOMEBREW_BOOTSNAP=1 HOMEBREW_CURL_VERBOSE=1 HOMEBREW_VERBOSE=1 HOMEBREW_VERBOSE_USING_DOTS=1
- export GIT_CURL_VERBOSE=1 && env | uniq | sort | uniq
- if test -x "`which xcode-select`" && test "x`whoami`" = "xroot" && test "x${TERM_PROGRAM}" = "xApple_Terminal"; then xcode-select --install; else echo "nope (`whoami`)"; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then which -a brew && brew update -v --auto-update; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ca-certificates && brew install -v --display-times tcl-tk; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link --force --overwrite tcl-tk; fi

script:
Expand Down
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
# on some platforms.
#

PLATFORMS = wheezy jessie yakkety freebsd alpine macosx sunos
PLATFORMS = ubuntu wheezy jessie yakkety slackware freebsd alpine macosx netbsd \
sunos minix

all:
@echo
@echo ""
@echo "This is a Makefile for convenient building and installing"
@echo "of scotty with standard configuration."
@echo
@echo ""
@echo "Typical invocation:"
@echo " make _platform_"
@echo " make build"
@echo " sudo make install"
@echo
@echo ""
@echo "Other targets: clean uninstall distclean"
@echo
@echo Available platform targets: $(PLATFORMS)
@echo
@echo ""
@echo "Available platform targets: $(PLATFORMS)"
@echo ""

ubuntu wheezy jessie yakkety slackware:
(cd tnm && autoheader && autoconf && ./configure)
Expand Down
1 change: 1 addition & 0 deletions generic/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#
Loading