Skip to contentSkip to conversation

postgresql: remove devfiles from target

PATCH New Floris Bos 3 participants 8 messages Aug 9, 2014 – Aug 13, 2014

lore
Share & tools
lore

Floris Bos

author
#0 lore raw

PATCH 1/1 postgresql: remove devfiles from target

---
 package/postgresql/postgresql.mk | 2 ++
 1 file changed, 2 insertions(+)
package/postgresql/postgresql.mk +2 -0
index 0fecbc7..6d71b9c 100644
@@ -51,6 +51,8 @@ endef
 
 define POSTGRESQL_INSTALL_TARGET_FIXUP
 	$(INSTALL) -dm 0700 $(TARGET_DIR)/var/lib/pgsql
+	rm -f $(TARGET_DIR)/usr/bin/pg_config
+	rm -rf $(TARGET_DIR)/usr/lib/postgresql/pgxs
 endef
 
 POSTGRESQL_POST_INSTALL_TARGET_HOOKS += POSTGRESQL_INSTALL_TARGET_FIXUP
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/1 postgresql: remove devfiles from target

Floris Bos <[email protected]> schreef:

Quoted 15 lines

---
package/postgresql/postgresql.mk | 2 ++

1 file changed, 2 insertions(+)
package/postgresql/postgresql.mk +0 -0
index 0fecbc7..6d71b9c 100644
@@ -51,6 +51,8 @@ endef
 

define POSTGRESQL_INSTALL_TARGET_FIXUP

	$(INSTALL) -dm 0700 $(TARGET_DIR)/var/lib/pgsql
package/postgresql/postgresql.mk +2 -0
+	rm -f $(TARGET_DIR)/usr/bin/pg_config
+	rm -rf $(TARGET_DIR)/usr/lib/postgresql/pgxs
Quoted 1 line

endef

Not entirely sure here, but isn't the better approach for pg_config to add it to POSTGRESQL_CONFIG_SCRIPTS? This will ensure the file is fixed up for staging usr, and removed from target automatically.

author
#2 lore raw

PATCH 1/1 postgresql: remove devfiles from target

Quoted 7 lines · Thomas De Schampheleire

define POSTGRESQL_INSTALL_TARGET_FIXUP

	$(INSTALL) -dm 0700 $(TARGET_DIR)/var/lib/pgsql
package/postgresql/postgresql.mk +2 -0
+	rm -f $(TARGET_DIR)/usr/bin/pg_config
+	rm -rf $(TARGET_DIR)/usr/lib/postgresql/pgxs

endef
Not entirely sure here, but isn't the better approach for pg_config to add it to POSTGRESQL_CONFIG_SCRIPTS? This will ensure the file is fixed up for staging usr, and removed from target automatically.

Note that pg_config is an ELF executable compiled for the target architecture, and not a text script that can be easily fixed up.

Yours sincerely,

Floris Bos

#3 lore raw

PATCH 1/1 postgresql: remove devfiles from target

Hi Floris,

Quoted 12 lines · Floris Bos
Quoted 10 lines · Thomas De Schampheleire

define POSTGRESQL_INSTALL_TARGET_FIXUP

        $(INSTALL) -dm 0700 $(TARGET_DIR)/var/lib/pgsql
package/postgresql/postgresql.mk +2 -0
+       rm -f $(TARGET_DIR)/usr/bin/pg_config
+       rm -rf $(TARGET_DIR)/usr/lib/postgresql/pgxs

endef
Not entirely sure here, but isn't the better approach for pg_config to add it to POSTGRESQL_CONFIG_SCRIPTS? This will ensure the file is fixed up for staging usr, and removed from target automatically.

Quoted 2 lines

Note that pg_config is an ELF executable compiled for the target architecture, and not a text script that can be easily fixed up.

Ok, in this case adding it to POSTGRESQL_CONFIG_SCRIPTS may not be the best idea.

Best regards,
Thomas

#4 lore raw

PATCH 1/1 postgresql: remove devfiles from target

Dear Thomas De Schampheleire,

Quoted 10 lines · Thomas De Schampheleire
Quoted 7 lines
Quoted 4 lines

Not entirely sure here, but isn't the better approach for pg_config to add it to POSTGRESQL_CONFIG_SCRIPTS? This will ensure the file is fixed up for staging usr, and removed from target automatically.

Note that pg_config is an ELF executable compiled for the target architecture, and not a text script that can be easily fixed up.

Ok, in this case adding it to POSTGRESQL_CONFIG_SCRIPTS may not be the best idea.

More precisely: it will simply not work. The <pkg>_CONFIG_SCRIPTS mechanism assumes that the <pkg>-config files are shell scripts, in a certain format. With an ELF executable compiled for the target:

1/ There's no way the <pkg>_CONFIG_SCRIPTS mechanism can work

2/ There's no real point in keeping this file on the build machine,
because it's an executable built for the target.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
author
#5 lore raw

PATCH 1/1 postgresql: remove devfiles from target

Hi,

Quoted 10 lines · Thomas Petazzoni
Quoted 8 lines · Thomas De Schampheleire
Quoted 6 lines
Quoted 4 lines

Not entirely sure here, but isn't the better approach for pg_config to add it to POSTGRESQL_CONFIG_SCRIPTS? This will ensure the file is fixed up for staging usr, and removed from target automatically.

Note that pg_config is an ELF executable compiled for the target architecture, and not a text script that can be easily fixed up.

Ok, in this case adding it to POSTGRESQL_CONFIG_SCRIPTS may not be the best idea.

Quoted 8 lines

More precisely: it will simply not work. The <pkg>_CONFIG_SCRIPTS mechanism assumes that the <pkg>-config files are shell scripts, in a certain format. With an ELF executable compiled for the target:

1/ There's no way the <pkg>_CONFIG_SCRIPTS mechanism can work

2/ There's no real point in keeping this file on the build machine,
because it's an executable built for the target.

Do wonder if we shouldn't provide a simple replacement script for pg_config, e.g. just implementing "--includedir" and "--libdir" Might be less work than patching configure scripts that want to call pg_config.

Yours sincerely,

Floris Bos

#6 lore raw

PATCH 1/1 postgresql: remove devfiles from target

Dear Floris Bos,

Quoted 6 lines · Floris Bos
Quoted 6 lines

More precisely: it will simply not work. The <pkg>_CONFIG_SCRIPTS mechanism assumes that the <pkg>-config files are shell scripts, in a certain format. With an ELF executable compiled for the target:

1/ There's no way the <pkg>_CONFIG_SCRIPTS mechanism can work

Quoted 7 lines
Quoted 2 lines

2/ There's no real point in keeping this file on the build machine,
because it's an executable built for the target.

Do wonder if we shouldn't provide a simple replacement script for pg_config, e.g. just implementing "--includedir" and "--libdir" Might be less work than patching configure scripts that want to call pg_config.

Yes, that's certainly an option. If there are many packages relying on pg_config, it's going to be easier to provide a fake pg_config rather than patching all those packages (such as PHP). Maybe even this approach could be submitted for upstream inclusion in Postgresql?

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
author
#7 lore raw

PATCH 1/1 postgresql: remove devfiles from target

Quoted 10 lines · Thomas Petazzoni
Quoted 8 lines · Floris Bos
Quoted 8 lines

More precisely: it will simply not work. The <pkg>_CONFIG_SCRIPTS mechanism assumes that the <pkg>-config files are shell scripts, in a certain format. With an ELF executable compiled for the target:

1/ There's no way the <pkg>_CONFIG_SCRIPTS mechanism can work

2/ There's no real point in keeping this file on the build machine,
because it's an executable built for the target.

Quoted 8 lines
Quoted 4 lines

Do wonder if we shouldn't provide a simple replacement script for pg_config, e.g. just implementing "--includedir" and "--libdir" Might be less work than patching configure scripts that want to call pg_config.

Yes, that's certainly an option. If there are many packages relying on pg_config, it's going to be easier to provide a fake pg_config rather than patching all those packages (such as PHP). Maybe even this approach could be submitted for upstream inclusion in Postgresql?

Convincing upstream to go back to a shell based pg_config might be difficult.
They actually had that at some point, but replaced it with the current application, because they needed a solution that also works on Windows (natively, without using Mingw/cygwin)

Signature · 3 lines
Yours sincerely,

Floris Bos