Closed Bug 1844846 Opened 1 year ago Closed 1 year ago

Build fails on Windows, lacking "unistd.h"

Categories

(Firefox Build System :: Android Studio and Gradle Integration, defect)

defect

Tracking

(firefox117 fixed)

RESOLVED FIXED
117 Branch
Tracking Status
firefox117 --- fixed

People

(Reporter: saschanaz, Assigned: m_kato)

References

Details

Attachments

(1 file)

> ./mach build
 0:01.14 W Clobber not needed.
 0:01.38 W Adding make options from C:\Users\sasch\Documents\GitHub\gecko-dev\mozconfig-android-x86-64
    AUTOCLOBBER=1
    MOZ_OBJDIR=C:/Users/sasch/Documents/GitHub/gecko-dev/obj-x86_64-unknown-linux-android
    OBJDIR=C:/Users/sasch/Documents/GitHub/gecko-dev/obj-x86_64-unknown-linux-android
    FOUND_MOZCONFIG=C:/Users/sasch/Documents/GitHub/gecko-dev/mozconfig-android-x86-64
    export FOUND_MOZCONFIG
  Parallelism determined by memory: using 64 jobs for 64 cores based on 63.9 GiB RAM and estimated job size of 1.0 GiB
 0:01.38 C:/Users/sasch/.mozbuild/mozmake/mozmake.exe -f client.mk -j64 -s
 0:04.85 Elapsed: 0.00s; From dist/private: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
 0:04.85 Elapsed: 0.00s; From dist/public: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
 0:04.89 Elapsed: 0.05s; From dist/xpi-stage: Kept 0 existing; Added/updated 56; Removed 0 files and 0 directories.
 0:05.45 Elapsed: 0.58s; From dist/bin: Kept 0 existing; Added/updated 1072; Removed 0 files and 0 directories.
 0:05.66 Elapsed: 0.80s; From _tests: Kept 0 existing; Added/updated 1317; Removed 0 files and 0 directories.
 0:07.36 Elapsed: 2.52s; From dist/include: Kept 0 existing; Added/updated 6894; Removed 0 files and 0 directories.
 0:07.68 ./IsCombiningDiacritic.h.stub
 0:07.70 ./android_apks.stub
 0:09.28  0:00.70 C:/Users/sasch/Documents/GitHub/gecko-dev/gradlew.bat geckoview:generateJNIWrappersForGeneratedWithGeckoBinariesDebug -x lint
 0:09.31 Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=utf-8
 0:11.82 > Configure project :exoplayer2
 0:11.82 WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
 0:11.91 > Configure project :geckoview
 0:11.91 WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the `gradle.properties` file or use the new publishing DSL.
 0:12.12 > Task :exoplayer2:preBuild UP-TO-DATE
 0:12.12 > Task :exoplayer2:preDebugBuild UP-TO-DATE
 0:12.12 > Task :geckoview:preBuild UP-TO-DATE
 0:12.12 > Task :geckoview:preWithGeckoBinariesDebugBuild UP-TO-DATE
 0:12.13 > Task :exoplayer2:compileDebugAidl NO-SOURCE
 0:12.13 > Task :exoplayer2:compileDebugRenderscript NO-SOURCE
 0:12.13 > Task :geckoview:generateWithGeckoBinariesDebugBuildConfig UP-TO-DATE
 0:12.13 > Task :exoplayer2:generateDebugBuildConfig UP-TO-DATE
 0:12.13 > Task :exoplayer2:generateDebugResValues UP-TO-DATE
 0:12.13 > Task :exoplayer2:generateDebugResources UP-TO-DATE
 0:12.13 > Task :exoplayer2:packageDebugResources UP-TO-DATE
 0:12.13 > Task :exoplayer2:parseDebugLocalResources UP-TO-DATE
 0:12.13 > Task :exoplayer2:processDebugManifest UP-TO-DATE
 0:12.14 > Task :annotations:compileJava UP-TO-DATE
 0:12.14 > Task :annotations:processResources NO-SOURCE
 0:12.14 > Task :annotations:classes UP-TO-DATE
 0:12.14 > Task :annotations:jar UP-TO-DATE
 0:12.14 > Task :exoplayer2:generateDebugRFile UP-TO-DATE
 0:12.14 > Task :exoplayer2:javaPreCompileDebug UP-TO-DATE
 0:12.14 > Task :exoplayer2:compileDebugJavaWithJavac UP-TO-DATE
 0:12.14 > Task :exoplayer2:bundleLibCompileToJarDebug UP-TO-DATE
 0:12.14 > Task :exoplayer2:packageDebugRenderscript NO-SOURCE
 0:12.14 > Task :geckoview:compileWithGeckoBinariesDebugAidl UP-TO-DATE
 0:12.14 > Task :geckoview:compileWithGeckoBinariesDebugRenderscript NO-SOURCE
 0:12.14 > Task :geckoview:generateWithGeckoBinariesDebugResValues UP-TO-DATE
 0:12.15 > Task :geckoview:generateWithGeckoBinariesDebugResources UP-TO-DATE
 0:12.15 > Task :geckoview:packageWithGeckoBinariesDebugResources UP-TO-DATE
 0:12.15 > Task :geckoview:parseWithGeckoBinariesDebugLocalResources UP-TO-DATE
 0:12.16 > Task :geckoview:processWithGeckoBinariesDebugManifest UP-TO-DATE
 0:12.16 > Task :geckoview:generateWithGeckoBinariesDebugRFile UP-TO-DATE
 0:12.16 > Task :geckoview:compileWithGeckoBinariesDebugKotlin NO-SOURCE
 0:12.16 > Task :geckoview:javaPreCompileWithGeckoBinariesDebug UP-TO-DATE
 0:12.20 > Task :geckoview:compileWithGeckoBinariesDebugJavaWithJavac UP-TO-DATE
 0:12.20 > Task :geckoview:bundleLibRuntimeToJarWithGeckoBinariesDebug UP-TO-DATE
 0:12.20 > Task :geckoview:generateJNIWrappersForGeneratedWithGeckoBinariesDebug UP-TO-DATE
 0:12.20 BUILD SUCCESSFUL in 2s
 0:12.20 22 actionable tasks: 22 up-to-date
 0:13.57 config/external/wasm2c_sandbox_compiler
 0:13.90 C:/Users/sasch/Documents/GitHub/gecko-dev/third_party/wasm2c/src/color.cc(27,10): fatal error: 'unistd.h' file not found
 0:13.90 #include <unistd.h>
 0:13.91          ^~~~~~~~~~
 0:13.91 1 error generated.
 0:13.91 mozmake[4]: *** [C:/Users/sasch/Documents/GitHub/gecko-dev/config/rules.mk:564: host_color.o] Error 1
 0:13.91 mozmake[4]: *** Waiting for unfinished jobs....
 0:14.65 mozmake[3]: *** [C:/Users/sasch/Documents/GitHub/gecko-dev/config/recurse.mk:72: config/external/wasm2c_sandbox_compiler/host-objects] Error 2
 0:14.65 mozmake[3]: *** Waiting for unfinished jobs....
 0:15.72 mozmake[2]: *** [C:/Users/sasch/Documents/GitHub/gecko-dev/config/recurse.mk:34: compile] Error 2
 0:15.72 mozmake[1]: *** [C:/Users/sasch/Documents/GitHub/gecko-dev/config/rules.mk:361: default] Error 2
 0:15.72 mozmake: *** [client.mk:60: build] Error 2
 0:15.75 W 5 compiler warnings present.

But the code is:

#if HAVE_WIN32_VT100
#include <io.h>
#include <windows.h>
#elif HAVE_UNISTD_H
#include <unistd.h>
#endif

How can it have HAVE_UNISTD_H and then not actually have it?

Any idea how this can happen? config.status indeed has 'HAVE_UNISTD_H': '1'.

Flags: needinfo?(mh+mozilla)
Flags: needinfo?(m_kato)

Subtle reason: because HAVE_UNISTD_H is determined for the target, not the host.

Flags: needinfo?(mh+mozilla)

But shouldn't it check the existence of the header?

https://searchfox.org/mozilla-central/rev/920be8b5eee004fc10a2785fab49b860be4d4ba3/build/autoconf/acspecific.m4#724

AC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))])

That's the point, it checks for the target, which is android.

Hmm. Do you have some idea how the failure can be solved in that case?

https://searchfox.org/mozilla-central/rev/0b55b868c17835942d40ca3fedfca8057481207b/config/external/wasm2c_sandbox_compiler/preprocess_wasm2c_config.py#40

Although I guess this is regression by bug 1843419 , If clang-cl or _WIN32, add #undef HAVE_UNISTD_H. But I don't test it yet.

Flags: needinfo?(m_kato)
Assignee: nobody → m_kato

After landing bug 1843419, color.cc checks HAVE_UNISTD_H. So it should be undefined.

Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/03d08f1bacfa Don't define HAVE_UNISTD_H when host is Windows. r=firefox-build-system-reviewers,glandium
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: