1. 02 Jul, 2020 9 commits
    • Dridi Boukelmoune's avatar
      Split the monolithic VCL symbol table · 6c5d9ae0
      Dridi Boukelmoune authored
      This introduces two namespaces MAIN and TYPE to allow top-level symbol
      collisions for type methods.
      
      For example, `backend` is a reserved keyword but `backend.resolve` is a
      type method. It is impossible to declare such a method symbol because it
      would require its parent `backend` symbol to be a type symbol.
      
      There would be a conflict between two `backend` symbols of different
      kinds. The same would apply if the BLOB type had methods and vmod_blob
      was imported.
      
      At this point only the MAIN namespace is used but the split enables the
      symbolization of types and type methods down the line.
      6c5d9ae0
    • Dridi Boukelmoune's avatar
      Remove type method and property definitions from vcc_expr · 96edbd29
      Dridi Boukelmoune authored
      This is a first step towards making expression parsing more agnostic and
      type methods more prevalent.
      96edbd29
    • Dridi Boukelmoune's avatar
      Inline type methods definitions · a971e6c3
      Dridi Boukelmoune authored
      a971e6c3
    • Dridi Boukelmoune's avatar
      Add a list of methods to type definitions · 7d27ba04
      Dridi Boukelmoune authored
      For now, this is a copy of struct vcc_methods used in expression parsing
      and the list includes type properties as well.
      7d27ba04
    • Dridi Boukelmoune's avatar
      Create VMOD object instance symbols like the rest · 3d137152
      Dridi Boukelmoune authored
      Some assertions or expectations needed to loosen to accomodate $OBJ,
      $FUNC and $METHOD entries under the same roof. There is a SYM_METHOD
      symbol kind that is currently not used, and shouldn't be until VMOD
      methods are per-object symbols instead of per-instance.
      
      Once we reach that point, it becomes possible to simplify further and
      move more things in the func_sym() function.
      3d137152
    • Dridi Boukelmoune's avatar
      1a22c944
    • Dridi Boukelmoune's avatar
      Don't register VMOD symbols as wildcards · d6a0f6f0
      Dridi Boukelmoune authored
      Instead, register all the functions and object constructors at import
      time.
      d6a0f6f0
    • Dridi Boukelmoune's avatar
      build: Query clang from the $PATH · 456c12b3
      Dridi Boukelmoune authored
      It might not be installed as /usr/bin/clang, and there's a mismatch
      anyway between the check and the outcome.
      
      For example on my system's $PATH clang is currently driven by ccache
      is available at /usr/lib64/ccache/clang.
      456c12b3
    • Dridi Boukelmoune's avatar
      build: Facilitate VPATH bootstraps · 1d33f3ff
      Dridi Boukelmoune authored
      In order to bootstrap a $(builddir) outside of $(srcdir) until now the
      first step needed was to populate the environment. If for example one
      wants to work from a build/ sub-directory the shortest autogen.des
      invocation would look like:
      
          SRCDIR=.. ../autogen.des [configure options...]
      
      Since we can infer $(srcdir) from autogen.des' relative path, it is now
      possible to simply do this:
      
          ../autogen.des [configure options...]
      
      It is still possible to provide a specific SRCDIR, even to a different
      directory but the default should now work out of the box.
      1d33f3ff
  2. 01 Jul, 2020 1 commit
    • Dridi Boukelmoune's avatar
      build: Enable automake's subdir-objects option · 630817e4
      Dridi Boukelmoune authored
      We can get rid of autogen.des' egrep command used to silence this
      warning too. In fact we can even remove the subshell and simply
      call autoreconf directly. The problem with egrep is the loss of
      a meaningful exit status for the autoreconf invocation.
      
      I also enabled autoreconf's verbose output.
      630817e4
  3. 30 Jun, 2020 1 commit
  4. 29 Jun, 2020 1 commit
    • Dridi Boukelmoune's avatar
      build: Rename VMOD sources to avoid collisions · 7cd4c242
      Dridi Boukelmoune authored
      Instead of calling all VCC files vmod.vcc they were renamed to
      vmod_foo.vcc and instead of generating vcc_if.[ch] we do the same
      thing with vcc_foo_if.[ch].
      
      This a manual mechanical change that will then be picked up by
      vmodtool's automake boilerplate generator.
      
      Better diff with the --word-diff --word-diff-regex=. options.
      7cd4c242
  5. 24 Jun, 2020 1 commit
  6. 23 Jun, 2020 2 commits
  7. 18 Jun, 2020 3 commits
  8. 16 Jun, 2020 3 commits
    • Dridi Boukelmoune's avatar
      Revert "Revert "Only build manual pages in maintainer mode"" · 970c59ed
      Dridi Boukelmoune authored
      This brings back commit cc42bd31:
      
      When we release a dist archive, it comes with the documentation but
      since some of it is generated by programs it makes no real difference,
      and actually it makes things worse: rebuilding from the dist archive
      ends up with a rebuild of the documentation because some documentation
      sources ended up being rebuilt. In other words, the documentation we
      ship is dead weight in the dist archive and doesn't reduce the number
      of build dependencies downstream.
      
      From now on, rst2man remains mandatory to build our manual pages but
      can safely be omitted by packaging scripts.
      970c59ed
    • Dridi Boukelmoune's avatar
      Enable maintainer mode after autogen.sh · e33d0cf1
      Dridi Boukelmoune authored
      As documented in autogen.des, this is what we should use for development
      and it should encompass continuous integration. Until autogen.sh goes
      away we need to explicitly enable maintainer mode at configure time.
      
      Two thirds of our CI setup rely on autogen.des today.
      
      Better diff with the --word-diff option.
      e33d0cf1
    • Dridi Boukelmoune's avatar
      Firm retirement of autogen.sh · 9b9a955f
      Dridi Boukelmoune authored
      The script remains until its refcount drops to zero.
      
      Refs 0b4a90c0
      9b9a955f
  9. 15 Jun, 2020 4 commits
  10. 14 Jun, 2020 2 commits
  11. 12 Jun, 2020 7 commits
    • Dridi Boukelmoune's avatar
      New VRE_quote() function · c82e3aba
      Dridi Boukelmoune authored
      This is a tool for VMOD authors for the use case of building a regular
      expression partially from arbitrary input, where the input is intended
      for an exact match.
      
      For example, one could implement a dispatch feature depending on the
      request's host header, building something like:
      
          "\.?\Q" + req.http.host + "\E$"
      
      A malicious client could however hijack the regular expression with a
      \E sequence in the host header. To get safely to this result you can
      do this instead in pseudo-code before compiling the regex:
      
          VSB_cat(vsb, "\\.?");
          VRE_quote(vsb, req.http.host);
          VSB_putc(vsb, '$');
      
      The input is enclosed with PCRE's \Q and \E escape sequences, ensuring
      that \E sequences in the input string don't allow Little Bobby Tables'
      cousin to mess with your regular expressions.
      c82e3aba
    • Martin Blix Grydeland's avatar
      Allow EXP_Remove() to be called before EXP_Insert() · 611a48e3
      Martin Blix Grydeland authored
      Once HSH_Unbusy() has been called there is a possibility for
      EXP_Remove() to be called before the fetch thread has had a chance to call
      EXP_Insert(). By adding a OC_EF_NEW flag on the objects during
      HSH_Unbusy(), that is removed again during EXP_Insert(), we can keep track
      and clean up once EXP_Insert() is called by the inserting thread if
      EXP_Remove() was called in the mean time.
      
      This patch also removes the AZ(OC_F_DYING) in EXP_Insert(), as that is no
      longer a requirement.
      
      Fixes: #2999
      611a48e3
    • Martin Blix Grydeland's avatar
      Execute EXP_Insert after unbusy in HSH_Insert · 68e262a7
      Martin Blix Grydeland authored
      This makes the order of events the same as on real cache insertions.
      68e262a7
    • Martin Blix Grydeland's avatar
      Repurpose OC_EF_REFD flag slightly · 7050ccee
      Martin Blix Grydeland authored
      The OC_EF_REFD flag indicates whether expiry has a ref on the
      OC. Previously, the flag was only gained during the call to
      EXP_Insert. With this patch, and the helper function EXP_RefNewObjcore(),
      the flag is gained while holding the objhead mutex during
      HSH_Unbusy(). This enables the expiry functions to test on missing
      OC_EF_REFD and quickly return without having to take the main expiry
      mutex.
      7050ccee
    • Martin Blix Grydeland's avatar
      Only count exp_mailed events when actually posting · 9210cd77
      Martin Blix Grydeland authored
      When posting to the expiry thread, we wrongly counted exp_mailed also if
      the OC in question was already on the mail queue. This could cause a
      discrepency between the exp_mailed and exp_received counters.
      9210cd77
    • Martin Blix Grydeland's avatar
      Move the locking calls outside exp_mail_it · 1638ff0a
      Martin Blix Grydeland authored
      This enables doing extra handling while holding the mutex specific to
      EXP_Insert/EXP_Remove before/after calling exp_mail_it.
      1638ff0a
    • Dridi Boukelmoune's avatar
      319ed9f6
  12. 11 Jun, 2020 4 commits
    • Dridi Boukelmoune's avatar
      Revert "Only build manual pages in maintainer mode" · be1191ea
      Dridi Boukelmoune authored
      This reverts commit cc42bd31.
      
      For some reason Travis CI jobs use autogen.sh and don't build with all
      the bells and whistles we expect developers to work with. Despite the
      explicit mention in autogen.des:
      
          # Use this when doing code development
      
      Some of our continuous integration doesn't emulate this properly. At
      least on the VTEST and CircleCI sides we do things as expected. I will
      reintroduce this change later when Travis CI is ready to take it.
      be1191ea
    • Dridi Boukelmoune's avatar
      Soft retirement of autogen.sh · 0b4a90c0
      Dridi Boukelmoune authored
      We shouldn't need to care about all the details when autoreconf(1) can
      do that for us. The autoworld has changed over the last decade and this
      only affects Varnish developers since we ship release archives with a
      turnkey configure script. So let's see how much wreckage this change will
      cause.
      
      The script remains until its refcount drops to zero.
      
      In order to get early feedback for MacOS the relevant Travis CI job is
      already updated.
      0b4a90c0
    • Dridi Boukelmoune's avatar
      Only build manual pages in maintainer mode · cc42bd31
      Dridi Boukelmoune authored
      When we release a dist archive, it comes with the documentation but
      since some of it is generated by programs we end up it makes no real
      difference, and actually it makes things worse: rebuilding from the
      dist archive ends up with a rebuild of the documentation because some
      sources ended up being rebuilt. In other words, the documentation we
      ship is dead weight in the dist archive and doesn't reduce the number
      of build dependencies downstream.
      
      From now on, rst2man remains mandatory to build our manual pages but
      can safely be omitted by packaging scripts.
      cc42bd31
    • Nils Goroll's avatar
      Add the debugging aid to Assert Curses return codes · 6744a693
      Nils Goroll authored
      taken from varnishtop. NOOP because #if 0'd
      6744a693
  13. 10 Jun, 2020 2 commits