Skip to content

Instantly share code, notes, and snippets.

@ms-ati
Last active May 8, 2018 20:18
Show Gist options
  • Save ms-ati/aaafdf091e1b04c4621aeec18cbfab4c to your computer and use it in GitHub Desktop.
Save ms-ati/aaafdf091e1b04c4621aeec18cbfab4c to your computer and use it in GitHub Desktop.
Note on resolving nanosecond timestamp issues in Dinghy
  1. Reviewed How To Open a Homebrew Pull Request

    a. Forked codekitchen/homebrew-dinghy on Github to ms-ati/homebrew-dinghy

    b. Changed to directory containing the Dinghy tap: cd $(brew --repository codekitchen/dinghy)

    c. Added my fork as a remote: git remote add ms-ati https://github.com/ms-ati/homebrew-dinghy.git

    d. Checked out the master branch: git checkout master

    e. Created new branch: git checkout -b use-unfs3-branch-higher-resolution-setattr

    f. See my branch here on github

  2. Edited formula to depend on @derfian branch of unfs3: brew edit unfs3

    a. Added devel block to use the new branch:

    ```ruby
    devel do
      url "https://github.com/derfian/unfs3.git", :branch => "higher-resolution-setattr"
      version "0.9.23-pre"
    
      depends_on "autoconf" => :build
      depends_on "automake" => :build
    end
    ```
    

    b. Committed changes and pushed the commits to my remote branch: git push ms-ati use-unfs3-branch-higher-resolution-setattr

    c. Tested the changes per the instructions:

    - `brew tests`
    - `brew uninstall --ignore-dependencies unfs3`
    - `brew install --build-from-source --devel --verbose --debug unfs3`
    - `brew test unfs3` <-- "Error: codekitchen/dinghy/unfs3 defines no test"
    - `brew audit --strict unfs3`
    

    d. Verify that Homebrew thinks the new version is installed:

    $ brew info unfs3
    codekitchen/dinghy/unfs3: stable 0.9.22, devel 0.9.23-pre, HEAD
    User-space NFSv3 server
    http://unfs3.sourceforge.net
    /usr/local/Cellar/unfs3/0.9.23-pre (8 files, 129KB) *
      Built from source on 2018-05-07 at 12:44:11
    From: https://github.com/codekitchen/homebrew-dinghy/blob/master/Formula/unfs3.rb
    ==> Options
    --devel
    	       Install development version 0.9.23-pre
    --HEAD
    	       Install HEAD version

    d. Restarted Dinghy to pick up the new changes: dinghy down; dinghy up

    e. Reviewed system calls made by unfsd (need to come back to this after other changes done)

    ```bash
    sudo dtruss -n unfsd
    ...
    ```
    

    f. Observed that edited files still having timestamps set to zero-nanoseconds:

    ```bash
    $ brew install coreutils
    $ gls --full-time ~/Desktop/NOTES.md
    
    -rw-r--r-- 1 marcsiegel staff 2297 2018-05-07 14:00:34.000000000 -0400 /Users/marcsiegel/Desktop/NOTES.md
                                                           ^^^^^^^^^
    ```
    
  3. Modify Dinghy to support the nanosecond timestamps

    a. Fork codekitchen/dinghy on Github to ms-ati/dinghy

    b. Create branch git checkout -b support-nanosecond-timestamps-on-apfs

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