Skip to content

fix(fsevents): restore compat with older mac#5431

Merged
rgrinberg merged 1 commit intomainfrom
ps/rr/fix_fsevents___restore_compat_with_older_mac
Feb 14, 2022
Merged

fix(fsevents): restore compat with older mac#5431
rgrinberg merged 1 commit intomainfrom
ps/rr/fix_fsevents___restore_compat_with_older_mac

Conversation

@rgrinberg
Copy link
Copy Markdown
Member

kFSEventStreamEventFlagItemCloned is introduced in 10.13

@anmonteiro could you test this?

@anmonteiro
Copy link
Copy Markdown
Collaborator

There are still 2 errors:

       last 10 log lines:
       > Done: 160/882 (jobs: 3)cd _boot && /nix/store/x61303mcd0bgd4bbfy6q2fy20w85qcx9-ocaml+flambda-4.13.1/bin/ocamlopt.opt -c -g -I +threads fsevents_stubs.c
       > clang-11: warning: argument unused during compilation: '-fno-strict-overflow' [-Wunused-command-line-argument]
       > src/fsevents/fsevents_stubs.c:91:39: error: use of undeclared identifier 'kFSEventStreamEventExtendedDataPathKey'
       >         CFDictionaryGetValue(details, kFSEventStreamEventExtendedDataPathKey);
       >                                       ^
       > src/fsevents/fsevents_stubs.c:152:7: error: use of undeclared identifier 'kFSEventStreamCreateFlagUseExtendedData'
       >       kFSEventStreamCreateFlagUseExtendedData |
       >       ^
       > 2 errors generated.
       > make: *** [Makefile:48: dune.exe] Error 2```

@rgrinberg rgrinberg force-pushed the ps/rr/fix_fsevents___restore_compat_with_older_mac branch from 94cdddb to a4e8220 Compare February 13, 2022 21:54
@rgrinberg
Copy link
Copy Markdown
Member Author

Thanks. I fixed those errors as well. Unfortunately this means that the native watch mode will not work pre 10.13.

@rgrinberg rgrinberg requested a review from nojb February 13, 2022 21:55
@anmonteiro
Copy link
Copy Markdown
Collaborator

I can confirm this now fixes the macOS build failures I was seeing.

Copy link
Copy Markdown
Collaborator

@nojb nojb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Another possibility is to just #ifdef the whole file with __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300 and make all primitives fail if that condition is not satisfied.

@rgrinberg rgrinberg force-pushed the ps/rr/fix_fsevents___restore_compat_with_older_mac branch from a4e8220 to 41c8d5c Compare February 14, 2022 17:20
@rgrinberg
Copy link
Copy Markdown
Member Author

LGTM. Another possibility is to just #ifdef the whole file with __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300 and make all primitives fail if that condition is not satisfied.

Good point. Pushed a commit to do this.

@rgrinberg rgrinberg force-pushed the ps/rr/fix_fsevents___restore_compat_with_older_mac branch 2 times, most recently from 0c6aa76 to 4e9258f Compare February 14, 2022 19:35
but watch mode will require 10.13

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

ps-id: 0464F4D3-C810-4A28-9EF3-2927AD5E895A
@rgrinberg rgrinberg force-pushed the ps/rr/fix_fsevents___restore_compat_with_older_mac branch from 4e9258f to 01192fd Compare February 14, 2022 21:34
@rgrinberg rgrinberg merged commit 01192fd into main Feb 14, 2022
@rgrinberg rgrinberg deleted the ps/rr/fix_fsevents___restore_compat_with_older_mac branch February 14, 2022 21:34
@rgrinberg rgrinberg linked an issue Feb 14, 2022 that may be closed by this pull request
rgrinberg added a commit to rgrinberg/opam-repository that referenced this pull request Feb 17, 2022
…e-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info and dune-action-plugin (3.0.1)

CHANGES:

- Fix compilation on MacOS SDK < 10.13. The native watch mode is disabled in
  such instances (ocaml/dune#5431 fix ocaml/dune#5430, @rgrinberg)

- Do no add workspace_root to `BUILD_PATH_PREFIX_MAP` for projects before 3.0
  (5448, @rgrinberg)

- Fix performance regression in incremental builds (ocaml/dune#5439, @snowleopard)
@barracuda156
Copy link
Copy Markdown
Contributor

@anmonteiro This does not suffice:

--->  Building ocaml-dune
Executing:  cd "/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_ocaml_ocaml-dune/ocaml-dune/work/dune-3.6.0" && /usr/bin/make -j6 -w release 
make: Entering directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_ocaml_ocaml-dune/ocaml-dune/work/ocaml-dune-bf9eb75'
ocamlc -output-complete-exe -w -24 -g -o .duneboot.exe -I boot unix.cma boot/libs.ml boot/duneboot.ml
./.duneboot.exe
cd _boot && /opt/local/bin/ocamlc -c -g -I +threads fsevents_stubs.c
src/fsevents/fsevents_stubs.c:67:5: error: 'kFSEventStreamEventFlagItemCreated' undeclared here (not in a function); did you mean 'kFSEventStreamEventFlagUserDropped'?
src/fsevents/fsevents_stubs.c:67:42: error: 'kFSEventStreamEventFlagItemRemoved' undeclared here (not in a function); did you mean 'kFSEventStreamEventFlagUserDropped'?
src/fsevents/fsevents_stubs.c:68:5: error: 'kFSEventStreamEventFlagItemRenamed' undeclared here (not in a function); did you mean 'kFSEventStreamEventFlagRootChanged'?
src/fsevents/fsevents_stubs.c:68:42: error: 'kFSEventStreamEventFlagItemModified' undeclared here (not in a function); did you mean 'kFSEventStreamEventFlagUserDropped'?
src/fsevents/fsevents_stubs.c: In function 'dune_fsevents_create':
src/fsevents/fsevents_stubs.c:160:44: error: 'kFSEventStreamCreateFlagFileEvents' undeclared (first use in this function); did you mean 'kFSEventStreamCreateFlagNoDefer'?
src/fsevents/fsevents_stubs.c:160:44: note: each undeclared identifier is reported only once for each function it appears in
src/fsevents/fsevents_stubs.c: In function 'dune_fsevents_set_exclusion_paths':
src/fsevents/fsevents_stubs.c:185:14: warning: implicit declaration of function 'FSEventStreamSetExclusionPaths' [-Wimplicit-function-declaration]
src/fsevents/fsevents_stubs.c: In function 'dune_fsevents_kind':
src/fsevents/fsevents_stubs.c:256:15: error: 'kFSEventStreamEventFlagItemIsDir' undeclared (first use in this function); did you mean 'kFSEventStreamEventFlagUnmount'?
src/fsevents/fsevents_stubs.c: At top level:
src/fsevents/fsevents_stubs.c:298:5: error: 'kFSEventStreamEventFlagItemInodeMetaMod' undeclared here (not in a function); did you mean 'kFSEventStreamEventFlagUserDropped'?
src/fsevents/fsevents_stubs.c:301:5: error: 'kFSEventStreamEventFlagItemFinderInfoMod' undeclared here (not in a function); did you mean 'kFSEventStreamEventFlagKernelDropped'?
src/fsevents/fsevents_stubs.c:302:5: error: 'kFSEventStreamEventFlagItemChangeOwner' undeclared here (not in a function); did you mean 'kFSEventStreamEventFlagRootChanged'?
src/fsevents/fsevents_stubs.c:303:5: error: 'kFSEventStreamEventFlagItemXattrMod' undeclared here (not in a function); did you mean 'kFSEventStreamEventFlagUnmount'?
src/fsevents/fsevents_stubs.c:304:5: error: 'kFSEventStreamEventFlagItemIsFile' undeclared here (not in a function); did you mean 'kFSEventStreamEventFlagUnmount'?
src/fsevents/fsevents_stubs.c:305:5: error: 'kFSEventStreamEventFlagItemIsDir' undeclared here (not in a function); did you mean 'kFSEventStreamEventFlagUnmount'?
src/fsevents/fsevents_stubs.c:306:5: error: 'kFSEventStreamEventFlagItemIsSymlink' undeclared here (not in a function); did you mean 'kFSEventStreamEventFlagUnmount'?
src/fsevents/fsevents_stubs.c:307:5: error: 'kFSEventStreamEventFlagOwnEvent' undeclared here (not in a function); did you mean 'kFSEventStreamEventFlagUnmount'?
src/fsevents/fsevents_stubs.c:308:5: error: 'kFSEventStreamEventFlagItemIsHardlink' undeclared here (not in a function); did you mean 'kFSEventStreamEventFlagHistoryDone'?
src/fsevents/fsevents_stubs.c:309:5: error: 'kFSEventStreamEventFlagItemIsLastHardlink' undeclared here (not in a function); did you mean 'kFSEventStreamEventFlagHistoryDone'?
make: *** [_boot/dune.exe] Error 2

@barracuda156
Copy link
Copy Markdown
Contributor

@barracuda156
Copy link
Copy Markdown
Contributor

Ah, wait a minute, you fix is just not there in 3.6.0. I am sorry, should have not taken it for granted. Gonna add a patch.

@barracuda156
Copy link
Copy Markdown
Contributor

UPD. Nah, it was moved down later by somebody, which has broken the builds on old OS. So yeah, still needed to fix properly.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dune 3.0 doesn't compile on macOS older than 10.13

4 participants