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

gnucash: 2.4.15 -> 3.1-1 #39616

Merged
merged 1 commit into from May 1, 2018
Merged

gnucash: 2.4.15 -> 3.1-1 #39616

merged 1 commit into from May 1, 2018

Conversation

mnacamura
Copy link
Contributor

@mnacamura mnacamura commented Apr 27, 2018

Motivation for this change

I would like to use GNU Cash with GTK3.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Things to be fixed

  • Google test fails with the following error messages:
/nix/store/05ckbdakp3jmrfymv44wzq1g0awdsdmw-gtest-1.8.0/lib/libgtest_main.a(gtest_main.cc.o): In function `main':
(.text.startup+0x21): undefined reference to `testing::InitGoogleTest(int*, char**)'
(.text.startup+0x26): undefined reference to `testing::UnitTest::GetInstance()'
(.text.startup+0x2e): undefined reference to `testing::UnitTest::Run()'
collect2: error: ld returned 1 exit status

This is fixed by adding export NIX_CFLAGS_LINK="-lgtest -lgtest_main" before checkPhase.

  • Pass all tests. For the moment 9/108 fail.
  • Cannot change settings in Edit > Preferences; fixed by adding dconf to propagatedUserEnvPkgs

Things that could be done in other PRs

  • Install python binding
  • Install documents/helps
  • Build with Ninja

@mnacamura
Copy link
Contributor Author

For those using GNU Cash 2.4.x, is it better to keep version 2.4.15 and create a new package of version 3.0?

@thufschmitt
Copy link
Member

Amazing, just as I wanted to try to update gnucash, I realise someone's already done it, thanks @mnacamura .

I tried building it, it only works if I add gettext to the buildInputs, otherwise it fails with the error

  CMake Error at CMakeLists.txt:262 (message):
    Note the build can be configured with an older version of gettext by
    setting ALLOW_OLD_GETTEXT=ON but then some files will not be translated:
            - gnucash.desktop (requires at least gettext 0.19)
            - gnucash.appdata.xml (requires at least gettext 0.19.6)
  -- Configuring incomplete, errors occurred!

@thufschmitt
Copy link
Member

The tests also seem to pass for me

@mnacamura
Copy link
Contributor Author

@regnat Thank you for reporting. Do you pass the tests even if you set doCheck = true; in default.nix?

@mnacamura mnacamura force-pushed the gnucash3 branch 2 times, most recently from 53e86b3 to 29f8d5e Compare April 30, 2018 07:53
@mnacamura mnacamura changed the title [WIP] gnucash: 2.4.15 -> 3.0 [WIP] gnucash: 2.4.15 -> 3.1 Apr 30, 2018
@mnacamura
Copy link
Contributor Author

Test results for the moment:

92% tests passed, 9 tests failed out of 108

Total Test time (real) =  23.44 sec

The following tests FAILED:
         61 - test-gnc-timezone (Failed)
         70 - test-load-c (Failed)
         71 - test-modsysver (Failed)
         72 - test-incompatdep (Failed)
         73 - test-agedver (Failed)
         77 - test-gnc-module-swigged-c (Failed)
         78 - test-gnc-module-load-deps (Failed)
         80 - test-gnc-module-scm-module (Failed)
         81 - test-gnc-module-scm-multi (Failed)

@mnacamura
Copy link
Contributor Author

Detailed results of the above 9 failed tests:

=== RUN test-gnc-timezone ===
Running main() from gtest_main.cc
[==========] Running 9 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 9 tests from gnc_timezone_constructors
[ RUN      ] gnc_timezone_constructors.test_default_constructor
[       OK ] gnc_timezone_constructors.test_default_constructor (0 ms)
[ RUN      ] gnc_timezone_constructors.test_pacific_time_constructor
/home/mnacamura/repos/nixpkgs/pkgs/applications/office/gnucash/gnucash-3.1/libgnucash/engine/test/gtest-gnc-timezone.cpp:54: Failure
Value of: tz->std_zone_abbrev() == "PST"
  Actual: false
Expected: true
/home/mnacamura/repos/nixpkgs/pkgs/applications/office/gnucash/gnucash-3.1/libgnucash/engine/test/gtest-gnc-timezone.cpp:55: Failure
Value of: tz->dst_zone_abbrev() == "PDT"
  Actual: false
Expected: true
/home/mnacamura/repos/nixpkgs/pkgs/applications/office/gnucash/gnucash-3.1/libgnucash/engine/test/gtest-gnc-timezone.cpp:57: Failure
      Expected: -8
To be equal to: tz->base_utc_offset().hours()
      Which is: 9
/home/mnacamura/repos/nixpkgs/pkgs/applications/office/gnucash/gnucash-3.1/libgnucash/engine/test/gtest-gnc-timezone.cpp:59: Failure
      Expected: -7
To be equal to: dst_offset.hours()
      Which is: 9
unknown file: Failure
C++ exception with description "Year is out of valid range: 1400..10000" thrown in the test body.
[  FAILED  ] gnc_timezone_constructors.test_pacific_time_constructor (0 ms)
[ RUN      ] gnc_timezone_constructors.test_posix_timezone
[       OK ] gnc_timezone_constructors.test_posix_timezone (0 ms)
[ RUN      ] gnc_timezone_constructors.test_gmt_timezone
[       OK ] gnc_timezone_constructors.test_gmt_timezone (0 ms)
[ RUN      ] gnc_timezone_constructors.test_GMT_plus_7_timezone
/home/mnacamura/repos/nixpkgs/pkgs/applications/office/gnucash/gnucash-3.1/libgnucash/engine/test/gtest-gnc-timezone.cpp:96: Failure
      Expected: tz->std_zone_abbrev()
      Which is: "JST"
To be equal to: "-07"

...

[  FAILED  ] gnc_timezone_constructors.test_IANA_Minsk_tz (5 ms)
[ RUN      ] gnc_timezone_constructors.test_bogus_time_constructor
[       OK ] gnc_timezone_constructors.test_bogus_time_constructor (0 ms)
[----------] 9 tests from gnc_timezone_constructors (24 ms total)

[----------] Global test environment tear-down
[==========] 9 tests from 1 test case ran. (24 ms total)
[  PASSED  ] 4 tests.
[  FAILED  ] 5 tests, listed below:
[  FAILED  ] gnc_timezone_constructors.test_pacific_time_constructor
[  FAILED  ] gnc_timezone_constructors.test_GMT_plus_7_timezone
[  FAILED  ] gnc_timezone_constructors.test_IANA_Belize_tz
[  FAILED  ] gnc_timezone_constructors.test_IANA_Perth_tz
[  FAILED  ] gnc_timezone_constructors.test_IANA_Minsk_tz

 5 FAILED TESTS

=== RUN test-load-c ===
<WARNING> (gnc.module) Could not locate module gnucash/foo interface v.0

=== RUN test-modsysver ===
  ok

=== RUN test-incompatdep ===
  ok

=== RUN test-agedver ===
<WARNING> (gnc.module) Could not locate module gnucash/agedver interface v.5
 failed

=== RUN test-gnc-module-swigged-c ===
./test.sh: line 6: ./bin/test-gnc-module-swigged-c: No such file or directory

=== RUN test-gnc-module-load-deps ===
./test.sh: line 6: ./bin/test-gnc-module-load-deps: No such file or directory

=== RUN test-gnc-module-scm-module ===
./test.sh: line 6: ./bin/test-gnc-module-scm-module: No such file or directory

=== RUN test-gnc-module-scm-multi ===
./test.sh: line 6: ./bin/test-gnc-module-scm-multi: No such file or directory

@mnacamura
Copy link
Contributor Author

Although some tests fail, the built binary works fine for me. So, I would like to disable test for now and wait for review.

@mnacamura mnacamura changed the title [WIP] gnucash: 2.4.15 -> 3.1 gnucash: 2.4.15 -> 3.1 Apr 30, 2018
@mnacamura mnacamura changed the title gnucash: 2.4.15 -> 3.1 gnucash: 2.4.15 -> 3.1-1 May 1, 2018
@thufschmitt
Copy link
Member

My bad for the tests, I though doCheck = true was the default so I just commented out the line. It indeed fails with doCheck = true.

I agree that this shouldn't block the merge as the tool itself runs fine

@matthewbauer matthewbauer merged commit 83f035c into NixOS:master May 1, 2018
@mnacamura mnacamura deleted the gnucash3 branch May 2, 2018 08:37
@emmanuelrosa
Copy link
Contributor

This is causing a problem because the proper GNUCash upgrade procedure is to open the data files in each major version:

Can a new GnuCash release still read my old data file?

A: The answer depends on how much forward you want to go. See Development_Process#Release_Version_Numbering for an explanation of the GnuCash Release Version Numbering system...

Major releases 
    The data format between major release can change. However, the GnuCash developers try very hard to be as compatible as possible. Each major series is normally at least compatible with the previous major series. So if you have a data file created with GnuCash 2.0.3, you should be able to open this with for example 2.2.5. Skipping a major release may cause issues though.

    You can skip major releases by doing the conversion in two steps. Suppose you want to jump from version 1.8.12 to 2.2.9. To do so, you should first open the file with a GnuCash 2.0.x release, save it from within 2.0.x and then open the saved file in 2.2.9. See https://wiki.gnucash.org/wiki/FAQ#Using_Different_Versions.2C_Up_And_Downgrade

This change causes a skip in major releases: 2.4 -> 3.1. I understand skipping 2.6 since reporting didn't work, but now that webkitgtk-2.4 doesn't build the upgrade process is broken. For example, in my case, I no longer have access to the accounts hierarchy/tree when I open 2.4 files with 3.1.


checking for XDAMAGE... no
configure: error: Package requirements (xdamage) were not met:

No package 'xdamage' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables XDAMAGE_CFLAGS
and XDAMAGE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
builder for '/nix/store/5imz7h7n315hc0xv41rhd096hcwmgfm3-webkitgtk-2.4.11.drv' failed with exit code 1
cannot build derivation '/nix/store/683gkwijs7nmzv5k7xsiziqgvnffjvax-gnucash-2.6.18-1.drv': 1 dependencies couldn't be built
error: build of '/nix/store/683gkwijs7nmzv5k7xsiziqgvnffjvax-gnucash-2.6.18-1.drv' failed

@mnacamura
Copy link
Contributor Author

What if open your file with gnucash26 and then with gnucash? webkitgtk-2.4 may be whitelisted by adding the following snippet to ~/.config/nixpkgs/config.nix:

permittedInsecurePackages = [
         "webkitgtk-2.4.11"
       ];

@emmanuelrosa emmanuelrosa mentioned this pull request May 8, 2018
6 tasks
@emmanuelrosa
Copy link
Contributor

That's what I tried, and is the correct upgrade path. But right now it's not possible because webkitgtk-2.4.11, a dependency of gnucash 2.6, doesn't build due to missing xdamage.

@emmanuelrosa
Copy link
Contributor

Assuming gnucash 3 will be the default, the NixOS release notes need to be updated to inform users of the upgrade instructions; Which of course means 2.6 needs to stick around (and be functional) for the Jackrabbit release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants