Bug 22823

Summary: Build.h: fails to build mesa & drm which are prereqs for xserver
Product: xorg Reporter: Gaetan Nadon <memsize>
Component: Build/ModularAssignee: Gaetan Nadon <memsize>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: minor    
Priority: low CC: peter.hutterer
Version: gitKeywords: janitor
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
[PATCH] Add mesa and drm modules with correct path #22823
none
[PATCH] build.sh: uncomment #build mesa (prereq for xserver) none

Description Gaetan Nadon 2009-07-17 08:44:36 UTC
The consequence is that xserver module does not build due to a configure check looking for the DRI package. I have attempted to build xserver without DRI but did not succeed. The proposed fixes assume that DRI is a prereq for xserver and must be build. 

There are 2 issues with build.sh regarding mesa & drm:

drm target is always skipped no matter what
-------------------------------------------
Running command ./util/modular/build.sh -o drm/  with apropriate prefix always produces:
Skipping mesa module component drm...

The reason is that build.sh does not expect the usual directory structure for non xorg git path. For example, xcb and pixman are pulled at the same level as xserver, app and others. So build.sh code is <build xserver ""> and <build pixman "">. However, for drm the code is <mesa drm>. This implies the module drm to be under the mesa directory.

mesa target is commented out and...
------------------------------------
The code <#build mesa mesa> also suggests that the mesa code to build is located under the mesa subdirectory. 

Either we have:
mysrc/mesa/mesa
mysrc/mesa/drm
mysrc/xserver
mysrc/pixman

or we have:
mysrc/mesa
mysrc/drm
mysrc/xserver
mysrc/pixman

I will provide a patch for this second option and I will update git_xorg.sh which failed to include mesa as well.
Comment 1 Gaetan Nadon 2009-07-17 08:50:42 UTC
Created attachment 27795 [details] [review]
[PATCH] Add mesa and drm modules with correct path #22823

Patch created on top of patch for #22616
Comment 2 Peter Hutterer 2009-07-19 22:52:12 UTC
the git repositories for both components are under mesa/mesa and mesa/drm. So what the build.sh script does seems to make sense.

Why do you have a different directory structure?
Comment 3 Gaetan Nadon 2009-07-23 07:08:06 UTC
(In reply to comment #2)
> the git repositories for both components are under mesa/mesa and mesa/drm. So
> what the build.sh script does seems to make sense.
> 
> Why do you have a different directory structure?
> 

Thanks for looking into this.

The directory structure I have comes from git_xorg.sh as explained on ModularDevelopersGuide. The example extracts code in /tmp/src which I refer to as $prefix.
---------------------------------------------------------------------
When done, you should see the following:

$ ls -F
app/  data/  doc/  driver/  drm/  font/  git_xorg*  lib/  pixman/ proto/  util/  xcb/  xserver/
----------------------------------------------------------------------

Note that "drm" is under $prefix and not under $prefix/mesa as the git repository path mesa/drm might suggest. Just like "xserver" is under $prefix/xserver and not $prefix/xorg/xserver as the git repository path xorg/xserver might suggest. This makes drm a module as opposed to a component of the mesa module. I assumed the same pattern for mesa (a module), which is missing. 

Either way is supported by the build system (I have tested both). I don't know what is the most accurate representation of the mesa & drm archicture. This is how build.sh currently sees the structure:

$prefix/mesa/drm	drm is a component of the mesa module
$prefix/mesa/mesa	mesa is a component of the mesa module

I can change the git_xorg.sh to match build.sh. In any case, the line to build mesa in build.sh must be uncommented. BTW, I do not have permission to upload (overwrite) an attachment in the wiki page.


Comment 4 Gaetan Nadon 2009-07-23 14:05:26 UTC
I have done some looking around for instructions on building drm and mesa both at X.Org (http://www.x.org/wiki/Development/git) and outside. They all follow the same pattern:

git clone git://git.freedesktop.org/git/mesa/drm
cd drm

git clone git://git.freedesktop.org/git/mesa/mesa
cd mesa

They do not ask to create a toplevel directory "mesa" in front of the git created directory "drm" or "mesa" (these instructions do not use build.sh). This is also consistent with the ModularDevelopersGuide. With the proposed patch, build.sh would work on already extracted mesa & drm code.
Comment 5 Gaetan Nadon 2009-07-26 06:09:19 UTC
Created attachment 28009 [details] [review]
[PATCH] build.sh: uncomment #build mesa (prereq for xserver)

This patch keeps everything as they were, but simply uncomments the "build mesa mesa" line.
Comment 6 Gaetan Nadon 2009-07-26 06:18:20 UTC
The new --clone ensures a consistent and predictable directory structure. Having a single top level directory for mesa provides flexibility for the future. I have replaced the original patch with the one that just uncomments the line to build mesa.
Comment 7 Peter Hutterer 2009-08-25 15:41:07 UTC
Pushed as 48e735ca843c4de83c29c78532d5e1bca45f47d5. Thanks for the patch.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.