Skip to content

Commit 456b6d4

Browse files
committed
Merge remote-tracking branch 'origin/master' into bump-gcc-std
2 parents dc6611a + a7fbd54 commit 456b6d4

File tree

532 files changed

+760053
-270908
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

532 files changed

+760053
-270908
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.po merge=pofile
22
*.pot merge=pofile
3+
.github/ export-ignore

.github/workflows/ci.yml

Lines changed: 153 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
# po4a Version 0.57 in ubuntu 20 do not write translated adoc as
2-
# UTF-8. Need at least version 0.62 to fix it.
3-
# Motivations to update:
4-
# 0.66 to also get fix for empty asciidoc table cells.
5-
# 0.67 for hard newlines ( +\n) in paragraphs
1+
# vim: sw=2
2+
63
name: Build CI
74

85
on:
@@ -14,6 +11,7 @@ on:
1411
types: [rerequested]
1512

1613
jobs:
14+
1715
rip-and-test:
1816
runs-on: ubuntu-20.04
1917
steps:
@@ -38,7 +36,7 @@ jobs:
3836
eatmydata make -O -j$((1+$(nproc))) default pycheck V=1
3937
# Note that the package build covers html docs
4038
../scripts/rip-environment runtests -p
41-
39+
4240
htmldocs:
4341
runs-on: ubuntu-20.04
4442
steps:
@@ -65,34 +63,164 @@ jobs:
6563
eatmydata make -O -j$((1+$(nproc))) docs
6664
# Note that the package build covers html docs
6765
68-
package:
69-
runs-on: ubuntu-20.04
66+
package-arch:
67+
runs-on: ubuntu-latest
68+
strategy:
69+
matrix:
70+
image: ["debian:buster", "debian:bullseye", "debian:bookworm", "debian:sid"]
71+
container:
72+
image: ${{ matrix.image }}
73+
# IPC_OWNER is needed for shmget IPC_CREAT
74+
# SYS_ADMIN is needed for shmctl IPC_SET
75+
options: --cpus=2 --cap-add=IPC_OWNER --cap-add=SYS_ADMIN
7076
steps:
7177
- name: Dump GitHub context
7278
env:
7379
GITHUB_CONTEXT: ${{ toJson(github) }}
7480
run: echo "$GITHUB_CONTEXT"
75-
- uses: actions/checkout@v2
81+
- name: Install pre-dependencies
82+
env:
83+
DEBIAN_FRONTEND: noninteractive
84+
run: |
85+
set -e
86+
set -x
87+
apt-get --quiet update
88+
# Install stuff needed to check out the linuxcnc repo and turn it into a debian source package.
89+
apt-get --yes --quiet install --no-install-suggests git lsb-release python3 devscripts
90+
91+
- uses: actions/checkout@v3
7692
with:
77-
submodules: true
93+
# "fetch-depth: 0" fetches all of history, this is needed by
94+
# our build system to determine the version from tags
7895
fetch-depth: 0
79-
- name: Build Debian package
96+
97+
- name: Add linuxcnc.org deb archive
98+
env:
99+
DEBIAN_FRONTEND: noninteractive
80100
run: |
101+
set -e
81102
set -x
82-
git fetch --recurse-submodules=no https://github.com/linuxcnc/linuxcnc refs/tags/*:refs/tags/*
83-
./scripts/travis-install-build-deps.sh
84-
sudo apt-get install -y eatmydata
85-
curl -O https://snapshot.debian.org/archive/debian/20220716T154603Z/pool/main/p/po4a/po4a_0.67-2_all.deb
86-
sudo apt install ./po4a_0.67-2_all.deb
87-
codename=$(lsb_release -cs)
88-
dch --maintmaint --distribution $codename "GitHub test package."
89-
eatmydata debian/configure
90-
eatmydata debuild -us -uc
91-
sudo apt-get install ../*.deb
92-
./scripts/runtests -p tests/
93-
eatmydata lintian --info --display-info --pedantic --display-experimental ../linuxcnc*.changes
94-
mkdir built-debs
95-
cp ../linuxcnc*_* built-debs/
103+
apt-get --yes --quiet install --no-install-recommends gpg software-properties-common
104+
gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF
105+
DIST=$(echo ${{matrix.image}} | cut -d : -f 2)
106+
add-apt-repository "deb http://linuxcnc.org $DIST base"
107+
apt-get --quiet update
108+
109+
- name: Build architecture-specific Debian packages
110+
env:
111+
DEBEMAIL: emc-developers@lists.sourceforge.net
112+
DEBFULLNAME: LinuxCNC Github CI Robot
113+
DEBIAN_FRONTEND: noninteractive
114+
run: |
115+
set -e
116+
set -x
117+
git config --global --add safe.directory "${PWD}"
118+
debian/configure
119+
debian/update-dch-from-git
120+
scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION
121+
git diff
122+
apt-get --yes --quiet build-dep --arch-only .
123+
apt-get --yes --quiet install eatmydata
124+
eatmydata debuild -us -uc --build=any
125+
- name: Test debian packages
126+
env:
127+
DEBIAN_FRONTEND: noninteractive
128+
run: |
129+
set -e
130+
set -x
131+
apt-get --yes --quiet install ../*.deb
132+
apt-get --yes --quiet install sudo # some tests run sudo...
133+
adduser --disabled-password --gecos "" testrunner
134+
passwd -d testrunner
135+
adduser testrunner sudo
136+
chmod 0777 $(find tests/ -type d) # make test dirs world-writable for the testrunner
137+
su -c "./scripts/runtests -p ./tests" testrunner
138+
- name: Stage debs for archiving
139+
run: |
140+
set -e
141+
set -x
142+
mkdir -p built-debs/$(lsb_release -cs)
143+
cp ../linuxcnc*_* built-debs/$(lsb_release -cs)
144+
- name: Archive generated Debian packages
145+
uses: actions/upload-artifact@v3
146+
with:
147+
name: debs
148+
retention-days: 7
149+
path: built-debs/*
150+
151+
package-indep:
152+
runs-on: ubuntu-latest
153+
strategy:
154+
matrix:
155+
image: ["debian:buster", "debian:bullseye", "debian:bookworm", "debian:sid"]
156+
container:
157+
image: ${{ matrix.image }}
158+
# IPC_OWNER is needed for shmget IPC_CREAT
159+
# SYS_ADMIN is needed for shmctl IPC_SET
160+
options: --cpus=2 --cap-add=IPC_OWNER --cap-add=SYS_ADMIN
161+
steps:
162+
- name: Dump GitHub context
163+
env:
164+
GITHUB_CONTEXT: ${{ toJson(github) }}
165+
run: echo "$GITHUB_CONTEXT"
166+
167+
- name: Install pre-dependencies
168+
env:
169+
DEBIAN_FRONTEND: noninteractive
170+
run: |
171+
set -e
172+
set -x
173+
apt-get --quiet update
174+
# Install stuff needed to check out the linuxcnc repo and turn it into a debian source package.
175+
apt-get --yes --quiet install --no-install-suggests git lsb-release python3 devscripts
176+
177+
- uses: actions/checkout@v3
178+
with:
179+
# "fetch-depth: 0" fetches all of history, this is needed by
180+
# our build system to determine the version from tags
181+
fetch-depth: 0
182+
183+
- name: Add linuxcnc.org deb archive
184+
env:
185+
DEBIAN_FRONTEND: noninteractive
186+
run: |
187+
set -e
188+
set -x
189+
apt-get --yes --quiet install gpg software-properties-common
190+
gpg --homedir="${PWD}/gnupg" --output /etc/apt/trusted.gpg.d/linuxcnc-deb-archive.gpg --export 3CB9FD148F374FEF
191+
DIST=$(echo ${{matrix.image}} | cut -d : -f 2)
192+
add-apt-repository "deb http://linuxcnc.org $DIST base"
193+
apt-get --quiet update
194+
195+
- name: Build architecture-independent Debian packages
196+
env:
197+
DEBEMAIL: emc-developers@lists.sourceforge.net
198+
DEBFULLNAME: LinuxCNC Github CI Robot
199+
DEBIAN_FRONTEND: noninteractive
200+
run: |
201+
set -e
202+
set -x
203+
git config --global --add safe.directory "${PWD}"
204+
debian/configure
205+
debian/update-dch-from-git
206+
scripts/get-version-from-git | sed -re 's/^v(.*)$/\1/' >| VERSION; cat VERSION
207+
git diff
208+
apt-get --yes --quiet build-dep --indep-only .
209+
apt-get --yes --quiet install eatmydata
210+
eatmydata debuild -us -uc --build=all
211+
- name: Test install debian packages
212+
env:
213+
DEBIAN_FRONTEND: noninteractive
214+
run: |
215+
set -e
216+
set -x
217+
apt-get --yes --quiet install ../*.deb
218+
- name: Stage debs for archiving
219+
run: |
220+
set -e
221+
set -x
222+
mkdir -p built-debs/$(lsb_release -cs)
223+
cp ../linuxcnc*_* built-debs/$(lsb_release -cs)
96224
- name: Archive generated PDF files
97225
uses: actions/upload-artifact@v3
98226
with:

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ build-stamp
1313
.tmp*
1414
# Ignore generated html files,
1515
/docs/src/*/*.html
16+
docs/src/hal/components_gen.adoc
1617
# docs/html/.gitignore is for the html directory
1718
debian/*.debhelper.log
1819
rtlib/Module.symvers
@@ -49,10 +50,12 @@ position.txt
4950
*-new_??.po
5051
# Ignore stamp files
5152
*.*-stamp
53+
# Ignore VSCode settings
54+
.vscode/settings.json
5255
# Ignore po4a-generated files for other languages
5356
docs/help/es/*
5457
docs/help/fr/*
5558
docs/help/hu/*
5659
docs/help/nb/*
5760
docs/help/vi/*
58-
docs/help/zh_CN/*
61+
docs/help/zh_CN/*

configs/sim/axis/db_demo/db.py

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
prog = sys.argv[0] # this program
8484
tools = dict() # tools[tno]: dict of text toollines
8585
toollist = [] # list of tool numbers
86-
restore_pocket = dict() # for nonran toolchanger
86+
nonran_from_pocket = dict()# use to restore pocket in db
8787
p0tool = -1 # nonran:-1, ran:-1|0 ==> no tool in spindle
8888
start_time = 0 # 0 ==> indeterminate
8989
elapsed_time = 0 # tool time usage
@@ -193,7 +193,7 @@ def save_tools_to_file(fname,comment=""):
193193
history.append(comment)
194194
if len(history) > history_max_ct: history=history[1:]
195195
if len(history):
196-
f.write("\n;Recent (last %d) db history:\n"%history_max_ct)
196+
f.write("\n; Recent (last %d) db history:\n"%history_max_ct)
197197
for i in range(len(history)):
198198
f.write("; %s\n"%history[i])
199199
f.close()
@@ -202,6 +202,15 @@ def nonran_pno(tno): # simulation rule:
202202
return tno+pocket_offset # make startup pocket number different than tool number
203203
# to avoid assumptions about tno and pno
204204

205+
def nonran_restore_pocket(tno):
206+
D = toolline_to_dict(tools[tno],all_letters)
207+
D['P'] = nonran_from_pocket[tno]
208+
tools[tno] = dict_to_toolline(D,all_letters)
209+
if not tno in nonran_from_pocket:
210+
umsg("nonran_restore_pocket tno=%d not in dict: %s"%(tno,nonran_from_pocket))
211+
#msg("Restore pocket tno:%d pno %s"%(tno,int(D['P'])))
212+
del nonran_from_pocket[tno]
213+
205214
def assign_pocket(tno):
206215
global available_pockets
207216
if not random_toolchanger:
@@ -355,8 +364,10 @@ def handle_disconnect(fname):
355364
global disconnect_evt
356365
if p0tool > 0:
357366
stop_tool_timer(p0tool)
358-
save_tools_to_file(fname,"tno:%3d in spindle at termination"%p0tool)
359367
msg("!!!Stopped with loaded tool: %d"%p0tool)
368+
if not random_toolchanger:
369+
nonran_restore_pocket(p0tool)
370+
save_tools_to_file(fname,"tno:%3d in spindle at termination"%p0tool)
360371
msg("disconnected")
361372
disconnect_evt.set()
362373

@@ -389,14 +400,11 @@ def stop_tool_timer(tno):
389400

390401
def update_tool(tno,update_line):
391402
D = toolline_to_dict(tools[tno],all_letters)
392-
savep = D['P']
393403
for item in toolline_to_list(update_line):
394404
for l in tletters:
395405
if l in item: D[l]=item.lstrip(l) #supersede by update_line
396-
if not random_toolchanger:
397-
if D['P'] != savep and D['P'] != 0:
398-
umsg("update_tool(): reject pocket change %s (is:%s)"%(D['P'],savep))
399-
D['P'] = savep # nonran handle p0 case
406+
if not random_toolchanger and p0tool == tno:
407+
D['P'] = '0' # unload uses nonran_from_pocket[]
400408
tools[tno] = dict_to_toolline(D,all_letters)
401409

402410
def apply_db_rules():
@@ -481,15 +489,14 @@ def user_load_spindle_nonran_tc(tno,params):
481489
if TMP['P'] != "0": umsg("user_load_spindle_nonran_tc P=%s"%TMP['P'])
482490
if tno == 0: umsg("user_load_spindle_nonran_tc tno=%d"%tno)
483491

484-
# save restore_pocket as pocket may have been altered by apply_db_rules()
485492
D = toolline_to_dict(tools[tno],all_letters)
486-
if tno != p0tool: restore_pocket[tno] = D['P'] # avoid reset if redundant load
493+
494+
# save nonran_from_pocket as pocket may have been altered by apply_db_rules()
495+
if tno != p0tool: nonran_from_pocket[tno] = D['P'] # avoid reset if redundant load
487496

488497
if p0tool != -1: # accrue time for prior tool:
489498
stop_tool_timer(p0tool)
490-
RESTORE = toolline_to_dict(tools[p0tool],all_letters)
491-
RESTORE['P'] = restore_pocket[p0tool]
492-
tools[p0tool] = dict_to_toolline(RESTORE,all_letters)
499+
nonran_restore_pocket(p0tool)
493500

494501
p0tool = tno
495502
D['T'] = str(tno)
@@ -501,7 +508,7 @@ def user_load_spindle_nonran_tc(tno,params):
501508
def user_unload_spindle_nonran_tc(tno,params):
502509
global p0tool
503510
#msg("user_unload_spindle_nonran_tc p0tool=%d restore=%s'u %s'"%
504-
# (p0tool,restore_pocket,params))
511+
# (p0tool,nonran_from_pocket,params))
505512
check_params(tno,params)
506513

507514
if p0tool == -1: return # ignore
@@ -510,17 +517,14 @@ def user_unload_spindle_nonran_tc(tno,params):
510517
if TMP['P'] != "0": umsg("user_unload_spindle_nonran_tc P=%s"%TMP['P'])
511518

512519
stop_tool_timer(p0tool)
513-
D = toolline_to_dict(tools[p0tool],all_letters)
514-
D['T'] = str(p0tool)
515-
D['P'] = restore_pocket[p0tool]
516-
tools[p0tool] = dict_to_toolline(D,all_letters)
517-
520+
nonran_restore_pocket(p0tool)
518521
p0tool = -1
522+
519523
save_tools_to_file(db_savefile,"tno:%3d (unload from spindle)(empty)"%tno)
520524

521525
def user_load_spindle_ran_tc(tno,params):
522526
global p0tool
523-
#msg("user_load_spindle_ran_tc 'l %s'"%params)
527+
#msg("user_load_spindle_ran_tc 'l %s' (p0tool=%d)"%(params,p0tool))
524528
check_params(tno,params)
525529

526530
D = toolline_to_dict(tools[tno],all_letters)
@@ -537,26 +541,24 @@ def user_load_spindle_ran_tc(tno,params):
537541
tools[tno] = dict_to_toolline(D,all_letters)
538542

539543
pno = int(D['P'])
540-
msg = "tno:%3d --> pno:%3d ( load to spindle)"%(tno,pno)
544+
txt = "tno:%3d --> pno:%3d ( load to spindle)"%(tno,pno)
541545
if tno==0 and pno==0:
542-
msg = "tno:%3d --> pno:%3d ( load t0 spindle)(empty)"%(tno,pno)
543-
save_tools_to_file(db_savefile,msg)
546+
txt = "tno:%3d --> pno:%3d ( load t0 spindle)(empty)"%(tno,pno)
547+
save_tools_to_file(db_savefile,txt)
544548

545549
def user_unload_spindle_ran_tc(tno,params):
546550
global p0tool
547-
#msg("user_unload_spindle_ran_tc 'u %s'"%params)
551+
#msg("user_unload_spindle_ran_tc 'u %s' (p0tool=%d)"%(params,p0tool))
548552
check_params(tno,params)
549553
TMP = toolline_to_dict(params,['T','P'])
550554
if p0tool == -1:
555+
if tno != 0:
556+
umsg("user_unload_spindle_ran_tc p0tool=%d tno=%d"%(p0tool,tno))
551557
D = dict()
552558
D['T'] = TMP['T']
553559
D['P'] = TMP['P']
554560
tools[0] = dict_to_toolline(D,['T','P'])
555-
#msg("user_unload_spindle_ran_tc: ignoring for no p0tool")
556-
pass
557561
else:
558-
if p0tool == 0:
559-
pass
560562
stop_tool_timer(p0tool)
561563
D = toolline_to_dict(tools[p0tool],all_letters)
562564
D['T'] = TMP['T']
@@ -565,10 +567,10 @@ def user_unload_spindle_ran_tc(tno,params):
565567
p0tool = -1
566568

567569
pno = int(D['P'])
568-
msg="tno:%3d --> pno:%3d (unload from spindle)"%(tno,pno)
570+
txt="tno:%3d --> pno:%3d (unload from spindle)"%(tno,pno)
569571
if tno==0:
570-
msg="tno:%3d --> pno:%3d (unload from spindle)(notool)"%(tno,pno)
571-
save_tools_to_file(db_savefile,msg)
572+
txt="tno:%3d --> pno:%3d (unload from spindle)(notool)"%(tno,pno)
573+
save_tools_to_file(db_savefile,txt)
572574

573575
#-----------------------------------------------------------
574576
# begin interface to LinuxCNC

0 commit comments

Comments
 (0)