whitequark[cis] changed the topic of #glasgow to: https://glasgow-embedded.org · digital interface explorer · https://www.crowdsupply.com/1bitsquared/glasgow · code https://github.com/GlasgowEmbedded/glasgow · logs https://libera.catirclogs.org/glasgow · matrix #glasgow-interface-explorer:matrix.org · discord https://1bitsquared.com/pages/chat
<_whitenotifier-8> [glasgow] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-974-c69ffd66ee508e46b4be5df7bf78e9a3a2db9858 - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-8> [GlasgowEmbedded/glasgow] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±1] https://github.com/GlasgowEmbedded/glasgow/compare/c69ffd66ee50...e4a53fdc4d92
<_whitenotifier-8> [GlasgowEmbedded/glasgow] flokli e4a53fd - software/deploy-firmware: skip group addition if group already exists
<_whitenotifier-8> [glasgow] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-974-c69ffd66ee508e46b4be5df7bf78e9a3a2db9858 - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-8> [glasgow] whitequark closed pull request #974: software/deploy-firmware: skip group addition if group already exists - https://github.com/GlasgowEmbedded/glasgow/pull/974
<_whitenotifier-8> [glasgow] whitequark commented on issue #975: software/deploy-firmware does not reproduce - https://github.com/GlasgowEmbedded/glasgow/issues/975#issuecomment-3124837534
leper- has joined #glasgow
leper has quit [Ping timeout: 240 seconds]
leper- is now known as leper
cr1901 has quit [Read error: Connection reset by peer]
cr1901 has joined #glasgow
leper- has joined #glasgow
leper has quit [Ping timeout: 260 seconds]
leper- is now known as leper
cr1901 has quit [Ping timeout: 276 seconds]
cr1901 has joined #glasgow
sazzach[m] has quit [Quit: Idle timeout reached: 172800s]
cr1901 has quit [Read error: Connection reset by peer]
cr1901 has joined #glasgow
_whitelogger has joined #glasgow
GNUmoon has quit [Ping timeout: 244 seconds]
GNUmoon has joined #glasgow
redstarcomrade has quit [Read error: Connection reset by peer]
<_whitenotifier-8> [glasgow] whitequark opened pull request #976: support.usb.libusb1: don't crash if hotplug is unsupported - https://github.com/GlasgowEmbedded/glasgow/pull/976
<_whitenotifier-8> [glasgow] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-976-e4a53fdc4d92d69d6fb3af39e4b9b600953f49eb - https://github.com/GlasgowEmbedded/glasgow
redstarcomrade has joined #glasgow
<_whitenotifier-8> [GlasgowEmbedded/glasgow] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±1] https://github.com/GlasgowEmbedded/glasgow/compare/e4a53fdc4d92...27a68fc6a2fe
<_whitenotifier-8> [GlasgowEmbedded/glasgow] whitequark 27a68fc - support.usb.libusb1: don't crash if hotplug is unsupported.
<_whitenotifier-8> [glasgow] whitequark closed pull request #976: support.usb.libusb1: don't crash if hotplug is unsupported - https://github.com/GlasgowEmbedded/glasgow/pull/976
<_whitenotifier-8> [glasgow] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-976-e4a53fdc4d92d69d6fb3af39e4b9b600953f49eb - https://github.com/GlasgowEmbedded/glasgow
redstarcomrade has quit [Read error: Connection reset by peer]
figushki has joined #glasgow
figushki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
figushki has joined #glasgow
figushki has quit [Client Quit]
figushki has joined #glasgow
figushki has quit [Remote host closed the connection]
figushki has joined #glasgow
figushki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
figushki has joined #glasgow
<_whitenotifier-8> [glasgow] flokli opened pull request #977: firmware: don't bake GIT_REVISION into firmware - https://github.com/GlasgowEmbedded/glasgow/pull/977
<flokli> whitequark[cis]: while trying to make the firmware reproduce, I tried with the nix-provided sdcc 4.2.0, but ran into a "?ASlink-Warning-Undefined Global 'sdcc_atomic_maybe_rollback' referenced by module 'usb'". Does that ring a bell?
<_whitenotifier-8> [glasgow] whitequark commented on pull request #977: firmware: don't bake GIT_REVISION into firmware - https://github.com/GlasgowEmbedded/glasgow/pull/977#issuecomment-3126474232
<_whitenotifier-8> [glasgow] whitequark commented on pull request #977: firmware: don't bake GIT_REVISION into firmware - https://github.com/GlasgowEmbedded/glasgow/pull/977#issuecomment-3126480245
figushki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<whitequark[cis]> flokli: first time I see it
<whitequark[cis]> I've tried reproducing the issue but I hit a snag where Docker has broken networking on hosts that have IPv6
figushki has joined #glasgow
figushki has quit [Client Quit]
<_whitenotifier-8> [glasgow] flokli commented on pull request #977: firmware: don't bake GIT_REVISION into firmware - https://github.com/GlasgowEmbedded/glasgow/pull/977#issuecomment-3126509609
<flokli> whitequark[cis]: ok, I'll try digging more
<flokli> btw, 27a68fc6a2fec37a22621d340c344990d06a4a3b is unrelated to the thread in https://github.com/GlasgowEmbedded/glasgow/pull/958#issuecomment-3121801301, correct?
<_whitenotifier-8> [glasgow] whitequark commented on pull request #977: firmware: don't bake GIT_REVISION into firmware - https://github.com/GlasgowEmbedded/glasgow/pull/977#issuecomment-3126547634
<whitequark[cis]> that commit fixes an issue that someone reported to me privately
<whitequark[cis]> the timeouts reading the serial number are very odd because absent a firmware bug (which is possible) that should never happen
<whitequark[cis]> there aren't any software bugs i can think of that would cause this
<_whitenotifier-8> [glasgow] whitequark commented on issue #975: software/deploy-firmware does not reproduce - https://github.com/GlasgowEmbedded/glasgow/issues/975#issuecomment-3126571531
<whitequark[cis]> flokli: I don't understand what's going on with the firmware builds: the md5sum you posted doesn't match what's checked into the tree
<whitequark[cis]> I can confirm that the glasgow.ihex you posted is different from the one in-tree, but when I run the deploy-firmware.sh script, I get a file identical to what's checked in
<whitequark[cis]> which would have to be the case since it's impossible to land a commit changing firmware.ihex unless it reproduces
<_whitenotifier-8> [glasgow] whitequark commented on issue #975: software/deploy-firmware does not reproduce - https://github.com/GlasgowEmbedded/glasgow/issues/975#issuecomment-3126589152
<_whitenotifier-8> [glasgow] whitequark commented on issue #975: software/deploy-firmware does not reproduce - https://github.com/GlasgowEmbedded/glasgow/issues/975#issuecomment-3126600669
<_whitenotifier-8> [glasgow] flokli closed issue #975: software/deploy-firmware does not reproduce - https://github.com/GlasgowEmbedded/glasgow/issues/975
<_whitenotifier-8> [glasgow] flokli commented on issue #975: software/deploy-firmware does not reproduce - https://github.com/GlasgowEmbedded/glasgow/issues/975#issuecomment-3126607205
<flokli> whitequark[cis]: I still had the glasgow tree I used to cross-check on x86_64-linux on that machine and was able to connect the dots, see the comment.
<_whitenotifier-8> [glasgow] whitequark commented on issue #975: software/deploy-firmware does not reproduce - https://github.com/GlasgowEmbedded/glasgow/issues/975#issuecomment-3126616383
<_whitenotifier-8> [glasgow] whitequark commented on issue #975: software/deploy-firmware does not reproduce - https://github.com/GlasgowEmbedded/glasgow/issues/975#issuecomment-3126619333
<whitequark[cis]> flokli: okay, yeah, I figured it out now as well
<whitequark[cis]> flokli: let me try and look into why it doesn't work with nix-provided sdcc
<whitequark[cis]> sdcc_atomic_maybe_rollback is an implementation of C11 atomic operations
<whitequark[cis]> we aren't using any C11 atomic operations
<whitequark[cis]> so: assuming you've provided all the correct options, either debian is patching sdcc and fixing something broken, or nixos is patching sdcc and breaking something. or a secret third thing
<whitequark[cis]> it looks like debian's only patch is fixing spelling errors in source code and changelogs. they must have lots of extra time
<whitequark[cis]> * source code comments and changelogs.
<flokli> yeah, they also have a almost 200 lines custom makefile in their packaging scripts.
<whitequark[cis]> yes, it's upsetting
<whitequark[cis]> wait, makefile?
<whitequark[cis]> oh right debian/rules
<whitequark[cis]> * right debian/rules is a makefile
<whitequark[cis]> i actually did read through that and didn't find anything relevant
<whitequark[cis]> re: your idea of using firmware checksums: probably the only way i'd ever do that is if i maintained an allowlist of firmware revisions that are accepted without an extra command line switch, but then some distro packager will patch out the check. i hate being in an adversarial relationship like that and my position is that if you're packaging my software at all you should respect the decisions that went into it.
<_whitenotifier-8> [glasgow] flokli closed pull request #977: firmware: don't bake GIT_REVISION into firmware - https://github.com/GlasgowEmbedded/glasgow/pull/977
<_whitenotifier-8> [glasgow] flokli commented on pull request #977: firmware: don't bake GIT_REVISION into firmware - https://github.com/GlasgowEmbedded/glasgow/pull/977#issuecomment-3126660211
<flokli> whitequark[cis]: Let's keep going with the git commit id of the firmware/ dir baked into the firmware, I closed the PR changing that.
<whitequark[cis]> flokli: alright. fwiw I think nix rebuilding the firmware from scratch to verify that it is identical is valuable and very much desired work
<whitequark[cis]> it's just "blindly replace the firmware with something different if it turns out to be different" that I think is a net negative
<flokli> I'm a bit exhausted from the discussion for today, I might pick it up in the future.
<whitequark[cis]> so I'm happy to help you figure out why that doesn't work if it breaks
<flokli> We can draft the nixpkgs bump PR and keep the old version from January in nixpkgs, which due to a packaging bug uses your firmware.
<whitequark[cis]> thank you
<flokli> I did pipe a lot of firmwares through diffoscope, and they're all just different. It's hard to figure out why.
<whitequark[cis]> the easiest solution is to comment out that cp for the PR
<flokli> probably, yes.
<whitequark[cis]> I know some distributions have policies against that kind of thing but as far as I'm aware NixOS doesn't
<flokli> We can set `sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];`
<flokli> and call it a day
<flokli> But it means we cannot apply patches to backport fixes without including ihex changes in the patch.
<whitequark[cis]> does anyone want to do that?
<whitequark[cis]> most people get glasgow software by cloning a repository and tracking HEAD. there aren't releases and most likely there will never be releases. a lot of effort goes into maintaining backwards compatibility
<flokli> s/binaryBytecode/binaryNativeCode/
figushki has joined #glasgow
<flokli> If there's a fix in the firmware we'd want to apply, but we don't build the firmware from the updated sources, to get the firmware fixed we'd also need to include the updated binary code in the backport
<flokli> well, if there's no tags/releases then this is probably less of an issue.
<whitequark[cis]> glasgow is the software equivalent of a rolling distro
<flokli> mmh
<flokli> I guess I should open an issue about the libusb thing then
<whitequark[cis]> given its scope and nature it's completely infeasible to do release branches, and simply doing releases doesn't seem meaningful: no commit is considered "more stable" than any other commit
<flokli> yes
<whitequark[cis]> re: libusb thing: yes, absolutely, I'm very interested in fixing that
<whitequark[cis]> how do i get nix to give me sdcc 4.2.0?
<whitequark[cis]> nix-shell -p sdcc gives me sdc 4.5.0
<flokli> easiest would be to pick an old version of nixpkgs with 4.2.0
<flokli> I did modify the glasgow package expression to modify the current packaging recipe to build 4.2.0 instead: https://paste.linuxlounge.net/AA
<whitequark[cis]> ohhh right you can do that in nix
<flokli> if it would have given me a firmware closer to what's in the repo, I would have happily added that. But with that the firmware build fails entirely
<whitequark[cis]> we can probably just upgrade to 4.5.0
<flokli> how? by switching from bookworm to something else?
<whitequark[cis]> trixie, yeah. you are also entirely correct that i should've added a digest to the docker invocation
<whitequark[cis]> that just leaves repository updates as the source of potential nondeterminism. back when I decided to use this script, I confirmed that Debian never updated sdcc in a stable release after it's been cut (presumably because there's no reason for anyone to do so)
<whitequark[cis]> really I would have preferred to use Nix to get reproducible firmware builds because it's obviously much better suited to this task
<flokli> what's preventing us?
<flokli> I mean, going with the nix-shell shebang script and a pinned nixpkgs
<whitequark[cis]> I want people running Debian or Ubuntu or something on a desktop to be able to do this
<whitequark[cis]> this includes myself and also our CI infra
<flokli> The shebang only requires Nix to be installed, not running on NixOS
<whitequark[cis]> I actually have a nix-shell locally, I have no idea where I got it and it seems to be outdated
<flokli> and there's even nix containers available, so we could wrap it into a nixos/nix container if we don't detect nix-build in $PATH.
<whitequark[cis]> oh.
<flokli> an outdated nix should still be fine as long as it's not too old to evaluate the nixpkgs we pin.
<whitequark[cis]> that's an incredibly obvious thing in retrospect
<whitequark[cis]> docker and nix are not mutually exclusive
<whitequark[cis]> thanks, that's an excellent idea
<flokli> The build sandbox is a bit less powerful if you're running inside a container, so it should still be a fallback only if you don't have nix-build natively.
<whitequark[cis]> yeah, that's fine
<flokli> But yeah, if you're willing to go that route, happy to take a look.
<whitequark[cis]> yep, I'm not sure if you've found it but back before I merged the Docker solution, I have examined two: Docker and Nix
<whitequark[cis]> one sec
<whitequark[cis]> (actually it looks like it was after I merged the Docker option and not before, I misremembered)
<flokli> yes, this pins nixpkgs to a fixed rev, so should give you strong pining of sdcc and all of its deps.
<flokli> I'd probably wrap this script with a second one that figures out whether nix-shell is in $PATH, and either executes it directly or inside a nixos/nix container.
<whitequark[cis]> yep that's completely fine
<flokli> and I'd probably bump the rev to f4a973b4a237153db1ed07f35cfa72b5b145276b, the latest commit on the current stable release.
<whitequark[cis]> actually, have you tried running that script verbatim?
<whitequark[cis]> I get bit-for-bit identical copy of the current checked-in firmware
<whitequark[cis]> (you could probably just embed that into the derivation if you wanted to avoid tainting it)
<flokli> yup, same hash for me. it puts the firmware.ihex into the wrong path, but otherwise same firmware
<whitequark[cis]> right, so only the derivations using current nixpkgs (with sdcc 4.2 and 4.5) are broken in various ways
<whitequark[cis]> do you get a different firmware file each time?
<whitequark[cis]> I'm still really confused as to what would cause it; sdcc isn't known for nondeterminism in first place
<flokli> I'd assume sdcc 4.2 -> 4.5 had some changes in codegen
<whitequark[cis]> oh yes I wouldn't expect it to reproduce across sdcc versions
<whitequark[cis]> I'm just confirming that sdcc 4.5 produces the same firmware each time for you
<flokli> I kicked off a second build of the glasgow package, but I'd assume it to be identical
<whitequark[cis]> can you tell me the sha1 ?
<whitequark[cis]> oh that's a lot of nuisance warnings on 4.5
<flokli> glasgow rev 27a68fc6a2fec37a22621d340c344990d06a4a3b built with nixpkgs produced firmware.ihex with sha1sum 3410e0144176bd0235f6ed58d361a4b728b025a0 on aarch64-linux, twice.
<flokli> (running a build on x86_64-linux now)
GNUmoon has quit [Remote host closed the connection]
GNUmoon has joined #glasgow
<whitequark[cis]> can you upload a firmware/build/glasgow.map file from the build? it's text
<whitequark[cis]> and also firmware/build/glasgow.lk
<whitequark[cis]> sdcc doesn't do anything clever during the compilation so i'd start looking at the linker issues first
<whitequark[cis]> this looks to be the only meaningful difference
<whitequark[cis]> my build is 14 bytes bigger for some reason
<flokli> mm
<whitequark[cis]> actually i think i'm not reading that diff right
<flokli> same build (3410e0144176bd0235f6ed58d361a4b728b025a0) on x86_64-linux
<flokli> your build is with sdcc 4.5 from debian?
<whitequark[cis]> yes
<whitequark[cis]> i think what's happening is that the constant (.rodata) area is 14 bytes bigger
<whitequark[cis]> but it kind of doesn't make sense
<flokli> wait, hold on
<whitequark[cis]> none of the addresses inside are different, meaning it would be the last symbol that's the problem
<flokli> this is the full nix build, which cannot shell out to git to determine the revision to bake into the firmware. What does the script use in that case?
<whitequark[cis]> oh.
<flokli> I can use the impure script from #469, with a bumped nixpkgs rev, and re-run the build
<whitequark[cis]> it puts nothing in place of the revision
<whitequark[cis]> and the reason it's 14 and not 8 is that my local work tree is dirty (I added --std=c23 to silence nuisance warnings)
<flokli> so you'd come up with the same binary modulo the rev?
<whitequark[cis]> the ihex file actually differs a lot, but I was looking at the map file
<whitequark[cis]> let me do a proper binary diff
<flokli> ok
<whitequark[cis]> it is not exactly identical but it is very close
<whitequark[cis]> there are a few single byte isolated differences because some offsets shift
<flokli> This is the "imperative build" with git available: https://gist.github.com/flokli/93226dafe355c6a77af7487b60df1885, sha1sum d292639a41e2f6e5ce69430fba8e192d447179ac
<whitequark[cis]> yeah I have the same sha1
<flokli> nice
<whitequark[cis]> for some reason I must've thought that $(shell) in make would fail the build
<whitequark[cis]> lemme fix that
<flokli> can we make the version string passed to the firmware overridable by a makefile arg?
<flokli> Then I could pass in the rev of the firmware/ dir from the derivation, and we should be bit-by-bit the same, with sdcc 4.5
<whitequark[cis]> yes, I will add that, fix the comment as you suggested, and submit a PR in a moment
<flokli> ty
<whitequark[cis]> also fix the silent failure which is pretty embarrassing
<flokli> ack
<_whitenotifier-8> [glasgow] whitequark opened pull request #978: firmware: make commit hash embedding more robust and explain it - https://github.com/GlasgowEmbedded/glasgow/pull/978
<whitequark[cis]> let me know if the comment sounds good. I tested explicit make GIT_REV_SHORT= locally and it works
<whitequark[cis]> I'm also still interested in the Nix firmware deployment, of course
figushki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<flokli> this looks good on first glance, I'll test a bit more
<flokli> I assume this PR would also need to update the firmware, as firmware/ now has a new commit id?
<whitequark[cis]> yes
<whitequark[cis]> I'll go ahead and do that
<_whitenotifier-8> [glasgow] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-978-27a68fc6a2fec37a22621d340c344990d06a4a3b - https://github.com/GlasgowEmbedded/glasgow
<whitequark[cis]> actually, maybe we should only do that after a switch to sdcc 4.5.0... let'
<whitequark[cis]> * 4.5.0... let's see what I can do
<flokli> I'll try to build with nix inside the derivation and sdcc 4.5.0
<_whitenotifier-8> [GlasgowEmbedded/glasgow] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±1] https://github.com/GlasgowEmbedded/glasgow/compare/27a68fc6a2fe...6318b55c0ecf
<_whitenotifier-8> [glasgow] whitequark closed pull request #978: firmware: make commit hash embedding more robust and explain it - https://github.com/GlasgowEmbedded/glasgow/pull/978
<_whitenotifier-8> [glasgow] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-978-27a68fc6a2fec37a22621d340c344990d06a4a3b - https://github.com/GlasgowEmbedded/glasgow
<whitequark[cis]> ok, so actually we can just use trixie if i use a base image like debian:trixie-20250721-slim@sha256:cc92da07b99dd5c078cb5583fdb4ba639c7c9c14eb78508a2be285ca67cc738a
<whitequark[cis]> i looked inside and it uses snapshot.debian.org to provide an immutable package index
<flokli> did you check upstream never does GC these?
<whitequark[cis]> yes
<flokli> ok
<whitequark[cis]> > The snapshot archive is a wayback machine that allows access to old packages based on dates and version numbers. It consists of all past and current packages the Debian archive provides.
<whitequark[cis]> they still have ones from 2009
<flokli> good
<flokli> https://gist.github.com/flokli/5ec6281bd9b2fb78924f098b02183d4c is the firmware built inside a pure nix derivation, using your PR.
<flokli> I explicitly set the git rev to 07f74307 from outside.
<flokli> sha1sum is d8c325cc1bb622aba0e390546c72a3ab1f7789bb
<whitequark[cis]> the file you posted doesn't match the sha1sum
<whitequark[cis]> also it doesn't have the git rev inside:
<whitequark[cis]> are you sure you attached the right one?>
<whitequark[cis]> s/?>/?/
<flokli> how do I convert .ihex to raw binaries?
<whitequark[cis]> objcopy --input-target=ihex --output-target=binary a.ihex a.bin
<whitequark[cis]> and the tool i'm using is "biodiff", it can align files with gaps with each other like a normal diff tool, but in binary
<flokli> ty
<_whitenotifier-8> [glasgow] whitequark opened pull request #979: Update to sdcc 4.5.0 - https://github.com/GlasgowEmbedded/glasgow/pull/979
<flokli> I shouldn't use gist.github.com is an object store.
<flokli> Can you send me a .bin or .ihex you built with sdcc 4.5, and/or the sha1sum?
<_whitenotifier-8> [glasgow] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-979-6318b55c0ecfdf64631e6afc9acfc9a8952141ea - https://github.com/GlasgowEmbedded/glasgow
<whitequark[cis]> sha1 8e8dc40ca3f81beb62e57369ba1ab60727a35185
<whitequark[cis]> this is at commit 6318b55c0ecfdf64631e6afc9acfc9a8952141ea
<flokli> nope, i have a different sha1
<flokli> wormhole receive 90-maverick-tumor
<whitequark[cis]> oh, it errored out on my end
<flokli> 6-adviser-ahead
<whitequark[cis]> try again
<_whitenotifier-8> [GlasgowEmbedded/glasgow] github-merge-queue[bot] pushed 2 commits to main [+0/-0/±2] https://github.com/GlasgowEmbedded/glasgow/compare/6318b55c0ecf...3e9c6b88cb71
<_whitenotifier-8> [GlasgowEmbedded/glasgow] whitequark 392a976 - firmware: use C23 to build (requires sdcc 4.5).
<_whitenotifier-8> [GlasgowEmbedded/glasgow] whitequark 3e9c6b8 - software: use today's trixie snapshot to build firmware.
<_whitenotifier-8> [glasgow] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-979-6318b55c0ecfdf64631e6afc9acfc9a8952141ea - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-8> [glasgow] whitequark closed pull request #979: Update to sdcc 4.5.0 - https://github.com/GlasgowEmbedded/glasgow/pull/979
<whitequark[cis]> these files produce bit for bit identical binaries
<whitequark[cis]> but for some reason, your .ihex is formatted differently
<whitequark[cis]> wormhole receive 6-millionaire-dwelling
<flokli> I probably have a different paper tape format
<whitequark[cis]> evidently so
<whitequark[cis]> can you give me your full sdcc version string?
<whitequark[cis]> SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/sm83/tlcs90/ez80_z80/z80n/r800/ds390/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15/mos6502/mos65c02/f8 TD- 4.5.0 #15242 (Linux)
<flokli> SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/sm83/tlcs90/ez80_z80/z80n/r800/ds390/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15/mos6502/mos65c02/f8 TD- 4.5.0 #15242 (Linux)
<whitequark[cis]> ok, so it's something in the environment
<whitequark[cis]> this is the most baffling shit. I would have never expected ihex formatting to do this
<flokli> TERM=, or my terminal size?
<whitequark[cis]> $ echo $TERM $COLUMNS
<whitequark[cis]> xterm-256color 108
<flokli> hold on, that's inside the nix build, I cannot flip things there easily
<whitequark[cis]> i tried changing COLUMNS and that didn't seem like it does anything
<whitequark[cis]> looks like yours is 43 wide max, and mine is 75 wide max
<flokli> I don't have enough context, but we cannot store and load raw binaries?
<whitequark[cis]> not easily
<whitequark[cis]> there are holes in the firmware image
<whitequark[cis]> it would be possible to rearrange the build process so that the firmware that's actually stored is a flat binary, but it's more work than figuring out why no earth it does this
<whitequark[cis]> in fact i'd rather add a python post-processing step to canonicalize the .ihex since that is like 1 line of code
<flokli> but this is wild, I agree
<whitequark[cis]> can you check if this line gets patched in nix?
<whitequark[cis]> hold on
<whitequark[cis]> no, nix has the correct amount of bytes per line
<whitequark[cis]> what version of sdld do you have?
<whitequark[cis]> sdld Linker V03.00/V05.40 + sdld
<flokli> sdld Linker V03.00/V05.40 + sdld
<flokli> it's part of the same store path, so using the same sources as other sdcc parts
figushki has joined #glasgow
* whitequark[cis] stares at sdld code
<whitequark[cis]> it's using a variable called "cksum" to track record size
<whitequark[cis]> and later it uses it to track a checksum
<whitequark[cis]> I am so fucking glad we no longer write code like that
<whitequark[cis]> you have libfx2 available, right? the python bits
<flokli> Yes
<whitequark[cis]> actually i can use something from sdcc
<whitequark[cis]> packihx
figushki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<whitequark[cis]> srec_cat isn't a aprt of sdcc
<flokli> Ah
<flokli> This manual page documents briefly the packihx command. (https://manpages.ubuntu.com/manpages/focal/man1/packihx.1.html )
<whitequark[cis]> lmao
<whitequark[cis]> `packihx firmware.ihex >normalized.ihex`
<flokli> Good good
<flokli> Does debian add it to $PATH as well?
<flokli> Then it should just work
<whitequark[cis]> yes
<whitequark[cis]> nope, doesn't work
<whitequark[cis]> it's not strongly normalizing
<whitequark[cis]> ok, this works for me:
<flokli> I went for a walk
<whitequark[cis]> sounds more pleasant than reading sdld source code
<flokli> But if it concerts both of our .ihex files to the same repr, and that still is valid ihex that can be loaded, shipit
<whitequark[cis]> it does yes
<flokli> <3
<_whitenotifier-8> [glasgow] whitequark opened pull request #980: Normalize firmware when deploying - https://github.com/GlasgowEmbedded/glasgow/pull/980
<whitequark[cis]> flokli: done
<_whitenotifier-8> [glasgow] whitequark synchronize pull request #980: Normalize firmware when deploying - https://github.com/GlasgowEmbedded/glasgow/pull/980
<_whitenotifier-8> [glasgow] whitequark synchronize pull request #980: Normalize firmware when deploying - https://github.com/GlasgowEmbedded/glasgow/pull/980
<whitequark[cis]> the normalize script is under firmware/ so i'll have to merge that in two parts
<flokli> Mm
<_whitenotifier-8> [glasgow] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-980-3e9c6b88cb71f6b5220eaa61aaf865f3570adcb0 - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-8> [glasgow] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-980-3e9c6b88cb71f6b5220eaa61aaf865f3570adcb0 - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-8> [glasgow] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-980-3e9c6b88cb71f6b5220eaa61aaf865f3570adcb0 - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-8> [GlasgowEmbedded/glasgow] github-merge-queue[bot] pushed 1 commit to main [+1/-0/±1] https://github.com/GlasgowEmbedded/glasgow/compare/3e9c6b88cb71...4fe35360e712
<_whitenotifier-8> [GlasgowEmbedded/glasgow] whitequark 4fe3536 - software: normalize firmware while deploying.
<_whitenotifier-8> [glasgow] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-980-3e9c6b88cb71f6b5220eaa61aaf865f3570adcb0 - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-8> [glasgow] whitequark closed pull request #980: Normalize firmware when deploying - https://github.com/GlasgowEmbedded/glasgow/pull/980
<whitequark[cis]> flokli: okay, if you deploy current HEAD you should get the same firmware file as i do
<_whitenotifier-8> [glasgow] whitequark opened pull request #981: software: deploy firmware - https://github.com/GlasgowEmbedded/glasgow/pull/981
<flokli> whitequark[cis]: ty! How come CI didn't complain about https://github.com/GlasgowEmbedded/glasgow/blob/main/software/glasgow/hardware/firmware.ihex diverging with what would be built?
<whitequark[cis]> the CI only does the comparison when you change software/glasgow/hardware/firmware.ihex
<whitequark[cis]> otherwise it would be impossible to check in any changes at all
<whitequark[cis]> (given the self-referential nature of firmware builds)
<flokli> Ah, that's how this is supposed to be read
<flokli> Ok
<whitequark[cis]> it also makes it possible to have in-tree changes to firmware that aren't automatically uploaded to everyone's device, which can be useful if you want to land a firmware change but still take a bit more time to test it
<whitequark[cis]> it's a bit of a double edged sword
<flokli> I'll update the packaging recipe when I'm back on the computer and check if it's the same (it should)
<whitequark[cis]> thanks!
<flokli> But I guess this means it's not a fully rolling distro, only the ones where the firmware is in sync may be packaged.
<_whitenotifier-8> [glasgow] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-981-4fe35360e71225a0ae7770a081d4c8e4259cc8e3 - https://github.com/GlasgowEmbedded/glasgow
<whitequark[cis]> this is correct and for this reason I believe this possibility should not be used
<whitequark[cis]> (i.e. every PR changing firmware should be immediately followed by a PR deploying it)
<flokli> Could merge commits that are not fast-forwarded help make this workflow less painful?
<whitequark[cis]> i don't use merge commits
figushki has joined #glasgow
<whitequark[cis]> they make history absolutely hellish to browse
<_whitenotifier-8> [glasgow] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-981-4fe35360e71225a0ae7770a081d4c8e4259cc8e3 - https://github.com/GlasgowEmbedded/glasgow
<flokli> Yeah, it's indeed a double-edged sword.
<whitequark[cis]> it's fairly often that i give an answer of "look in the git history and do the same" to various maintenance questions, and i would wish trying to decipher which of the 20 parallel timelines in gitk they should follow on nobody
<_whitenotifier-8> [glasgow] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-981-4fe35360e71225a0ae7770a081d4c8e4259cc8e3 - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-8> [GlasgowEmbedded/glasgow] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±1] https://github.com/GlasgowEmbedded/glasgow/compare/4fe35360e712...8a61053c7b7f
<_whitenotifier-8> [GlasgowEmbedded/glasgow] whitequark 8a61053 - software: deploy firmware.
<_whitenotifier-8> [glasgow] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-981-4fe35360e71225a0ae7770a081d4c8e4259cc8e3 - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-8> [glasgow] whitequark closed pull request #981: software: deploy firmware - https://github.com/GlasgowEmbedded/glasgow/pull/981
figushki has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
figushki has joined #glasgow
figushki has quit [Ping timeout: 248 seconds]
<flokli> whitequark[cis]: got the same firmware binary inside the nix build, updated the nixpkgs PR
<whitequark[cis]> perfect, thanks!
<whitequark[cis]> can you show me the output of glasgow --vesion on nixos?
<flokli> Glasgow 0.1.dev2611+g8a61053 (CPython 3.13.5 on
<flokli> Linux-6.15.7-asahi-aarch64-with-glibc2.40 NixOS 25.11
<flokli> (Xantusia)
<flokli> )
<flokli> (with that PR)
<whitequark[cis]> okay, that provides enough indication about the OS that i think additional info in version isn't needed
<whitequark[cis]> thanks! seems good to go from my pov
<tpw_rules> thought with both of you here, i think we can legally just always do version 0.1.0+g<hash> then we don't need extra nix maintenance to get the commits since root number
<flokli> You can assume everyone with NixOS in that string to not use the pdm build, as that one fails due to .so file pointing to non-existing paths.
<tpw_rules> sorry, version 0.1.dev0+g<hash>
<whitequark[cis]> to further debug the timeouts i would like to see a wireshark usb communication dump
<flokli> whitequark[cis]: I'll open the issue with what I have
<whitequark[cis]> tpw_rules: yeah i'm fine with nixos setting .devX to .dev0
<tpw_rules> thank you for your time as always
redstarcomrade has joined #glasgow
<whitequark[cis]> ^^
<tpw_rules> flokli: i have glasgow hardware if you need an additional review
<flokli> tpw_rules: gladly
<_whitenotifier-8> [glasgow] flokli opened issue #982: Unable to upgrade firmware from 2025-01-26 - https://github.com/GlasgowEmbedded/glasgow/issues/982
<flokli> ^ tpw_rules this should include enough instructions to attempt to reproduce
<_whitenotifier-8> [glasgow] flokli commented on pull request #958: Abstract out USB communication to enable a future WebUSB backend - https://github.com/GlasgowEmbedded/glasgow/pull/958#issuecomment-3127979325
<whitequark[cis]> if this is an issue with older firmware (which it seems to be) then there isn't much i can do
<flokli> whitequark[cis]: what do you mean? Updating firmware from API level 3 to 4 should work in general, no?
<whitequark[cis]> a bug in the old firmware could break the update process
<whitequark[cis]> I will probably not add workarounds for it unless it affects a lot of people
<flokli> next step is still package dump?
<whitequark[cis]> packet dump yes
<whitequark[cis]> it's like debugging a network problem
<flokli> attached a pcap below the log dump in https://github.com/GlasgowEmbedded/glasgow/issues/982
<flokli> Wasn't able to get a packet capture while the other output was logged, but I'll try again later.
<flokli> (the dump includes plugging in, so the firmware version running should also be in the dump)
<flokli> And it flashes current HEAD
<whitequark[cis]> thanks!
<flokli> and second dump (LIBUSB_ERROR_TIMEOUT one) attached too. It could be this only ever happened after the "first flash", without powercycle.
<flokli> But the first one happens consistently.
<flokli> and thanks for all the work so far <3
<whitequark[cis]> you're welcome!
adamgreig_ has quit [Server closed connection]
adamgreig_ has joined #glasgow
<_whitenotifier-8> [glasgow] flokli commented on issue #982: Unable to upgrade firmware from 2025-01-26 - https://github.com/GlasgowEmbedded/glasgow/issues/982#issuecomment-3128376406
<_whitenotifier-8> [glasgow] whitequark commented on issue #982: Unable to upgrade firmware from 2025-01-26 - https://github.com/GlasgowEmbedded/glasgow/issues/982#issuecomment-3128398630
<_whitenotifier-8> [glasgow] whitequark commented on issue #982: Unable to upgrade firmware from 2025-01-26 - https://github.com/GlasgowEmbedded/glasgow/issues/982#issuecomment-3128408044
figushki has joined #glasgow
Xesxen has quit [Server closed connection]
Xesxen has joined #glasgow
<_whitenotifier-8> [glasgow] flokli commented on issue #982: Unable to upgrade firmware from 2025-01-26 - https://github.com/GlasgowEmbedded/glasgow/issues/982#issuecomment-3128419834
<_whitenotifier-8> [glasgow] whitequark commented on issue #982: Unable to upgrade firmware from 2025-01-26 - https://github.com/GlasgowEmbedded/glasgow/issues/982#issuecomment-3128436103
<_whitenotifier-8> [glasgow] whitequark commented on issue #982: Unable to upgrade firmware from 2025-01-26 - https://github.com/GlasgowEmbedded/glasgow/issues/982#issuecomment-3128446274
<_whitenotifier-8> [glasgow] whitequark opened pull request #983: Fix USB timeout on firmware upload - https://github.com/GlasgowEmbedded/glasgow/pull/983
<_whitenotifier-8> [glasgow] whitequark commented on issue #982: Unable to upgrade firmware from 2025-01-26 - https://github.com/GlasgowEmbedded/glasgow/issues/982#issuecomment-3128453824
figushki has quit [Ping timeout: 248 seconds]
<whitequark[cis]> flokli: i got really sidetracked by the mentions of firmware versions and API levels and such, and also that you've mentioned that unflashed devices work fine
<flokli> whitequark[cis]: I didn't want to cause confusion, I was juggling a lot of things
<flokli> Where did I mention unflashed devices work fine?
<flokli> testing the PR
<whitequark[cis]> > I was only able to reproduce when having the older firmware present; running glasgow flash --remove-firmware with the new glasgow version was not sufficient.
<flokli> hmmh, then I must have thrown something together. I'm sorry if this threw you off the rails with debugging
<flokli> Thanks a ton!
<whitequark[cis]> alright, no worries
<whitequark[cis]> it's an important bug to catch and i'm grateful for your part here
<_whitenotifier-8> [glasgow] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-983-8a61053c7b7ff241c096eba68c6ab8fc0e0389f7 - https://github.com/GlasgowEmbedded/glasgow
<flokli> It was quite intense, but I'm very happy with the outcomes. This bug being fixed, reproducible firmwares, an updated nixpkgs expression, …
<whitequark[cis]> yeah, reproducible build improvements are always good, and i'm very pleased to see the expression fixed
<_whitenotifier-8> [GlasgowEmbedded/glasgow] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±1] https://github.com/GlasgowEmbedded/glasgow/compare/8a61053c7b7f...18442e9684cd
<_whitenotifier-8> [GlasgowEmbedded/glasgow] whitequark 18442e9 - hardware.device: fix firmware upload.
<_whitenotifier-8> [glasgow] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-983-8a61053c7b7ff241c096eba68c6ab8fc0e0389f7 - https://github.com/GlasgowEmbedded/glasgow
figushki has joined #glasgow
<_whitenotifier-8> [glasgow] whitequark closed issue #982: Unable to upgrade firmware from 2025-01-26 - https://github.com/GlasgowEmbedded/glasgow/issues/982
<_whitenotifier-8> [glasgow] whitequark closed pull request #983: Fix USB timeout on firmware upload - https://github.com/GlasgowEmbedded/glasgow/pull/983
Shiz has quit [Server closed connection]
Shiz has joined #glasgow
<whitequark[cis]> nice!
redstarcomrade has quit [Read error: Connection reset by peer]
redstarcomrade has joined #glasgow
redstarcomrade has quit [Changing host]
redstarcomrade has joined #glasgow
redstarcomrade has quit [Read error: Connection reset by peer]
figushki has quit [Ping timeout: 252 seconds]
redstarcomrade has joined #glasgow
redstarcomrade has joined #glasgow
redstarcomrade has quit [Read error: Connection reset by peer]
pie_ has quit []
figushki has joined #glasgow
figushki has quit [Client Quit]
redstarcomrade has joined #glasgow
mal has quit [Server closed connection]
mal has joined #glasgow