-
Notifications
You must be signed in to change notification settings - Fork 181
build: add Flatpak manifest file #2724
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
base: development
Are you sure you want to change the base?
build: add Flatpak manifest file #2724
Conversation
Since $SECOND is undefined in POSIX sh, changed the shell in shebang from sh to bash.
Actually, IIRC correctly, we already have code in the app handling the special Flatpack data directory scenario for BOINC in boinc.cpp, but not for the main data directory. We have an existing issue that is the inverse of choice 2, which is here.... #2650. The issue is that if both the native and flatpack BOINC are installed, the Gridcoin app defaults to the native version of BOINC. Since we need to straighten out flatpack handling anyway, I strongly advocate choice 3. We should have some discussion here about what that would look like. |
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'm all for following the XDG specification but Flatpak's default XDG_*_HOME
variables are set to application specific ~/.var/app/us.gridcoin.Gridcoin-Research/...
which means a native installation and a Flatpak installation would have differing data directories. Flatpak advocates this but I'm not exactly sold on that. I think having a unified datadir is better UX overall.
P.S. @ikolomiko Are there any guidelines on publishing to the FlatHub? Like for example if we allow accessing $HOME
would that disqualify the app from getting published?
@div72 A general guideline can be found here. About the filesystem access for unified config data, there's a special section in the Flathub requirements guide which strictly discourages that. While I'm not sure if it disqualifies the app from getting published on Flathub, it certainly is not the expected behavior of a Flatpak app. |
I think we need to live with the XDG spec. Do we need to modify the existing FlatPack handling code? |
The linter is barking again.... :) |
Apparently the web editor of GitHub inserts CRLF line endings to commit messages, causing the linter to go crazy, lol. Gotta rewrite the commit messages locally. |
Surround the repo_root variable with double quotes Co-authored-by: div72 <[email protected]>
Co-authored-by: div72 <[email protected]>
Run autogen.sh Co-authored-by: div72 <[email protected]>
- Add the flathub.org remote if it doesn't exist - Download required SDK and runtimes if not downloaded - Display the path of the created bundle with the command to install it
28be580
to
5471231
Compare
That is crazy that the Github editor is following the Windows line ending standard... |
Made a bunch of additions to the manifest for some permissions. AFAICT, the only missing piece is setting the default value of |
If mandatory sidestakes that have non-zero allocation are set OR local sidestakes with non-zero allocations are set and the -enablesidestaking flag is turned on, then set fEnableSideStaking in the miner to true to include sidestakes. This replaces the old logic of fEnableSideStaking, which simply followed -enablestidestaking.
Also add validation for this in Validator.
This is to support fraction based arithmetic. Currently this is used in sidestake allocations as a replacement for the double type calculations to eliminate consensus problems in mandatory sidestakes due to floating point arithmetic.
Remove error banding in mandatory sidestake validation.
This suppresses the percent sign for editing and prevents a silent rejection due to inclusion of the percent sign in the saved field.
…ages Not all errors are where claimed aomount is greater than calculated. With MRC and mandatory sidestakes, number and destination of outputs are also checked.
Also update copyright year to 2024 for applicable files.
Creating a new sidestake entry would result in a percentage of zero, which would have to be edited to the correct value. The entered value is properly handled with this commit.
This makes fraction addition more resistant to overflows.
This uses the "cross" gcds to do cancellation and increase resistance of overflows for things like (1000 / 999) * (999 / 1000).
b8239b0
to
17ac826
Compare
I've created an initial Flatpak manifest file and a script to create a local Flatpak bundle. The permissions are pretty much bare-bones at this point. Since the manifest doesn't give read/write permissions for the
$HOME
directory, the application fails to start after the initial setup done by the wizard. There are 3 ways to overcome this issue:datadir
to some predefined and sandboxed directory, just like how Bitcoin-Core handles this issue. This solution is pretty seamless and secure. However, it restricts the user from choosing another directory, and feels like a dirty hack.$HOME
directory. This approach requires the least effort. However, it violates the sandboxing Flatpak provides, and might cause conflicts if there's also a native version of Gridcoin installed besides the Flatpak version.datadir
, instead of using the~/.GridcoinResearch
directory. Following the XDG specifications is considered the best practice on Linux in general, both for Flatpak applications and for other package managers. However, this would require some modification in the codebase.