Stream: compiler development

Topic: Missing -framework SystemConfiguration


view this post on Zulip Luke Boswell (Jun 12 2024 at 05:03):

Re the refactor-host PR to basic-webserver in https://github.com/roc-lang/basic-webserver/pull/54

For some reason we need to manually include the SystemConfiguration framework on macOS. I'm not sure why this is, as I don't think I changed any of the dependencies or the implementation.

Should we include this dependency in the roc cli linker flags for macos?

$ roc build.roc
$ roc examples/echo.roc
ld: Undefined symbols:
  _SCDynamicStoreCopyProxies, referenced from:
      __ZN20system_configuration13dynamic_store14SCDynamicStore11get_proxies17h14f45c468676b58dE in macos-arm64.a[317](system_configuration-758316b543f8b3e3.system_configuration.d443724f54d24ca5-cgu.0.rcgu.o)
  _SCDynamicStoreCreateWithOptions, referenced from:
      __ZN20system_configuration13dynamic_store14SCDynamicStore6create17h33baa5654af0261cE in macos-arm64.a[317](system_configuration-758316b543f8b3e3.system_configuration.d443724f54d24ca5-cgu.0.rcgu.o)
<.... etc>

$ ROC_LINK_FLAGS="-framework SystemConfiguration" roc examples/echo.roc
⚠️ CAUTION: The ROC_LINK_FLAGS environment variable is a temporary workaround, and will no longer do anything once surgical linking lands! If you're concerned about what this means for your use case, please ask about it on Zulip.
Listening on <http://127.0.0.1:8000>

view this post on Zulip Luke Boswell (Jun 12 2024 at 05:04):

@Brendan Hansknecht I thought you mentioned you might look into this, but I've lost the conversation - and could have just imagined that.

view this post on Zulip Brendan Hansknecht (Jun 12 2024 at 05:22):

System Configuration

Allow applications to access a device’s network configuration settings. Determine the reachability of the device, such as whether Wi-Fi or cell connectivity are active.

view this post on Zulip Brendan Hansknecht (Jun 12 2024 at 05:23):

Maybe needed to setup tcp ???

view this post on Zulip Brendan Hansknecht (Jun 12 2024 at 05:23):

Like the new socket library

view this post on Zulip Luke Boswell (Jun 12 2024 at 05:27):

Interesting. I hadn't planned to change any dependencies... but I moved things around etc and that has generated a new cargo.lock file which has bumped the version on a lot of things.

view this post on Zulip Brendan Hansknecht (Jun 12 2024 at 05:29):

Oh..... Hmm..... Not sure then

view this post on Zulip Brendan Hansknecht (Jun 12 2024 at 05:30):

Weird for that to just get pulled in.... Feels like it's shouldnt be needed

view this post on Zulip Luke Boswell (Jun 12 2024 at 05:30):

Ok, so it's the patch on reqwest from 0.11.20 -> 0.11.27 which adds the system-configuration dependency

view this post on Zulip Luke Boswell (Jun 12 2024 at 05:31):

https://docs.rs/system-configuration/latest/system_configuration/

view this post on Zulip Brendan Hansknecht (Jun 12 2024 at 05:37):

Hmm...ok

view this post on Zulip Brendan Hansknecht (Jun 12 2024 at 05:37):

Probably fine to just add

view this post on Zulip Luke Boswell (Jun 12 2024 at 05:37):

I'll make a PR for roc then

view this post on Zulip Brendan Hansknecht (Jun 12 2024 at 05:37):

This is why platforms really need to either control linker or just be surgical....one daj

view this post on Zulip Luke Boswell (Jun 12 2024 at 05:47):

PR https://github.com/roc-lang/roc/pull/6806


Last updated: Jul 06 2025 at 12:14 UTC