[CDRIVER-1865] Test Debian and Fedora packages in Evergreen Created: 18/Oct/16  Updated: 25/Nov/18  Resolved: 25/Nov/18

Status: Closed
Project: C Driver
Component/s: Build, debian, packaging
Affects Version/s: None
Fix Version/s: 1.13.0, 1.14.0

Type: New Feature Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: Roberto Sanchez
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on CDRIVER-1864 Debian and Fedora package build in Ev... Closed
depends on CDRIVER-2514 Produce Debian packages from CMake build Closed
Epic Link: CDRIVER-packaging

 Description   

Try installing the Debian and Fedora packages into a host and compiling a trivial application, to ensure all needed headers, libraries, and package dependencies are installed by the libbson and libmongoc packages.



 Comments   
Comment by Githook User [ 25/Nov/18 ]

Author:

{'name': 'Roberto C. Sánchez', 'email': 'roberto@connexer.com', 'username': 'rcsanchez97'}

Message: CDRIVER-1864, CDRIVER-1865 implement RPM package build in Evergeen
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/c14591390895bd31cc91a141a9bf294092e6731a

Comment by Githook User [ 08/Sep/18 ]

Author:

{'name': 'Roberto C. Sánchez', 'email': 'roberto@connexer.com', 'username': 'rcsanchez97'}

Message: CDRIVER-1864, CDRIVER-1865 fix Debian package build in Evergreen, 2
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/18f442994e1e6d154d54cd0d0e6c7b8a88789464

Comment by Githook User [ 27/Aug/18 ]

Author:

{'name': 'Roberto C. Sánchez', 'email': 'roberto@connexer.com', 'username': 'rcsanchez97'}

Message: CDRIVER-1864, CDRIVER-1865 fix Debian package build in Evergreen
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/4a7f94260556448c640aded4ed37a5bfe70a8514

Comment by Githook User [ 24/Aug/18 ]

Author:

{'name': 'Roberto C. Sánchez', 'email': 'roberto@connexer.com', 'username': 'rcsanchez97'}

Message: CDRIVER-1864, CDRIVER-1865 build and test Debian packages in Evergreen
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/d03b5a1c7cd3f4d4eaa1e3141cdfadaeea8d0892

Comment by A. Jesse Jiryu Davis [ 26/Oct/16 ]

I think we should add a file, either in examples/ for users' sake, or somewhere else just for testing's sake, with contents like:

/* gcc example-client-ssl.c -o example-client-ssl $(pkg-config --cflags --libs libmongoc-1.0) */
 
/* ./example-client-ssl [CONNECTION_STRING [PEM_FILE_PATH]] */
 
#include <mongoc.h>
#include <stdio.h>
#include <stdlib.h>
 
int
main (int   argc,
      char *argv[])
{
   const char *uristr = "mongodb://127.0.0.1/?appname=client-example";
   mongoc_client_t *client;
   const mongoc_ssl_opt_t *ssl_default;
   mongoc_ssl_opt_t ssl_opts;
   bson_error_t error;
   bson_t cmd = BSON_INITIALIZER;
   bson_t reply;
   bool r;
   char *str;
 
   mongoc_init ();
 
   if (argc > 1) {
      uristr = argv[1];
   }
 
   client = mongoc_client_new (uristr);
   if (!client) {
      fprintf (stderr, "Failed to parse URI.\n");
      return EXIT_FAILURE;
   }
 
   mongoc_client_set_error_api (client, 2);
 
   ssl_default = mongoc_ssl_opt_get_default ();
   memcpy (&ssl_opts, ssl_default, sizeof ssl_opts);
 
   if (argc > 2) {
      ssl_opts.pem_file = argv[2];
   } else {
      ssl_opts.pem_file = "client.pem";
   }
 
   mongoc_client_set_ssl_opts (client, &ssl_opts);
 
   BSON_APPEND_INT32 (&cmd, "ping", 1);
   r = mongoc_client_command_simple (client, "admin", &cmd, NULL, &reply,
                                     &error);
 
   if (!r) {
      fprintf (stderr, "%s\n", error.message);
      return EXIT_FAILURE;
   }
 
   str = bson_as_json (&reply, NULL);
   printf ("%s\n", str);
 
   bson_free (str);
   bson_destroy (&reply);
   bson_destroy (&cmd);
   mongoc_client_destroy (client);
 
   mongoc_cleanup ();
 
   return EXIT_SUCCESS;
}

Then we'll build all the debs (CDRIVER-1864) from the latest code on master and install the following subset of them in a build environment:

libbson-1.0-0_X.Y.Z-1_amd64.deb
libbson-dev_X.Y.Z-1_amd64.deb
libmongoc-1.0-0_X.Y.Z-1_amd64.deb
libmongoc-dev_X.Y.Z-1_amd64.deb

Then assert we can compile example-client-ssl like this:

gcc example-client-ssl.c -o example-client $(pkg-config --cflags --libs libmongoc-1.0)

Generated at Wed Feb 07 21:13:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.