-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add support for external dir hasher #575
base: main
Are you sure you want to change the base?
Conversation
28c71c0
to
1d6a972
Compare
Allows providing hash-cmd. Protocol is that cmd will be executed and output will be used to calculate dir checksum. If program fails - it falls back to rebuilding.
@alexlarsson Mind to have a look? Seems like you said that checksumming dir was "not possible". Not sure what you meant. |
Can you give some real world examples of hash commands for an entire directory? Also it is very common that a project uses a flatpak build dir inside of the same directory, which is impossible to say nothing changes, so maybe there should be a check for that. |
I have most current experience with both Rust and Go. For both "a project uses a flatpak build dir inside of the same directory" is NOT an issue because they have either a very strict standard layout or mostly people adhere to best practices. Thus the real world example for e.g. Golang would be: build-options:
env:
GOBIN: /app/bin
GOROOT: /usr/lib/sdk/golang
modules:
- name: foo
buildsystem: simple
sources:
- type: dir
path: .
hash-cmd: [go run ./cmd/dirhash cmd internal go.mod go.sum]
build-commands: [
"$GOROOT/bin/go build -C ./cmd/app -o foo",
"install -Dm00755 gadget-app $FLATPAK_DEST/bin/foo",
]
|
The general question though is whether it would not be better to have a hash for every build-command... |
I don't think it should be per build-command. It is a departure from how f-b operates. Build commands aren't necessarily reproducible. |
Allows providing hash-cmd.
Protocol is that cmd will be executed and output will be used to calculate
dir checksum.
If program fails - it falls back to rebuilding.